mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-17 21:38:22 +01:00
56 lines
1.8 KiB
YAML
56 lines
1.8 KiB
YAML
services:
|
|
Rector\PSR4\Rector\Namespace_\NormalizeNamespaceByPSR4ComposerAutoloadRector: ~
|
|
|
|
parameters:
|
|
exclude_paths:
|
|
- "/Fixture/"
|
|
- "/Expected/"
|
|
- "/Source/"
|
|
- "packages/Symfony/src/Bridge/DefaultAnalyzedSymfonyApplicationContainer.php"
|
|
- "src/Testing/PHPUnit/AbstractRectorTestCase.php"
|
|
- "packages/Php/tests/Rector/Name/ReservedObjectRector/*"
|
|
|
|
# autoload-buggy cases
|
|
- "*.php.inc"
|
|
|
|
# so Rector code is still PHP 7.2 compatible
|
|
php_version_features: '7.2'
|
|
|
|
# @see utils/RectorGenerator/config/config.yaml
|
|
rector_recipe:
|
|
# run "bin/rector create" to create a new Rector + tests from this config
|
|
package: "Phalcon"
|
|
name: "AddRequestToHandleMethodCallRector"
|
|
node_types:
|
|
# put main node first, it is used to create namespace
|
|
- "MethodCall"
|
|
|
|
description: "Add $_SERVER REQUEST_URI to method call"
|
|
code_before: >
|
|
<?php
|
|
|
|
class SomeClass
|
|
{
|
|
public function run($di)
|
|
{
|
|
$application = new \Phalcon\Mvc\Application();
|
|
$response = $application->handle();
|
|
}
|
|
}
|
|
|
|
code_after: >
|
|
<?php
|
|
|
|
class SomeClass
|
|
{
|
|
public function run($di)
|
|
{
|
|
$application = new \Phalcon\Mvc\Application();
|
|
$response = $application->handle($_SERVER["REQUEST_URI"]);
|
|
}
|
|
}
|
|
|
|
source: # e.g. link to RFC or headline in upgrade guide, 1 or more in the list
|
|
- "https://github.com/rectorphp/rector/issues/2408"
|
|
set: "phalcon40" # e.g. symfony30, target config to append this rector to
|