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); /* * This file is part of PHP CS Fixer. * * (c) Fabien..
Decoded Output download
<?php
declare(strict_types=1);
/*
* This file is part of PHP CS Fixer.
*
* (c) Fabien Potencier <[email protected]>
* Dariusz Rumiski <[email protected]>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace PhpCsFixer\RuleSet;
use Symfony\Component\Finder\Finder;
/**
* Set of rule sets to be used by fixer.
*
* @internal
*/
final class RuleSets
{
/**
* @var array<string, RuleSetDescriptionInterface>
*/
private static $setDefinitions;
/**
* @return array<string, RuleSetDescriptionInterface>
*/
public static function getSetDefinitions(): array
{
if (null === self::$setDefinitions) {
self::$setDefinitions = [];
foreach (Finder::create()->files()->in(__DIR__.'/Sets') as $file) {
$class = 'PhpCsFixer\RuleSet\Sets\'.$file->getBasename('.php');
$set = new $class();
self::$setDefinitions[$set->getName()] = $set;
}
uksort(self::$setDefinitions, static fn (string $x, string $y): int => strnatcmp($x, $y));
}
return self::$setDefinitions;
}
/**
* @return list<string>
*/
public static function getSetDefinitionNames(): array
{
return array_keys(self::getSetDefinitions());
}
public static function getSetDefinition(string $name): RuleSetDescriptionInterface
{
$definitions = self::getSetDefinitions();
if (!isset($definitions[$name])) {
throw new \InvalidArgumentException(sprintf('Set "%s" does not exist.', $name));
}
return $definitions[$name];
}
}
?>
Did this file decode correctly?
Original Code
<?php
declare(strict_types=1);
/*
* This file is part of PHP CS Fixer.
*
* (c) Fabien Potencier <[email protected]>
* Dariusz Rumiski <[email protected]>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace PhpCsFixer\RuleSet;
use Symfony\Component\Finder\Finder;
/**
* Set of rule sets to be used by fixer.
*
* @internal
*/
final class RuleSets
{
/**
* @var array<string, RuleSetDescriptionInterface>
*/
private static $setDefinitions;
/**
* @return array<string, RuleSetDescriptionInterface>
*/
public static function getSetDefinitions(): array
{
if (null === self::$setDefinitions) {
self::$setDefinitions = [];
foreach (Finder::create()->files()->in(__DIR__.'/Sets') as $file) {
$class = 'PhpCsFixer\RuleSet\Sets\\'.$file->getBasename('.php');
$set = new $class();
self::$setDefinitions[$set->getName()] = $set;
}
uksort(self::$setDefinitions, static fn (string $x, string $y): int => strnatcmp($x, $y));
}
return self::$setDefinitions;
}
/**
* @return list<string>
*/
public static function getSetDefinitionNames(): array
{
return array_keys(self::getSetDefinitions());
}
public static function getSetDefinition(string $name): RuleSetDescriptionInterface
{
$definitions = self::getSetDefinitions();
if (!isset($definitions[$name])) {
throw new \InvalidArgumentException(sprintf('Set "%s" does not exist.', $name));
}
return $definitions[$name];
}
}
Function Calls
None |
Stats
MD5 | 51b6303f433dcf34105f049ccf65a899 |
Eval Count | 0 |
Decode Time | 85 ms |