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 declare (strict_types=1); namespace Symplify\RuleDocGenerator\ValueObject; use Sym..
Decoded Output download
<?php
declare (strict_types=1);
namespace Symplify\RuleDocGenerator\ValueObject;
use Symplify\RuleDocGenerator\Contract\CodeSampleInterface;
use Symplify\RuleDocGenerator\Exception\ShouldNotHappenException;
abstract class AbstractCodeSample implements CodeSampleInterface
{
/**
* @var non-empty-string
* @readonly
*/
private $goodCode;
/**
* @var non-empty-string
* @readonly
*/
private $badCode;
public function __construct(string $badCode, string $goodCode)
{
$badCode = rim($badCode);
$goodCode = rim($goodCode);
if ($badCode === '') {
throw new ShouldNotHappenException('Bad sample good code cannot be empty');
}
if ($goodCode === '') {
throw new ShouldNotHappenException('Good sample good code cannot be empty');
}
if ($goodCode === $badCode) {
$errorMessage = \sprintf('Good and bad code cannot be identical: "%s"', $goodCode);
throw new ShouldNotHappenException($errorMessage);
}
$this->goodCode = $goodCode;
$this->badCode = $badCode;
}
public function getGoodCode() : string
{
return $this->goodCode;
}
public function getBadCode() : string
{
return $this->badCode;
}
}
?>
Did this file decode correctly?
Original Code
<?php
declare (strict_types=1);
namespace Symplify\RuleDocGenerator\ValueObject;
use Symplify\RuleDocGenerator\Contract\CodeSampleInterface;
use Symplify\RuleDocGenerator\Exception\ShouldNotHappenException;
abstract class AbstractCodeSample implements CodeSampleInterface
{
/**
* @var non-empty-string
* @readonly
*/
private $goodCode;
/**
* @var non-empty-string
* @readonly
*/
private $badCode;
public function __construct(string $badCode, string $goodCode)
{
$badCode = \trim($badCode);
$goodCode = \trim($goodCode);
if ($badCode === '') {
throw new ShouldNotHappenException('Bad sample good code cannot be empty');
}
if ($goodCode === '') {
throw new ShouldNotHappenException('Good sample good code cannot be empty');
}
if ($goodCode === $badCode) {
$errorMessage = \sprintf('Good and bad code cannot be identical: "%s"', $goodCode);
throw new ShouldNotHappenException($errorMessage);
}
$this->goodCode = $goodCode;
$this->badCode = $badCode;
}
public function getGoodCode() : string
{
return $this->goodCode;
}
public function getBadCode() : string
{
return $this->badCode;
}
}
Function Calls
None |
Stats
MD5 | fe4f8bee04b8de58bb01a2c9b06f9c69 |
Eval Count | 0 |
Decode Time | 76 ms |