Updated Rector to commit 71c4131360

61a58df44e [Scoped] Remove vendor/tracy/tracy/examples on downgrade 71c4131360 Merge pull request #1628 from rectorphp/remove-tracy-examples
This commit is contained in:
Tomas Votruba 2022-01-04 16:28:21 +00:00
parent 72567779cf
commit d24d0b280d
28 changed files with 60 additions and 621 deletions

View File

@ -23,25 +23,24 @@ final class BinaryOpTreeRootLocator
public function findOperationRoot(\PhpParser\Node\Expr $expr, string $binaryOpClass) : \PhpParser\Node\Expr
{
$parentNode = $expr->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::PARENT_NODE);
if (!$parentNode instanceof \PhpParser\Node) {
if ($parentNode === null) {
// No more parents so the Expr node must be root.
return $expr;
}
if (\get_class($parentNode) !== $binaryOpClass) {
// If the Expr node is not a child of the desired operation,
// it must already be the root of the operation tree.
return $expr;
}
if (!$parentNode instanceof \PhpParser\Node\Expr\BinaryOp) {
return $expr;
}
if ($parentNode->left === $expr) {
return $this->findOperationRoot($parentNode, $binaryOpClass);
}
$isRightChild = $parentNode->right === $expr;
if (!$isRightChild) {
return $expr;
}
if (\get_class($expr) === $binaryOpClass) {
$isParentARightAssociativeTree = $parentNode->right === $expr && \get_class($expr) === $binaryOpClass;
if ($isParentARightAssociativeTree) {
// The Expr node is the right child of its parent but it is the desired operation (BinaryOp b c).
// Since the AST fragment (BinaryOp a >(BinaryOp b c)<) corresponds to a right-associative,
// the current node must be the root of a left-associative tree.
return $expr;
}
// We already know the parent is the desired operation and the current node is not its right child.
// This means the parent is a root of a larger left-associative tree so we continue recursively.
return $this->findOperationRoot($parentNode, $binaryOpClass);
}
}

View File

@ -16,11 +16,11 @@ final class VersionResolver
/**
* @var string
*/
public const PACKAGE_VERSION = '74b90d35752d75433bc5fe5e6933bed8a1cb4dee';
public const PACKAGE_VERSION = '71c413136000fbf3d585ed420efa923568890352';
/**
* @var string
*/
public const RELEASE_DATE = '2022-01-04 16:12:19';
public const RELEASE_DATE = '2022-01-04 23:16:56';
public static function resolvePackageVersion() : string
{
$process = new \RectorPrefix20220104\Symfony\Component\Process\Process(['git', 'log', '--pretty="%H"', '-n1', 'HEAD'], __DIR__);

2
vendor/autoload.php vendored
View File

@ -4,4 +4,4 @@
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit6548ac26ebe6ed31fc495f1070c5150c::getLoader();
return ComposerAutoloaderInit9de265cdab490f429e5e4b76ebc3a84b::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit6548ac26ebe6ed31fc495f1070c5150c
class ComposerAutoloaderInit9de265cdab490f429e5e4b76ebc3a84b
{
private static $loader;
@ -22,15 +22,15 @@ class ComposerAutoloaderInit6548ac26ebe6ed31fc495f1070c5150c
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit6548ac26ebe6ed31fc495f1070c5150c', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit9de265cdab490f429e5e4b76ebc3a84b', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
spl_autoload_unregister(array('ComposerAutoloaderInit6548ac26ebe6ed31fc495f1070c5150c', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit9de265cdab490f429e5e4b76ebc3a84b', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit6548ac26ebe6ed31fc495f1070c5150c::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit9de265cdab490f429e5e4b76ebc3a84b::getInitializer($loader));
} else {
$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
@ -42,12 +42,12 @@ class ComposerAutoloaderInit6548ac26ebe6ed31fc495f1070c5150c
$loader->register(true);
if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInit6548ac26ebe6ed31fc495f1070c5150c::$files;
$includeFiles = Composer\Autoload\ComposerStaticInit9de265cdab490f429e5e4b76ebc3a84b::$files;
} else {
$includeFiles = require __DIR__ . '/autoload_files.php';
}
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire6548ac26ebe6ed31fc495f1070c5150c($fileIdentifier, $file);
composerRequire9de265cdab490f429e5e4b76ebc3a84b($fileIdentifier, $file);
}
return $loader;
@ -59,7 +59,7 @@ class ComposerAutoloaderInit6548ac26ebe6ed31fc495f1070c5150c
* @param string $file
* @return void
*/
function composerRequire6548ac26ebe6ed31fc495f1070c5150c($fileIdentifier, $file)
function composerRequire9de265cdab490f429e5e4b76ebc3a84b($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;

View File

@ -4,7 +4,7 @@
namespace Composer\Autoload;
class ComposerStaticInit6548ac26ebe6ed31fc495f1070c5150c
class ComposerStaticInit9de265cdab490f429e5e4b76ebc3a84b
{
public static $files = array (
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
@ -3850,9 +3850,9 @@ class ComposerStaticInit6548ac26ebe6ed31fc495f1070c5150c
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit6548ac26ebe6ed31fc495f1070c5150c::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit6548ac26ebe6ed31fc495f1070c5150c::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit6548ac26ebe6ed31fc495f1070c5150c::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit9de265cdab490f429e5e4b76ebc3a84b::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit9de265cdab490f429e5e4b76ebc3a84b::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit9de265cdab490f429e5e4b76ebc3a84b::$classMap;
}, null, ClassLoader::class);
}

View File

@ -2590,12 +2590,12 @@
"source": {
"type": "git",
"url": "https:\/\/github.com\/rectorphp\/rector-symfony.git",
"reference": "b92de39d109c19cd3db5e965fe9a339ff568cfb1"
"reference": "91fd3f3882171c6f0c7e60c44e689e8d7d8ad0a4"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-symfony\/zipball\/b92de39d109c19cd3db5e965fe9a339ff568cfb1",
"reference": "b92de39d109c19cd3db5e965fe9a339ff568cfb1",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-symfony\/zipball\/91fd3f3882171c6f0c7e60c44e689e8d7d8ad0a4",
"reference": "91fd3f3882171c6f0c7e60c44e689e8d7d8ad0a4",
"shasum": ""
},
"require": {
@ -2608,14 +2608,14 @@
},
"require-dev": {
"phpstan\/extension-installer": "^1.1",
"phpstan\/phpstan": "^1.1",
"phpstan\/phpstan": "^1.3",
"phpstan\/phpstan-strict-rules": "^1.1",
"phpstan\/phpstan-webmozart-assert": "^1.0",
"phpunit\/phpunit": "^9.5",
"rector\/phpstan-rules": "^0.4.4",
"rector\/rector-src": "dev-main",
"symfony\/security-core": "^5.3",
"symfony\/security-http": "^5.3",
"symfony\/security-core": "^5.4",
"symfony\/security-http": "^5.4",
"symplify\/easy-coding-standard": "^10.0",
"symplify\/monorepo-builder": "^10.0",
"symplify\/phpstan-extensions": "^10.0",
@ -2623,7 +2623,7 @@
"symplify\/rule-doc-generator": "^10.0",
"symplify\/vendor-patches": "^10.0"
},
"time": "2021-12-27T12:43:06+00:00",
"time": "2022-01-04T15:19:59+00:00",
"default-branch": true,
"type": "rector-extension",
"extra": {

File diff suppressed because one or more lines are too long

View File

@ -9,7 +9,7 @@ namespace Rector\RectorInstaller;
*/
final class GeneratedConfig
{
public const EXTENSIONS = array('rector/rector-cakephp' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-cakephp', 'relative_install_path' => '../../rector-cakephp', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main f601f07'), 'rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main d65a9b0'), 'rector/rector-generator' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-generator', 'relative_install_path' => '../../rector-generator', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 36d651e'), 'rector/rector-laravel' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-laravel', 'relative_install_path' => '../../rector-laravel', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 96d50d4'), 'rector/rector-nette' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-nette', 'relative_install_path' => '../../rector-nette', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main eb859a5'), 'rector/rector-phpoffice' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpoffice', 'relative_install_path' => '../../rector-phpoffice', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 3f56f3b'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main cd2eb3d'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main b92de39'), 'ssch/typo3-rector' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/ssch/typo3-rector', 'relative_install_path' => '../../../ssch/typo3-rector', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 0233a19'));
public const EXTENSIONS = array('rector/rector-cakephp' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-cakephp', 'relative_install_path' => '../../rector-cakephp', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main f601f07'), 'rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main d65a9b0'), 'rector/rector-generator' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-generator', 'relative_install_path' => '../../rector-generator', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 36d651e'), 'rector/rector-laravel' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-laravel', 'relative_install_path' => '../../rector-laravel', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 96d50d4'), 'rector/rector-nette' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-nette', 'relative_install_path' => '../../rector-nette', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main eb859a5'), 'rector/rector-phpoffice' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpoffice', 'relative_install_path' => '../../rector-phpoffice', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 3f56f3b'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main cd2eb3d'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 91fd3f3'), 'ssch/typo3-rector' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/ssch/typo3-rector', 'relative_install_path' => '../../../ssch/typo3-rector', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 0233a19'));
private function __construct()
{
}

View File

@ -10,11 +10,11 @@
},
"require-dev": {
"phpunit\/phpunit": "^9.5",
"phpstan\/phpstan": "^1.1",
"phpstan\/phpstan": "^1.3",
"rector\/rector-src": "dev-main",
"symplify\/phpstan-rules": "^10.0",
"symfony\/security-core": "^5.3",
"symfony\/security-http": "^5.3",
"symfony\/security-core": "^5.4",
"symfony\/security-http": "^5.4",
"symplify\/monorepo-builder": "^10.0",
"symplify\/phpstan-extensions": "^10.0",
"symplify\/easy-coding-standard": "^10.0",

View File

@ -18,6 +18,7 @@ use PHPStan\Type\UnionType;
use Rector\TypeDeclaration\Rector\ClassMethod\AddReturnTypeDeclarationRector;
use Rector\TypeDeclaration\ValueObject\AddReturnTypeDeclaration;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use RectorPrefix20220104\Symplify\PackageBuilder\Reflection\PrivatesAccessor;
// https://github.com/symfony/symfony/blob/6.1/UPGRADE-6.0.md
// @see https://github.com/symfony/symfony/blob/6.1/.github/expected-missing-return-types.diff
return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void {
@ -34,6 +35,13 @@ return static function (\Symfony\Component\DependencyInjection\Loader\Configurat
$nullableValueGuessType = new \PHPStan\Type\UnionType([new \PHPStan\Type\NullType(), new \PHPStan\Type\ObjectType('Symfony\\Component\\Form\\Guess\\ValueGuess')]);
$configurationType = new \PHPStan\Type\ObjectType('Symfony\\Component\\Config\\Definition\\ConfigurationInterface');
$scalarTypes = [$arrayType, new \PHPStan\Type\BooleanType(), new \PHPStan\Type\StringType(), new \PHPStan\Type\IntegerType(), new \PHPStan\Type\FloatType(), new \PHPStan\Type\NullType()];
$scalarArrayObjectUnionedTypes = \array_merge($scalarTypes, [new \PHPStan\Type\ObjectType('ArrayObject')]);
// cannot be crated with \PHPStan\Type\UnionTypeHelper::sortTypes() as ObjectType requires a class reflection we do not have here
$unionTypeReflectionClass = new \ReflectionClass(\PHPStan\Type\UnionType::class);
/** @var UnionType $scalarArrayObjectUnionType */
$scalarArrayObjectUnionType = $unionTypeReflectionClass->newInstanceWithoutConstructor();
$privatesAccessor = new \RectorPrefix20220104\Symplify\PackageBuilder\Reflection\PrivatesAccessor();
$privatesAccessor->setPrivateProperty($scalarArrayObjectUnionType, 'types', $scalarArrayObjectUnionedTypes);
// @see https://github.com/symfony/symfony/pull/42064
$services = $containerConfigurator->services();
$services->set(\Rector\TypeDeclaration\Rector\ClassMethod\AddReturnTypeDeclarationRector::class)->configure([
@ -152,10 +160,10 @@ return static function (\Symfony\Component\DependencyInjection\Loader\Configurat
new \Rector\TypeDeclaration\ValueObject\AddReturnTypeDeclaration('Symfony\\Component\\Validator\\Constraint', 'getRequiredOptions', $arrayType),
new \Rector\TypeDeclaration\ValueObject\AddReturnTypeDeclaration('Symfony\\Component\\Validator\\Constraint', 'validatedBy', new \PHPStan\Type\StringType()),
new \Rector\TypeDeclaration\ValueObject\AddReturnTypeDeclaration('Symfony\\Component\\Validator\\Constraint', 'getTargets', new \PHPStan\Type\UnionType([new \PHPStan\Type\StringType(), $arrayType])),
new \Rector\TypeDeclaration\ValueObject\AddReturnTypeDeclaration('Symfony\\Component\\Serializer\\Normalizer\\AbstractObjectNormalizer', 'normalize', new \PHPStan\Type\UnionType(\array_merge($scalarTypes, [new \PHPStan\Type\ObjectType('ArrayObject')]))),
new \Rector\TypeDeclaration\ValueObject\AddReturnTypeDeclaration('Symfony\\Component\\Serializer\\Normalizer\\AbstractObjectNormalizer', 'normalize', $scalarArrayObjectUnionType),
new \Rector\TypeDeclaration\ValueObject\AddReturnTypeDeclaration('Symfony\\Component\\DependencyInjection\\Container', 'getParameter', new \PHPStan\Type\UnionType($scalarTypes)),
new \Rector\TypeDeclaration\ValueObject\AddReturnTypeDeclaration('Symfony\\Component\\DependencyInjection\\ContainerInterface', 'getParameter', new \PHPStan\Type\UnionType($scalarTypes)),
new \Rector\TypeDeclaration\ValueObject\AddReturnTypeDeclaration('Symfony\\Component\\Serializer\\Normalizer\\NormalizerInterface', 'normalize', new \PHPStan\Type\UnionType(\array_merge($scalarTypes, [new \PHPStan\Type\ObjectType('ArrayObject')]))),
new \Rector\TypeDeclaration\ValueObject\AddReturnTypeDeclaration('Symfony\\Component\\Serializer\\Normalizer\\NormalizerInterface', 'normalize', $scalarArrayObjectUnionType),
new \Rector\TypeDeclaration\ValueObject\AddReturnTypeDeclaration('Symfony\\Component\\Security\\Http\\Authenticator\\AuthenticatorInterface', 'authenticate', new \PHPStan\Type\ObjectType('Symfony\\Component\\Security\\Http\\Authenticator\\Passport\\Passport')),
]);
};

View File

@ -8,6 +8,7 @@ use Rector\DeadCode\Rector\If_\RemoveDeadInstanceOfRector;
use Rector\Php55\Rector\String_\StringClassNameToClassConstantRector;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Set\ValueObject\SetList;
use Rector\Symfony\Set\SymfonySetList;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void {
$parameters = $containerConfigurator->parameters();
@ -24,4 +25,6 @@ return static function (\Symfony\Component\DependencyInjection\Loader\Configurat
$containerConfigurator->import(\Rector\Set\ValueObject\LevelSetList::UP_TO_PHP_80);
$containerConfigurator->import(\Rector\Set\ValueObject\SetList::CODE_QUALITY);
$containerConfigurator->import(\Rector\Set\ValueObject\SetList::DEAD_CODE);
// for testing
$containerConfigurator->import(\Rector\Symfony\Set\SymfonySetList::SYMFONY_60);
};

View File

@ -9,8 +9,8 @@ $loader = require_once __DIR__.'/autoload.php';
if (!class_exists('AutoloadIncluder', false) && !interface_exists('AutoloadIncluder', false) && !trait_exists('AutoloadIncluder', false)) {
spl_autoload_call('RectorPrefix20220104\AutoloadIncluder');
}
if (!class_exists('ComposerAutoloaderInit6548ac26ebe6ed31fc495f1070c5150c', false) && !interface_exists('ComposerAutoloaderInit6548ac26ebe6ed31fc495f1070c5150c', false) && !trait_exists('ComposerAutoloaderInit6548ac26ebe6ed31fc495f1070c5150c', false)) {
spl_autoload_call('RectorPrefix20220104\ComposerAutoloaderInit6548ac26ebe6ed31fc495f1070c5150c');
if (!class_exists('ComposerAutoloaderInit9de265cdab490f429e5e4b76ebc3a84b', false) && !interface_exists('ComposerAutoloaderInit9de265cdab490f429e5e4b76ebc3a84b', false) && !trait_exists('ComposerAutoloaderInit9de265cdab490f429e5e4b76ebc3a84b', false)) {
spl_autoload_call('RectorPrefix20220104\ComposerAutoloaderInit9de265cdab490f429e5e4b76ebc3a84b');
}
if (!class_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false) && !interface_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false) && !trait_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false)) {
spl_autoload_call('RectorPrefix20220104\Helmich\TypoScriptParser\Parser\AST\Statement');
@ -48,18 +48,6 @@ if (!class_exists('Symplify\ComposerJsonManipulator\ValueObject\ComposerJson', f
if (!class_exists('Symplify\SmartFileSystem\SmartFileInfo', false) && !interface_exists('Symplify\SmartFileSystem\SmartFileInfo', false) && !trait_exists('Symplify\SmartFileSystem\SmartFileInfo', false)) {
spl_autoload_call('RectorPrefix20220104\Symplify\SmartFileSystem\SmartFileInfo');
}
if (!class_exists('Test', false) && !interface_exists('Test', false) && !trait_exists('Test', false)) {
spl_autoload_call('RectorPrefix20220104\Test');
}
if (!class_exists('ParentClass', false) && !interface_exists('ParentClass', false) && !trait_exists('ParentClass', false)) {
spl_autoload_call('RectorPrefix20220104\ParentClass');
}
if (!class_exists('ChildClass', false) && !interface_exists('ChildClass', false) && !trait_exists('ChildClass', false)) {
spl_autoload_call('RectorPrefix20220104\ChildClass');
}
if (!class_exists('DemoClass', false) && !interface_exists('DemoClass', false) && !trait_exists('DemoClass', false)) {
spl_autoload_call('RectorPrefix20220104\DemoClass');
}
// Functions whitelisting. For more information see:
// https://github.com/humbug/php-scoper/blob/master/README.md#functions-whitelisting
@ -78,9 +66,9 @@ if (!function_exists('print_node')) {
return \RectorPrefix20220104\print_node(...func_get_args());
}
}
if (!function_exists('composerRequire6548ac26ebe6ed31fc495f1070c5150c')) {
function composerRequire6548ac26ebe6ed31fc495f1070c5150c() {
return \RectorPrefix20220104\composerRequire6548ac26ebe6ed31fc495f1070c5150c(...func_get_args());
if (!function_exists('composerRequire9de265cdab490f429e5e4b76ebc3a84b')) {
function composerRequire9de265cdab490f429e5e4b76ebc3a84b() {
return \RectorPrefix20220104\composerRequire9de265cdab490f429e5e4b76ebc3a84b(...func_get_args());
}
}
if (!function_exists('scanPath')) {
@ -198,56 +186,21 @@ if (!function_exists('includeIfExists')) {
return \RectorPrefix20220104\includeIfExists(...func_get_args());
}
}
if (!function_exists('bdump')) {
function bdump() {
return \RectorPrefix20220104\bdump(...func_get_args());
}
}
if (!function_exists('this_is_fatal_error')) {
function this_is_fatal_error() {
return \RectorPrefix20220104\this_is_fatal_error(...func_get_args());
}
}
if (!function_exists('dump')) {
function dump() {
return \RectorPrefix20220104\dump(...func_get_args());
}
}
if (!function_exists('demo')) {
function demo() {
return \RectorPrefix20220104\demo(...func_get_args());
}
}
if (!function_exists('first')) {
function first() {
return \RectorPrefix20220104\first(...func_get_args());
}
}
if (!function_exists('second')) {
function second() {
return \RectorPrefix20220104\second(...func_get_args());
}
}
if (!function_exists('third')) {
function third() {
return \RectorPrefix20220104\third(...func_get_args());
}
}
if (!function_exists('foo')) {
function foo() {
return \RectorPrefix20220104\foo(...func_get_args());
}
}
if (!function_exists('head')) {
function head() {
return \RectorPrefix20220104\head(...func_get_args());
}
}
if (!function_exists('dumpe')) {
function dumpe() {
return \RectorPrefix20220104\dumpe(...func_get_args());
}
}
if (!function_exists('bdump')) {
function bdump() {
return \RectorPrefix20220104\bdump(...func_get_args());
}
}
if (!function_exists('compressJs')) {
function compressJs() {
return \RectorPrefix20220104\compressJs(...func_get_args());

View File

@ -1,73 +0,0 @@
<?php
declare (strict_types=1);
namespace RectorPrefix20220104;
require __DIR__ . '/../src/tracy.php';
use RectorPrefix20220104\Tracy\Debugger;
// For security reasons, Tracy is visible only on localhost.
// You may force Tracy to run in development mode by passing the Debugger::DEVELOPMENT instead of Debugger::DETECT.
\RectorPrefix20220104\Tracy\Debugger::enable(\RectorPrefix20220104\Tracy\Debugger::DETECT, __DIR__ . '/log');
if (isset($_SERVER['HTTP_X_REQUESTED_WITH'])) {
// AJAX request
\RectorPrefix20220104\bdump('AJAX request ' . \date('H:i:s'));
if (!empty($_GET['error'])) {
\RectorPrefix20220104\this_is_fatal_error();
}
$data = [\rand(), \rand(), \rand()];
\header('Content-Type: application/json');
\header('Cache-Control: no-cache');
echo \json_encode($data);
exit;
}
\RectorPrefix20220104\bdump('classic request ' . \date('H:i:s'));
?>
<!DOCTYPE html><html class=arrow><link rel="stylesheet" href="assets/style.css">
<h1>Tracy: AJAX demo using fetch()</h1>
<p>
<button>AJAX request</button> <span id=result>see Debug Bar in the bottom right corner</span>
</p>
<p>
<button class=error>Request with error</button> use ESC to toggle BlueScreen
</p>
<script>
// default settings:
// window.TracyAutoRefresh = true;
// window.TracyMaxAjaxRows = 3;
var result = document.getElementById('result');
document.querySelectorAll('button').forEach((button) => {
button.addEventListener('click', () => {
result.innerText = 'loading…';
fetch(
button.classList.contains('error') ? '?error=1' : '?',
{
method: 'GET',
headers: {
'Content-Type': 'application/json',
'X-Requested-With': 'XMLHttpRequest',
//'X-Tracy-Ajax': Tracy.getAjaxHeader(), // use when auto-refresh is disabled via window.TracyAutoRefresh = false;
}
}
)
.then( response => response.json() )
.then( json => result.innerText = 'loaded: ' + json )
.catch( e => result.innerText = 'error' )
});
});
</script>
<?php
if (\RectorPrefix20220104\Tracy\Debugger::$productionMode) {
echo '<p><b>For security reasons, Tracy is visible only on localhost. Look into the source code to see how to enable Tracy.</b></p>';
}

View File

@ -1,73 +0,0 @@
<?php
declare (strict_types=1);
namespace RectorPrefix20220104;
require __DIR__ . '/../src/tracy.php';
use RectorPrefix20220104\Tracy\Debugger;
// For security reasons, Tracy is visible only on localhost.
// You may force Tracy to run in development mode by passing the Debugger::DEVELOPMENT instead of Debugger::DETECT.
\RectorPrefix20220104\Tracy\Debugger::enable(\RectorPrefix20220104\Tracy\Debugger::DETECT, __DIR__ . '/log');
if (isset($_SERVER['HTTP_X_REQUESTED_WITH'])) {
// AJAX request
\RectorPrefix20220104\bdump('AJAX request ' . \date('H:i:s'));
if (!empty($_GET['error'])) {
\RectorPrefix20220104\this_is_fatal_error();
}
$data = [\rand(), \rand(), \rand()];
\header('Content-Type: application/json');
\header('Cache-Control: no-cache');
echo \json_encode($data);
exit;
}
\RectorPrefix20220104\bdump('classic request ' . \date('H:i:s'));
?>
<!DOCTYPE html><html class=arrow><link rel="stylesheet" href="assets/style.css">
<h1>Tracy: AJAX demo</h1>
<p>
<button>AJAX request</button> <span id=result>see Debug Bar in the bottom right corner</span>
</p>
<p>
<button class=error>Request with error</button> use ESC to toggle BlueScreen
</p>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script>
// default settings:
// window.TracyAutoRefresh = true;
// window.TracyMaxAjaxRows = 3;
var jqxhr;
$('button').click(function() {
$('#result').text('loading…');
if (jqxhr) {
jqxhr.abort();
}
jqxhr = $.ajax({
data: {error: $(this).hasClass('error') * 1},
dataType: 'json',
jsonp: false
}).done(function(data) {
$('#result').text('loaded: ' + data);
}).fail(function() {
$('#result').text('error');
});
});
</script>
<?php
if (\RectorPrefix20220104\Tracy\Debugger::$productionMode) {
echo '<p><b>For security reasons, Tracy is visible only on localhost. Look into the source code to see how to enable Tracy.</b></p>';
}

View File

@ -1,6 +0,0 @@
<?php
declare (strict_types=1);
namespace RectorPrefix20220104;
$this = 2;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 817 B

View File

@ -1,33 +0,0 @@
html {
font: 15px/1.5 Tahoma, sans-serif;
color: #333;
background: #fff;
margin: 0 1.6em;
padding: 0;
}
html.arrow {
background: #fff url(arrow.png) no-repeat bottom right;
height: 100%;
}
h1, h2 {
font-size: 210%;
font-weight: normal;
color: #036;
}
h2 {
margin-top: 2em;
font-size: 140%;
}
pre.tracy-dump {
border: 1px solid silver;
padding: 1em;
margin: 1em 0;
}
a {
color: #000080;
}

View File

@ -1,25 +0,0 @@
<?php
declare (strict_types=1);
namespace RectorPrefix20220104;
require __DIR__ . '/../src/tracy.php';
use RectorPrefix20220104\Tracy\Debugger;
// For security reasons, Tracy is visible only on localhost.
// You may force Tracy to run in development mode by passing the Debugger::DEVELOPMENT instead of Debugger::DETECT.
\RectorPrefix20220104\Tracy\Debugger::enable(\RectorPrefix20220104\Tracy\Debugger::DETECT, __DIR__ . '/log');
?>
<!DOCTYPE html><html class=arrow><link rel="stylesheet" href="assets/style.css">
<h1>Tracy: bar dump demo</h1>
<p>You can dump variables to bar in rightmost bottom egde.</p>
<?php
$arr = [10, 20.2, \true, null, 'hello', (object) null, []];
\RectorPrefix20220104\bdump(\get_defined_vars());
\RectorPrefix20220104\bdump($arr, 'The Array');
\RectorPrefix20220104\bdump('<a href="#">test</a>', 'String');
if (\RectorPrefix20220104\Tracy\Debugger::$productionMode) {
echo '<p><b>For security reasons, Tracy is visible only on localhost. Look into the source code to see how to enable Tracy.</b></p>';
}

View File

@ -1,42 +0,0 @@
<?php
declare (strict_types=1);
namespace RectorPrefix20220104;
require __DIR__ . '/../src/tracy.php';
use RectorPrefix20220104\Tracy\Debugger;
use RectorPrefix20220104\Tracy\Dumper;
// For security reasons, Tracy is visible only on localhost.
// You may force Tracy to run in development mode by passing the Debugger::DEVELOPMENT instead of Debugger::DETECT.
\RectorPrefix20220104\Tracy\Debugger::enable(\RectorPrefix20220104\Tracy\Debugger::DETECT, __DIR__ . '/log');
?>
<!DOCTYPE html><link rel="stylesheet" href="assets/style.css">
<h1>Tracy: Dumper with common snapshot demo</h1>
<div itemscope>
<?php
class Test
{
public $x = [];
protected $z = 30;
private $y = 'hello';
}
\class_alias('RectorPrefix20220104\\Test', 'Test', \false);
$arr = [10, 'hello', \fopen(__FILE__, 'r')];
$obj = new \RectorPrefix20220104\Test();
$snapshot = [];
echo \RectorPrefix20220104\Tracy\Dumper::toHtml($arr, [\RectorPrefix20220104\Tracy\Dumper::SNAPSHOT => &$snapshot]);
echo \RectorPrefix20220104\Tracy\Dumper::toHtml($obj, [\RectorPrefix20220104\Tracy\Dumper::SNAPSHOT => &$snapshot]);
// changed array is detected
$arr[0] = 'CHANGED!';
echo \RectorPrefix20220104\Tracy\Dumper::toHtml($arr, [\RectorPrefix20220104\Tracy\Dumper::SNAPSHOT => &$snapshot]);
// changed object is not detected, because is part of snapshot
$obj->x = 'CHANGED!';
echo \RectorPrefix20220104\Tracy\Dumper::toHtml($obj, [\RectorPrefix20220104\Tracy\Dumper::SNAPSHOT => &$snapshot]);
// prints snapshot
echo '<meta itemprop=tracy-snapshot content=', \RectorPrefix20220104\Tracy\Dumper::formatSnapshotAttribute($snapshot), '>';
echo '</div>';
if (\RectorPrefix20220104\Tracy\Debugger::$productionMode) {
echo '<p><b>For security reasons, Tracy is visible only on localhost. Look into the source code to see how to enable Tracy.</b></p>';
}

View File

@ -1,59 +0,0 @@
<?php
declare (strict_types=1);
namespace RectorPrefix20220104;
require __DIR__ . '/../src/tracy.php';
use RectorPrefix20220104\Tracy\Debugger;
// For security reasons, Tracy is visible only on localhost.
// You may force Tracy to run in development mode by passing the Debugger::DEVELOPMENT instead of Debugger::DETECT.
\RectorPrefix20220104\Tracy\Debugger::enable(\RectorPrefix20220104\Tracy\Debugger::DETECT, __DIR__ . '/log');
?>
<!DOCTYPE html><link rel="stylesheet" href="assets/style.css">
<h1>Tracy: dump() demo</h1>
<?php
echo "<h2>Basic Types</h2>\n";
\RectorPrefix20220104\dump('any string', 123, [\true, \false, null]);
echo "<h2>Dark Mode</h2>\n";
\RectorPrefix20220104\Tracy\Debugger::$dumpTheme = 'dark';
\RectorPrefix20220104\dump('any string');
echo "<h2>Objects</h2>\n";
echo "<p>Hover over the name <code>\$baz</code> to see property declaring class and over the hash <code>#5</code> to see same objects.</p>\n";
class ParentClass
{
public $foo = [10, 20];
protected $bar = 30;
private $baz = 'parent';
}
\class_alias('RectorPrefix20220104\\ParentClass', 'ParentClass', \false);
class ChildClass extends \RectorPrefix20220104\ParentClass
{
private $baz = 'child';
}
\class_alias('RectorPrefix20220104\\ChildClass', 'ChildClass', \false);
$obj = new \RectorPrefix20220104\ChildClass();
$obj->dynamic = 'hello';
$obj->selfReference = $obj;
\RectorPrefix20220104\dump($obj);
echo "<h2>Strings</h2>\n";
echo "<p>Hover over the string to see length.</p>\n";
$arr = ['single line' => 'hello', 'binary' => "binary string", 'multi line' => "first\r\nsecond\nthird\n indented line", 'long' => \str_repeat('tracy ', 1000)];
\RectorPrefix20220104\dump($arr);
echo "<h2>References and Recursion</h2>\n";
echo "<p>Hover over the reference <code>&1</code> to see referenced values.</p>\n";
$arr = ['first', 'second', 'third'];
$arr[] =& $arr[0];
$arr[] =& $arr[1];
$arr[] =& $arr;
\RectorPrefix20220104\dump($arr);
echo "<h2>Special Types</h2>\n";
$arr = [\fopen(__FILE__, 'r'), new class
{
}, function ($x, $y) use(&$arr, $obj) {
}];
\RectorPrefix20220104\dump($arr);
if (\RectorPrefix20220104\Tracy\Debugger::$productionMode) {
echo '<p><b>For security reasons, Tracy is visible only on localhost. Look into the source code to see how to enable Tracy.</b></p>';
}

View File

@ -1,41 +0,0 @@
<?php
declare (strict_types=1);
namespace RectorPrefix20220104;
require __DIR__ . '/../src/tracy.php';
use RectorPrefix20220104\Tracy\Debugger;
// For security reasons, Tracy is visible only on localhost.
// You may force Tracy to run in development mode by passing the Debugger::DEVELOPMENT instead of Debugger::DETECT.
\RectorPrefix20220104\Tracy\Debugger::enable(\RectorPrefix20220104\Tracy\Debugger::DETECT, __DIR__ . '/log');
?>
<!DOCTYPE html><link rel="stylesheet" href="assets/style.css">
<h1>Tracy: exception demo</h1>
<?php
class DemoClass
{
public function first($arg1, $arg2)
{
$this->second(\true, \false);
}
public function second($arg1, $arg2)
{
self::third([1, 2, 3]);
}
public static function third($arg1)
{
throw new \Exception('The my exception', 123);
}
}
\class_alias('RectorPrefix20220104\\DemoClass', 'DemoClass', \false);
function demo($a, $b)
{
$demo = new \RectorPrefix20220104\DemoClass();
$demo->first($a, $b);
}
if (\RectorPrefix20220104\Tracy\Debugger::$productionMode) {
echo '<p><b>For security reasons, Tracy is visible only on localhost. Look into the source code to see how to enable Tracy.</b></p>';
}
\RectorPrefix20220104\demo(10, 'any string');

View File

@ -1,20 +0,0 @@
<?php
declare (strict_types=1);
namespace RectorPrefix20220104;
require __DIR__ . '/../src/tracy.php';
use RectorPrefix20220104\Tracy\Debugger;
// For security reasons, Tracy is visible only on localhost.
// You may force Tracy to run in development mode by passing the Debugger::DEVELOPMENT instead of Debugger::DETECT.
\RectorPrefix20220104\Tracy\Debugger::enable(\RectorPrefix20220104\Tracy\Debugger::DETECT, __DIR__ . '/log');
?>
<!DOCTYPE html><link rel="stylesheet" href="assets/style.css">
<h1>Tracy: fatal error demo</h1>
<?php
if (\RectorPrefix20220104\Tracy\Debugger::$productionMode) {
echo '<p><b>For security reasons, Tracy is visible only on localhost. Look into the source code to see how to enable Tracy.</b></p>';
}
require __DIR__ . '/assets/E_COMPILE_ERROR.php';

View File

@ -1,35 +0,0 @@
<?php
declare (strict_types=1);
namespace RectorPrefix20220104;
require __DIR__ . '/../src/tracy.php';
use RectorPrefix20220104\Tracy\Debugger;
$arr = [10, 20, ['key1' => 'val1', 'key2' => \true]];
// will show in FireLogger
\RectorPrefix20220104\Tracy\Debugger::fireLog('Hello World');
\RectorPrefix20220104\Tracy\Debugger::fireLog($arr);
function first($arg1, $arg2)
{
\RectorPrefix20220104\second(\true, \false);
}
function second($arg1, $arg2)
{
\RectorPrefix20220104\third([1, 2, 3]);
}
function third($arg1)
{
throw new \Exception('The my exception', 123);
}
try {
\RectorPrefix20220104\first(10, 'any string');
} catch (\Throwable $e) {
\RectorPrefix20220104\Tracy\Debugger::fireLog($e);
}
?>
<!DOCTYPE html><link rel="stylesheet" href="assets/style.css">
<h1>Tracy: FireLogger demo</h1>
<p>How to <a href="https://tracy.nette.org/#toc-firelogger">enable FireLogger</a>?</p>
<?php

View File

@ -1,25 +0,0 @@
<?php
declare (strict_types=1);
namespace RectorPrefix20220104;
require __DIR__ . '/../src/tracy.php';
use RectorPrefix20220104\Tracy\Debugger;
// For security reasons, Tracy is visible only on localhost.
// You may force Tracy to run in development mode by passing the Debugger::DEVELOPMENT instead of Debugger::DETECT.
\RectorPrefix20220104\Tracy\Debugger::enable(\RectorPrefix20220104\Tracy\Debugger::DETECT, __DIR__ . '/log');
\RectorPrefix20220104\Tracy\Debugger::$strictMode = \true;
?>
<!DOCTYPE html><link rel="stylesheet" href="assets/style.css">
<h1>Tracy Notice and StrictMode demo</h1>
<?php
function foo($from)
{
echo $form;
}
\RectorPrefix20220104\foo(123);
if (\RectorPrefix20220104\Tracy\Debugger::$productionMode) {
echo '<p><b>For security reasons, Tracy is visible only on localhost. Look into the source code to see how to enable Tracy.</b></p>';
}

View File

@ -1,13 +0,0 @@
<?php
declare (strict_types=1);
namespace RectorPrefix20220104;
require __DIR__ . '/../src/tracy.php';
\RectorPrefix20220104\Tracy\OutputDebugger::enable();
function head()
{
echo '<!DOCTYPE html><link rel="stylesheet" href="assets/style.css">';
}
\RectorPrefix20220104\head();
echo '<h1>Output Debugger demo</h1>';

View File

@ -1,31 +0,0 @@
<?php
declare (strict_types=1);
namespace RectorPrefix20220104;
require __DIR__ . '/../src/tracy.php';
use RectorPrefix20220104\Tracy\Debugger;
// For security reasons, Tracy is visible only on localhost.
// You may force Tracy to run in development mode by passing the Debugger::DEVELOPMENT instead of Debugger::DETECT.
\RectorPrefix20220104\Tracy\Debugger::enable(\RectorPrefix20220104\Tracy\Debugger::DETECT, __DIR__ . '/log');
if (isset($_GET['sleep'])) {
\header('Content-Type: application/javascript');
\sleep(10);
exit;
}
?>
<!DOCTYPE html><html class=arrow><link rel="stylesheet" href="assets/style.css">
<h1>Tracy: Preloading</h1>
<?php
\RectorPrefix20220104\Tracy\Debugger::renderLoader();
?>
<script src="?sleep=1"></script>
<?php
if (\RectorPrefix20220104\Tracy\Debugger::$productionMode) {
echo '<p><b>For security reasons, Tracy is visible only on localhost. Look into the source code to see how to enable Tracy.</b></p>';
}

View File

@ -1,27 +0,0 @@
<?php
declare (strict_types=1);
namespace RectorPrefix20220104;
require __DIR__ . '/../src/tracy.php';
use RectorPrefix20220104\Tracy\Debugger;
// For security reasons, Tracy is visible only on localhost.
// You may force Tracy to run in development mode by passing the Debugger::DEVELOPMENT instead of Debugger::DETECT.
\RectorPrefix20220104\Tracy\Debugger::enable(\RectorPrefix20220104\Tracy\Debugger::DETECT, __DIR__ . '/log');
if (empty($_GET['redirect'])) {
\RectorPrefix20220104\bdump('before redirect ' . \date('H:i:s'));
\header('Location: ' . (isset($_GET['ajax']) ? 'ajax-fetch.php' : 'redirect.php?&redirect=1'));
exit;
}
\RectorPrefix20220104\bdump('after redirect ' . \date('H:i:s'));
?>
<!DOCTYPE html><html class=arrow><link rel="stylesheet" href="assets/style.css">
<h1>Tracy: redirect demo</h1>
<p><a href="?">redirect again</a> or <a href="?ajax">redirect to AJAX demo</a></p>
<?php
if (\RectorPrefix20220104\Tracy\Debugger::$productionMode) {
echo '<p><b>For security reasons, Tracy is visible only on localhost. Look into the source code to see how to enable Tracy.</b></p>';
}

View File

@ -1,21 +0,0 @@
<?php
declare (strict_types=1);
namespace RectorPrefix20220104;
require __DIR__ . '/../src/tracy.php';
use RectorPrefix20220104\Tracy\Debugger;
// For security reasons, Tracy is visible only on localhost.
// You may force Tracy to run in development mode by passing the Debugger::DEVELOPMENT instead of Debugger::DETECT.
\RectorPrefix20220104\Tracy\Debugger::enable(\RectorPrefix20220104\Tracy\Debugger::DETECT, __DIR__ . '/log');
\RectorPrefix20220104\Tracy\Debugger::$strictMode = \true;
?>
<!DOCTYPE html><link rel="stylesheet" href="assets/style.css">
<h1>Tracy Warning and StrictMode demo</h1>
<?php
$f = \fopen('nonexistent', 'r');
if (\RectorPrefix20220104\Tracy\Debugger::$productionMode) {
echo '<p><b>For security reasons, Tracy is visible only on localhost. Look into the source code to see how to enable Tracy.</b></p>';
}