Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php namespace Prophecy\Doubler\Generator\Node; use Prophecy\Exception\InvalidArgumentEx..

Decoded Output download

<?php
 namespace Prophecy\Doubler\Generator\Node; use Prophecy\Exception\InvalidArgumentException; class MethodNode { private $name; private $code; private $visibility = "public"; private $static = false; private $returnsReference = false; private $returnTypeNode; private $arguments = array(); public function __construct($name, $code = null) { $this->name = $name; $this->code = $code; $this->returnTypeNode = new ReturnTypeNode(); } public function getVisibility() { return $this->visibility; } public function setVisibility($visibility) { $visibility = strtolower($visibility); if (!\in_array($visibility, array("public", "private", "protected"), true)) { throw new InvalidArgumentException(sprintf("`%s` method visibility is not supported.", $visibility)); } $this->visibility = $visibility; } public function isStatic() { return $this->static; } public function setStatic($static = true) { $this->static = (bool) $static; } public function returnsReference() { return $this->returnsReference; } public function setReturnsReference() { $this->returnsReference = true; } public function getName() { return $this->name; } public function addArgument(ArgumentNode $argument) { $this->arguments[] = $argument; } public function getArguments() { return $this->arguments; } public function hasReturnType() { return (bool) $this->returnTypeNode->getNonNullTypes(); } public function setReturnTypeNode(ReturnTypeNode $returnTypeNode) : void { $this->returnTypeNode = $returnTypeNode; } public function setReturnType($type = null) { $this->returnTypeNode = $type === '' || $type === null ? new ReturnTypeNode() : new ReturnTypeNode($type); } public function setNullableReturnType($bool = true) { if ($bool) { $this->returnTypeNode = new ReturnTypeNode("null", ...$this->returnTypeNode->getTypes()); } else { $this->returnTypeNode = new ReturnTypeNode(...$this->returnTypeNode->getNonNullTypes()); } } public function getReturnType() { if ($types = $this->returnTypeNode->getNonNullTypes()) { return $types[0]; } return null; } public function getReturnTypeNode() : ReturnTypeNode { return $this->returnTypeNode; } public function hasNullableReturnType() { return $this->returnTypeNode->canUseNullShorthand(); } public function setCode($code) { $this->code = $code; } public function getCode() { if ($this->returnsReference) { return "throw new \Prophecy\Exception\Doubler\ReturnByReferenceException('Returning by reference not supported', get_class($this), '{$this->name}');"; } return (string) $this->code; } public function useParentCode() { $this->code = sprintf("return parent::%s(%s);", $this->getName(), implode(", ", array_map(array($this, "generateArgument"), $this->arguments))); } private function generateArgument(ArgumentNode $arg) { $argument = "$" . $arg->getName(); if ($arg->isVariadic()) { $argument = "..." . $argument; } return $argument; } } ?>

Did this file decode correctly?

Original Code

<?php
 namespace Prophecy\Doubler\Generator\Node; use Prophecy\Exception\InvalidArgumentException; class MethodNode { private $name; private $code; private $visibility = "\x70\x75\x62\154\x69\x63"; private $static = false; private $returnsReference = false; private $returnTypeNode; private $arguments = array(); public function __construct($name, $code = null) { $this->name = $name; $this->code = $code; $this->returnTypeNode = new ReturnTypeNode(); } public function getVisibility() { return $this->visibility; } public function setVisibility($visibility) { $visibility = strtolower($visibility); if (!\in_array($visibility, array("\x70\165\x62\154\x69\143", "\160\162\x69\x76\141\164\145", "\x70\x72\x6f\x74\145\x63\x74\x65\144"), true)) { throw new InvalidArgumentException(sprintf("\x60\45\x73\140\x20\155\x65\164\150\157\144\x20\166\x69\x73\x69\142\x69\x6c\x69\x74\x79\40\x69\x73\40\156\157\164\40\163\165\160\160\x6f\162\x74\145\x64\x2e", $visibility)); } $this->visibility = $visibility; } public function isStatic() { return $this->static; } public function setStatic($static = true) { $this->static = (bool) $static; } public function returnsReference() { return $this->returnsReference; } public function setReturnsReference() { $this->returnsReference = true; } public function getName() { return $this->name; } public function addArgument(ArgumentNode $argument) { $this->arguments[] = $argument; } public function getArguments() { return $this->arguments; } public function hasReturnType() { return (bool) $this->returnTypeNode->getNonNullTypes(); } public function setReturnTypeNode(ReturnTypeNode $returnTypeNode) : void { $this->returnTypeNode = $returnTypeNode; } public function setReturnType($type = null) { $this->returnTypeNode = $type === '' || $type === null ? new ReturnTypeNode() : new ReturnTypeNode($type); } public function setNullableReturnType($bool = true) { if ($bool) { $this->returnTypeNode = new ReturnTypeNode("\x6e\x75\x6c\x6c", ...$this->returnTypeNode->getTypes()); } else { $this->returnTypeNode = new ReturnTypeNode(...$this->returnTypeNode->getNonNullTypes()); } } public function getReturnType() { if ($types = $this->returnTypeNode->getNonNullTypes()) { return $types[0]; } return null; } public function getReturnTypeNode() : ReturnTypeNode { return $this->returnTypeNode; } public function hasNullableReturnType() { return $this->returnTypeNode->canUseNullShorthand(); } public function setCode($code) { $this->code = $code; } public function getCode() { if ($this->returnsReference) { return "\x74\x68\x72\157\x77\40\x6e\x65\x77\x20\x5c\x50\x72\x6f\x70\150\145\x63\x79\x5c\x45\170\x63\145\x70\164\x69\x6f\x6e\x5c\x44\157\x75\142\154\145\162\x5c\122\145\x74\x75\162\156\x42\171\122\x65\x66\x65\162\x65\156\143\x65\105\x78\x63\145\x70\164\x69\157\156\50\x27\x52\x65\164\x75\x72\x6e\x69\156\147\x20\142\171\x20\162\x65\x66\x65\x72\x65\x6e\x63\145\x20\156\x6f\164\x20\x73\165\160\160\157\162\x74\145\x64\x27\54\x20\147\145\x74\x5f\143\154\141\x73\163\x28\44\164\150\x69\x73\51\54\x20\x27{$this->name}\47\51\73"; } return (string) $this->code; } public function useParentCode() { $this->code = sprintf("\x72\145\x74\x75\162\x6e\x20\x70\141\x72\145\156\x74\x3a\72\45\163\x28\x25\x73\51\x3b", $this->getName(), implode("\x2c\40", array_map(array($this, "\x67\145\156\145\162\141\x74\145\101\162\x67\x75\x6d\x65\x6e\x74"), $this->arguments))); } private function generateArgument(ArgumentNode $arg) { $argument = "\x24" . $arg->getName(); if ($arg->isVariadic()) { $argument = "\56\x2e\x2e" . $argument; } return $argument; } }

Function Calls

None

Variables

None

Stats

MD5 c72ff9ce41255426effa59f64181fa35
Eval Count 0
Decode Time 103 ms