mirror of https://github.com/rectorphp/rector.git
fix cs
This commit is contained in:
parent
c549d40111
commit
0800c7cdc3
|
@ -34,7 +34,10 @@ final class ParamPhpDocNodeVisitor extends AbstractPhpDocNodeVisitor implements
|
|||
}
|
||||
|
||||
$variadicAwareParamTagValueNode = new VariadicAwareParamTagValueNode(
|
||||
$node->type, $node->isVariadic, $node->parameterName, $node->description
|
||||
$node->type,
|
||||
$node->isVariadic,
|
||||
$node->parameterName,
|
||||
$node->description
|
||||
);
|
||||
|
||||
$this->attributeMirrorer->mirror($node, $variadicAwareParamTagValueNode);
|
||||
|
|
|
@ -63,8 +63,8 @@ final class BetterPhpDocParser extends PhpDocParser
|
|||
$children[] = $this->parseChildAndStoreItsPositions($tokenIterator);
|
||||
|
||||
while ($tokenIterator->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL) && ! $tokenIterator->isCurrentTokenType(
|
||||
Lexer::TOKEN_CLOSE_PHPDOC
|
||||
)) {
|
||||
Lexer::TOKEN_CLOSE_PHPDOC
|
||||
)) {
|
||||
$children[] = $this->parseChildAndStoreItsPositions($tokenIterator);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,7 +41,8 @@ final class FileHashComputer
|
|||
|
||||
throw new ShouldNotHappenException(sprintf(
|
||||
// getRealPath() cannot be used, as it breaks in phar
|
||||
'Provide only PHP file, ready for Symfony Dependency Injection. "%s" given', $fileInfo->getRelativeFilePath()
|
||||
'Provide only PHP file, ready for Symfony Dependency Injection. "%s" given',
|
||||
$fileInfo->getRelativeFilePath()
|
||||
));
|
||||
}
|
||||
|
||||
|
|
|
@ -65,9 +65,11 @@ final class NodeAddingPostRector extends AbstractPostRector
|
|||
|
||||
public function getRuleDefinition(): RuleDefinition
|
||||
{
|
||||
return new RuleDefinition('Add nodes on weird positions', [
|
||||
new CodeSample(
|
||||
<<<'CODE_SAMPLE'
|
||||
return new RuleDefinition(
|
||||
'Add nodes on weird positions',
|
||||
[
|
||||
new CodeSample(
|
||||
<<<'CODE_SAMPLE'
|
||||
class SomeClass
|
||||
{
|
||||
public function run($value)
|
||||
|
@ -76,8 +78,8 @@ class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
,
|
||||
<<<'CODE_SAMPLE'
|
||||
,
|
||||
<<<'CODE_SAMPLE'
|
||||
class SomeClass
|
||||
{
|
||||
public function run($value)
|
||||
|
@ -88,7 +90,7 @@ class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
), ]
|
||||
), ]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -109,8 +109,10 @@ final class NodeRemovingPostRector extends AbstractPostRector
|
|||
|
||||
public function getRuleDefinition(): RuleDefinition
|
||||
{
|
||||
return new RuleDefinition('Remove nodes from weird positions', [
|
||||
new CodeSample(
|
||||
return new RuleDefinition(
|
||||
'Remove nodes from weird positions',
|
||||
[
|
||||
new CodeSample(
|
||||
<<<'CODE_SAMPLE'
|
||||
class SomeClass
|
||||
{
|
||||
|
@ -122,7 +124,7 @@ class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
,
|
||||
,
|
||||
<<<'CODE_SAMPLE'
|
||||
class SomeClass
|
||||
{
|
||||
|
|
|
@ -39,8 +39,10 @@ final class NodeToReplacePostRector extends AbstractPostRector
|
|||
|
||||
public function getRuleDefinition(): RuleDefinition
|
||||
{
|
||||
return new RuleDefinition('Replaces nodes on weird positions', [
|
||||
new CodeSample(
|
||||
return new RuleDefinition(
|
||||
'Replaces nodes on weird positions',
|
||||
[
|
||||
new CodeSample(
|
||||
<<<'CODE_SAMPLE'
|
||||
class SomeClass
|
||||
{
|
||||
|
@ -50,7 +52,7 @@ class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
,
|
||||
,
|
||||
<<<'CODE_SAMPLE'
|
||||
class SomeClass
|
||||
{
|
||||
|
@ -60,7 +62,7 @@ class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
), ]
|
||||
), ]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -80,8 +80,10 @@ final class PropertyAddingPostRector extends AbstractPostRector
|
|||
|
||||
public function getRuleDefinition(): RuleDefinition
|
||||
{
|
||||
return new RuleDefinition('Add dependency properties', [
|
||||
new CodeSample(
|
||||
return new RuleDefinition(
|
||||
'Add dependency properties',
|
||||
[
|
||||
new CodeSample(
|
||||
<<<'CODE_SAMPLE'
|
||||
class SomeClass
|
||||
{
|
||||
|
@ -91,7 +93,7 @@ class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
,
|
||||
,
|
||||
<<<'CODE_SAMPLE'
|
||||
class SomeClass
|
||||
{
|
||||
|
|
|
@ -127,8 +127,10 @@ final class UseAddingPostRector extends AbstractPostRector
|
|||
|
||||
public function getRuleDefinition(): RuleDefinition
|
||||
{
|
||||
return new RuleDefinition('Add unique use imports collected during Rector run', [
|
||||
new CodeSample(
|
||||
return new RuleDefinition(
|
||||
'Add unique use imports collected during Rector run',
|
||||
[
|
||||
new CodeSample(
|
||||
<<<'CODE_SAMPLE'
|
||||
class SomeClass
|
||||
{
|
||||
|
@ -137,7 +139,7 @@ class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
,
|
||||
,
|
||||
<<<'CODE_SAMPLE'
|
||||
use App\AnotherClass;
|
||||
|
||||
|
|
|
@ -9,10 +9,8 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
|||
$services = $containerConfigurator->services();
|
||||
$services->set(SwapFuncCallArgumentsRector::class)
|
||||
->call('configure', [[
|
||||
SwapFuncCallArgumentsRector::FUNCTION_ARGUMENT_SWAPS => ValueObjectInliner::inline([
|
||||
|
||||
new SwapFuncCallArguments('some_function', [1, 0]),
|
||||
]
|
||||
SwapFuncCallArgumentsRector::FUNCTION_ARGUMENT_SWAPS => ValueObjectInliner::inline(
|
||||
[new SwapFuncCallArguments('some_function', [1, 0])]
|
||||
),
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -10,10 +10,15 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
|||
$services = $containerConfigurator->services();
|
||||
$services->set(NormalToFluentRector::class)
|
||||
->call('configure', [[
|
||||
NormalToFluentRector::CALLS_TO_FLUENT => ValueObjectInliner::inline([
|
||||
NormalToFluentRector::CALLS_TO_FLUENT => ValueObjectInliner::inline(
|
||||
[
|
||||
|
||||
new NormalToFluent(FluentInterfaceClass::class, ['someFunction', 'otherFunction', 'joinThisAsWell']),
|
||||
]
|
||||
new NormalToFluent(FluentInterfaceClass::class, [
|
||||
'someFunction',
|
||||
'otherFunction',
|
||||
'joinThisAsWell',
|
||||
]),
|
||||
]
|
||||
),
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -8,10 +8,12 @@ use Symplify\SymfonyPhpConfig\ValueObjectInliner;
|
|||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(CompleteImportForPartialAnnotationRector::class)
|
||||
->call('configure', [[
|
||||
CompleteImportForPartialAnnotationRector::USE_IMPORTS_TO_RESTORE => ValueObjectInliner::inline([
|
||||
new CompleteImportForPartialAnnotation('Doctrine\ORM\Mapping', 'ORM'),
|
||||
]),
|
||||
]]
|
||||
);
|
||||
->call(
|
||||
'configure',
|
||||
[[
|
||||
CompleteImportForPartialAnnotationRector::USE_IMPORTS_TO_RESTORE => ValueObjectInliner::inline([
|
||||
new CompleteImportForPartialAnnotation('Doctrine\ORM\Mapping', 'ORM'),
|
||||
]),
|
||||
]]
|
||||
);
|
||||
};
|
||||
|
|
|
@ -10,16 +10,18 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
|||
$services = $containerConfigurator->services();
|
||||
$services->set(PropertyFetchToMethodCallRector::class)
|
||||
->call('configure', [[
|
||||
PropertyFetchToMethodCallRector::PROPERTIES_TO_METHOD_CALLS => ValueObjectInliner::inline([
|
||||
PropertyFetchToMethodCallRector::PROPERTIES_TO_METHOD_CALLS => ValueObjectInliner::inline(
|
||||
[
|
||||
|
||||
new PropertyFetchToMethodCall(Translator::class, 'locale', 'getLocale', 'setLocale'),
|
||||
new PropertyFetchToMethodCall(
|
||||
'Rector\Tests\Transform\Rector\Assign\PropertyFetchToMethodCallRector\Fixture\Fixture2',
|
||||
'parameter',
|
||||
'getConfig',
|
||||
null,
|
||||
['parameter']),
|
||||
]
|
||||
new PropertyFetchToMethodCall(Translator::class, 'locale', 'getLocale', 'setLocale'),
|
||||
new PropertyFetchToMethodCall(
|
||||
'Rector\Tests\Transform\Rector\Assign\PropertyFetchToMethodCallRector\Fixture\Fixture2',
|
||||
'parameter',
|
||||
'getConfig',
|
||||
null,
|
||||
['parameter']
|
||||
),
|
||||
]
|
||||
),
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -16,7 +16,8 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
|||
NetteServiceDefinition::class,
|
||||
'setInject',
|
||||
'addTag',
|
||||
['inject']),
|
||||
['inject']
|
||||
),
|
||||
]);
|
||||
|
||||
$services->set(MethodCallToAnotherMethodCallWithArgumentsRector::class)
|
||||
|
|
|
@ -12,14 +12,16 @@ use Symplify\SymfonyPhpConfig\ValueObjectInliner;
|
|||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(ServiceGetterToConstructorInjectionRector::class)
|
||||
->call('configure', [[
|
||||
ServiceGetterToConstructorInjectionRector::METHOD_CALL_TO_SERVICES => ValueObjectInliner::inline([
|
||||
new ServiceGetterToConstructorInjection(
|
||||
FirstService::class,
|
||||
'getAnotherService',
|
||||
AnotherService::class
|
||||
),
|
||||
]),
|
||||
]]
|
||||
);
|
||||
->call(
|
||||
'configure',
|
||||
[[
|
||||
ServiceGetterToConstructorInjectionRector::METHOD_CALL_TO_SERVICES => ValueObjectInliner::inline([
|
||||
new ServiceGetterToConstructorInjection(
|
||||
FirstService::class,
|
||||
'getAnotherService',
|
||||
AnotherService::class
|
||||
),
|
||||
]),
|
||||
]]
|
||||
);
|
||||
};
|
||||
|
|
|
@ -21,8 +21,10 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
|||
]);
|
||||
|
||||
$services->set(VariableMethodCallToServiceCallRector::class)
|
||||
->call('configure', [[
|
||||
VariableMethodCallToServiceCallRector::VARIABLE_METHOD_CALLS_TO_SERVICE_CALLS => $configuration,
|
||||
]]
|
||||
);
|
||||
->call(
|
||||
'configure',
|
||||
[[
|
||||
VariableMethodCallToServiceCallRector::VARIABLE_METHOD_CALLS_TO_SERVICE_CALLS => $configuration,
|
||||
]]
|
||||
);
|
||||
};
|
||||
|
|
|
@ -51,7 +51,8 @@ final class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
, [
|
||||
,
|
||||
[
|
||||
self::FUNCTION_ARGUMENT_SWAPS => [new SwapFuncCallArguments('some_function', [1, 0])],
|
||||
]
|
||||
),
|
||||
|
|
|
@ -59,10 +59,10 @@ class SomeClass
|
|||
}
|
||||
CODE_SAMPLE
|
||||
,
|
||||
[
|
||||
self::VALUE_OBJECT_WRAP_ARGS => [new ValueObjectWrapArg('SomeClass', 'someMethod', 0, 'Number')],
|
||||
]
|
||||
),
|
||||
[
|
||||
self::VALUE_OBJECT_WRAP_ARGS => [new ValueObjectWrapArg('SomeClass', 'someMethod', 0, 'Number')],
|
||||
]
|
||||
),
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ final class MoveEntitiesToEntityDirectoryRector extends AbstractRector
|
|||
{
|
||||
return new RuleDefinition('Move entities to Entity namespace', [
|
||||
new CodeSample(
|
||||
<<<'CODE_SAMPLE'
|
||||
<<<'CODE_SAMPLE'
|
||||
// file: app/Controller/Product.php
|
||||
|
||||
namespace App\Controller;
|
||||
|
@ -64,7 +64,7 @@ class Product
|
|||
}
|
||||
CODE_SAMPLE
|
||||
,
|
||||
<<<'CODE_SAMPLE'
|
||||
<<<'CODE_SAMPLE'
|
||||
// file: app/Entity/Product.php
|
||||
|
||||
namespace App\Entity;
|
||||
|
@ -78,7 +78,7 @@ class Product
|
|||
{
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
),
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ final class MoveServicesBySuffixToDirectoryRector extends AbstractRector impleme
|
|||
{
|
||||
return new RuleDefinition('Move classes by their suffix to their own group/directory', [
|
||||
new ConfiguredCodeSample(
|
||||
<<<'CODE_SAMPLE'
|
||||
<<<'CODE_SAMPLE'
|
||||
// file: app/Entity/ProductRepository.php
|
||||
|
||||
namespace App/Entity;
|
||||
|
@ -67,7 +67,7 @@ class ProductRepository
|
|||
}
|
||||
CODE_SAMPLE
|
||||
,
|
||||
<<<'CODE_SAMPLE'
|
||||
<<<'CODE_SAMPLE'
|
||||
// file: app/Repository/ProductRepository.php
|
||||
|
||||
namespace App/Repository;
|
||||
|
@ -77,10 +77,10 @@ class ProductRepository
|
|||
}
|
||||
CODE_SAMPLE
|
||||
,
|
||||
[
|
||||
self::GROUP_NAMES_BY_SUFFIX => ['Repository'],
|
||||
]
|
||||
),
|
||||
[
|
||||
self::GROUP_NAMES_BY_SUFFIX => ['Repository'],
|
||||
]
|
||||
),
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ final class MoveInterfacesToContractNamespaceDirectoryRector extends AbstractRec
|
|||
{
|
||||
return new RuleDefinition('Move interface to "Contract" namespace', [
|
||||
new CodeSample(
|
||||
<<<'CODE_SAMPLE'
|
||||
<<<'CODE_SAMPLE'
|
||||
// file: app/Exception/Rule.php
|
||||
|
||||
namespace App\Exception;
|
||||
|
@ -52,7 +52,7 @@ interface Rule
|
|||
}
|
||||
CODE_SAMPLE
|
||||
,
|
||||
<<<'CODE_SAMPLE'
|
||||
<<<'CODE_SAMPLE'
|
||||
// file: app/Contract/Rule.php
|
||||
|
||||
namespace App\Contract;
|
||||
|
@ -61,7 +61,7 @@ interface Rule
|
|||
{
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
),
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
@ -68,9 +68,9 @@ final class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -52,9 +52,9 @@ final class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -41,7 +41,7 @@ final class ExprBoolCaster
|
|||
public function __construct(
|
||||
NodeTypeResolver $nodeTypeResolver,
|
||||
TypeUnwrapper $typeUnwrapper,
|
||||
StaticTypeAnalyzer $staticTypeAnalyzer,
|
||||
StaticTypeAnalyzer $staticTypeAnalyzer,
|
||||
NodeFactory $nodeFactory
|
||||
) {
|
||||
$this->nodeTypeResolver = $nodeTypeResolver;
|
||||
|
|
|
@ -81,8 +81,9 @@ class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -90,8 +90,9 @@ class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -47,8 +47,9 @@ final class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -45,8 +45,9 @@ $a = 5;
|
|||
$b = 10;
|
||||
$result = $a <= 20 && $b > 50;
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -54,8 +54,9 @@ class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -47,8 +47,9 @@ class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -60,8 +60,9 @@ class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -67,8 +67,9 @@ class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -44,8 +44,9 @@ CODE_SAMPLE
|
|||
$possibleDirectories = [];
|
||||
$directories = array_filter($possibleDirectories, 'file_exists');
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -61,8 +61,9 @@ CODE_SAMPLE
|
|||
<<<'CODE_SAMPLE'
|
||||
return $this->oldToNewFunctions[$currentFunction] ?? null;
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -50,8 +50,9 @@ class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -44,8 +44,9 @@ class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -52,8 +52,9 @@ class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -49,8 +49,9 @@ class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -43,8 +43,9 @@ class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -42,8 +42,9 @@ class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -19,7 +19,8 @@ final class SimplifyInArrayValuesRector extends AbstractRector
|
|||
{
|
||||
return new RuleDefinition(
|
||||
'Removes unneeded array_values() in in_array() call',
|
||||
[new CodeSample('in_array("key", array_values($array), true);', 'in_array("key", $array, true);')]);
|
||||
[new CodeSample('in_array("key", array_values($array), true);', 'in_array("key", $array, true);')]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -48,8 +48,9 @@ class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -90,8 +90,9 @@ final class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -72,8 +72,9 @@ class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -46,8 +46,9 @@ class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -43,8 +43,9 @@ class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -54,8 +54,9 @@ class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -47,8 +47,9 @@ CODE_SAMPLE
|
|||
$newNode = 'something ;
|
||||
return $newNode;
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -55,8 +55,9 @@ return false;
|
|||
CODE_SAMPLE
|
||||
,
|
||||
'return strpos($docToken->getContent(), "\n") === false;'
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -37,8 +37,9 @@ if (($f = false) || true) {
|
|||
return $f;
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -67,8 +67,9 @@ final class AnotherClass
|
|||
{
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -44,7 +44,6 @@ class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
|
||||
),
|
||||
]);
|
||||
}
|
||||
|
|
|
@ -42,8 +42,9 @@ final class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -45,8 +45,9 @@ class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -43,8 +43,9 @@ class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -45,8 +45,9 @@ class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -73,8 +73,9 @@ if ($condition === null) {
|
|||
return $var;
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -55,8 +55,9 @@ CODE_SAMPLE
|
|||
/** @var \Shopsys\FrameworkBundle\Model\Product\Filter\ProductFilterConfig $config */
|
||||
$config = 5;
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -56,8 +56,9 @@ class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -63,8 +63,9 @@ class SomeClass
|
|||
const HI = 'hi';
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -41,7 +41,6 @@ function run(...$args)
|
|||
{
|
||||
}
|
||||
CODE_SAMPLE
|
||||
|
||||
),
|
||||
]);
|
||||
}
|
||||
|
|
|
@ -51,8 +51,9 @@ class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -82,8 +82,9 @@ class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -62,8 +62,9 @@ final class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -61,8 +61,9 @@ class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -45,8 +45,9 @@ $array === [];
|
|||
$array !== [];
|
||||
$array === [];
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -44,8 +44,9 @@ class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -19,7 +19,8 @@ final class StrictArraySearchRector extends AbstractRector
|
|||
{
|
||||
return new RuleDefinition(
|
||||
'Makes array_search search for identical elements',
|
||||
[new CodeSample('array_search($value, $items);', 'array_search($value, $items, true);')]);
|
||||
[new CodeSample('array_search($value, $items);', 'array_search($value, $items, true);')]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -80,8 +80,9 @@ class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -44,8 +44,9 @@ class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -49,7 +49,7 @@ final class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
|
|
@ -41,8 +41,9 @@ class SomeClass
|
|||
private $isDisabled = false;
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -64,8 +64,9 @@ class AnotherClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -50,8 +50,9 @@ class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -37,8 +37,9 @@ function ternary($value)
|
|||
$a = $value ? 1 : 0;
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -58,7 +58,8 @@ CODE_SAMPLE
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
, [
|
||||
,
|
||||
[
|
||||
self::PACKAGES_AND_VERSIONS => [new PackageAndVersion('symfony/console', '^3.4')],
|
||||
]
|
||||
),
|
||||
|
|
|
@ -61,7 +61,8 @@ CODE_SAMPLE
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
, [
|
||||
,
|
||||
[
|
||||
self::PACKAGES_AND_VERSIONS => [new PackageAndVersion('symfony/console', '^3.4')],
|
||||
]
|
||||
),
|
||||
|
|
|
@ -64,7 +64,8 @@ CODE_SAMPLE
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
, [
|
||||
,
|
||||
[
|
||||
self::PACKAGES_AND_VERSIONS => [new PackageAndVersion('symfony/console', '^4.4')],
|
||||
]
|
||||
),
|
||||
|
|
|
@ -46,7 +46,8 @@ CODE_SAMPLE
|
|||
{
|
||||
}
|
||||
CODE_SAMPLE
|
||||
, [
|
||||
,
|
||||
[
|
||||
self::PACKAGE_NAMES => ['symfony/console'],
|
||||
]
|
||||
),
|
||||
|
|
|
@ -65,7 +65,8 @@ CODE_SAMPLE
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
, [
|
||||
,
|
||||
[
|
||||
self::REPLACE_PACKAGES_AND_VERSIONS => [new ReplacePackageAndVersion(
|
||||
'symfony/console',
|
||||
'symfony/http-kernel',
|
||||
|
|
|
@ -28,7 +28,9 @@ final class DeadReturnTagValueNodeAnalyzer
|
|||
return false;
|
||||
}
|
||||
|
||||
if (! $this->typeComparator->arePhpParserAndPhpStanPhpDocTypesEqual($returnType, $returnTagValueNode->type,
|
||||
if (! $this->typeComparator->arePhpParserAndPhpStanPhpDocTypesEqual(
|
||||
$returnType,
|
||||
$returnTagValueNode->type,
|
||||
$functionLike
|
||||
)) {
|
||||
return false;
|
||||
|
|
|
@ -52,8 +52,9 @@ class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -53,8 +53,9 @@ class SomeClass
|
|||
{
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -57,8 +57,9 @@ class OrphanClass
|
|||
{
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -57,7 +57,6 @@ final class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
|
||||
),
|
||||
]);
|
||||
}
|
||||
|
|
|
@ -71,8 +71,9 @@ class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -66,8 +66,9 @@ class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -57,8 +57,9 @@ class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -42,8 +42,9 @@ class SomeConcatingClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -59,8 +59,9 @@ class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -43,8 +43,9 @@ class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -53,8 +53,9 @@ class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -82,8 +82,9 @@ class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -75,8 +75,9 @@ final class SomeController
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -77,8 +77,9 @@ class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -68,8 +68,9 @@ class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -55,8 +55,9 @@ CODE_SAMPLE
|
|||
// current PHP: 7.2
|
||||
return 'is PHP 7.2+';
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -93,8 +93,9 @@ class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -55,8 +55,9 @@ class SomeClass
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -100,8 +100,9 @@ class ActiveOnlySetter
|
|||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -48,7 +48,6 @@ final class SomeClass
|
|||
public string $name = 'name';
|
||||
}
|
||||
CODE_SAMPLE
|
||||
|
||||
),
|
||||
]);
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue