mirror of
https://github.com/rectorphp/rector.git
synced 2024-05-30 07:50:53 +00:00
[Celebrity] Merge to code-quality
This commit is contained in:
parent
a3a5266bf7
commit
c28a5a9746
|
@ -64,7 +64,6 @@
|
|||
"Rector\\Autodiscovery\\": "rules/autodiscovery/src",
|
||||
"Rector\\BetterPhpDocParser\\": "packages/better-php-doc-parser/src",
|
||||
"Rector\\CakePHP\\": "rules/cakephp/src",
|
||||
"Rector\\Celebrity\\": "rules/celebrity/src",
|
||||
"Rector\\ChangesReporting\\": "packages/changes-reporting/src",
|
||||
"Rector\\CodeQuality\\": "rules/code-quality/src",
|
||||
"Rector\\NodeRemoval\\": "packages/node-removal/src",
|
||||
|
@ -156,7 +155,6 @@
|
|||
"Rector\\Autodiscovery\\Tests\\": "rules/autodiscovery/tests",
|
||||
"Rector\\BetterPhpDocParser\\Tests\\": "packages/better-php-doc-parser/tests",
|
||||
"Rector\\CakePHP\\Tests\\": "rules/cakephp/tests",
|
||||
"Rector\\Celebrity\\Tests\\": "rules/celebrity/tests",
|
||||
"Rector\\CodeQuality\\Tests\\": "rules/code-quality/tests",
|
||||
"Rector\\Caching\\Tests\\": "packages/caching/tests",
|
||||
"Rector\\CodingStyle\\Tests\\": "rules/coding-style/tests",
|
||||
|
|
|
@ -1,49 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Celebrity\Rector\BooleanOp\LogicalToBooleanRector;
|
||||
use Rector\Celebrity\Rector\FuncCall\SetTypeToCastRector;
|
||||
use Rector\Celebrity\Rector\NotEqual\CommonNotEqualRector;
|
||||
use Rector\Php52\Rector\Property\VarToPublicPropertyRector;
|
||||
use Rector\Renaming\Rector\Function_\RenameFunctionRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
|
||||
$services->set(CommonNotEqualRector::class);
|
||||
|
||||
$services->set(RenameFunctionRector::class)
|
||||
->arg('$oldFunctionToNewFunction', [
|
||||
'split' => 'explode',
|
||||
'join' => 'implode',
|
||||
'sizeof' => 'count',
|
||||
# https://www.php.net/manual/en/aliases.php
|
||||
'chop' => 'rtrim',
|
||||
'doubleval' => 'floatval',
|
||||
'gzputs' => 'gzwrites',
|
||||
'fputs' => 'fwrite',
|
||||
'ini_alter' => 'ini_set',
|
||||
'is_double' => 'is_float',
|
||||
'is_integer' => 'is_int',
|
||||
'is_long' => 'is_int',
|
||||
'is_real' => 'is_float',
|
||||
'is_writeable' => 'is_writable',
|
||||
'key_exists' => 'array_key_exists',
|
||||
'pos' => 'current',
|
||||
'strchr' => 'strstr',
|
||||
# mb
|
||||
'mbstrcut' => 'mb_strcut',
|
||||
'mbstrlen' => 'mb_strlen',
|
||||
'mbstrpos' => 'mb_strpos',
|
||||
'mbstrrpos' => 'mb_strrpos',
|
||||
'mbsubstr' => 'mb_substr',
|
||||
]);
|
||||
|
||||
$services->set(SetTypeToCastRector::class);
|
||||
|
||||
$services->set(LogicalToBooleanRector::class);
|
||||
|
||||
$services->set(VarToPublicPropertyRector::class);
|
||||
};
|
|
@ -9,6 +9,7 @@ use Rector\CodeQuality\Rector\Assign\SplitListAssignToSeparateLineRector;
|
|||
use Rector\CodeQuality\Rector\BinaryOp\InlineIfToExplicitIfRector;
|
||||
use Rector\CodeQuality\Rector\BinaryOp\SimplifyDeMorganBinaryRector;
|
||||
use Rector\CodeQuality\Rector\BooleanAnd\SimplifyEmptyArrayCheckRector;
|
||||
use Rector\CodeQuality\Rector\BooleanOp\LogicalToBooleanRector;
|
||||
use Rector\CodeQuality\Rector\Catch_\ThrowWithPreviousExceptionRector;
|
||||
use Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector;
|
||||
use Rector\CodeQuality\Rector\Concat\JoinStringConcatRector;
|
||||
|
@ -29,6 +30,7 @@ use Rector\CodeQuality\Rector\FuncCall\InArrayAndArrayKeysToArrayKeyExistsRector
|
|||
use Rector\CodeQuality\Rector\FuncCall\IntvalToTypeCastRector;
|
||||
use Rector\CodeQuality\Rector\FuncCall\IsAWithStringWithThirdArgumentRector;
|
||||
use Rector\CodeQuality\Rector\FuncCall\RemoveSoleValueSprintfRector;
|
||||
use Rector\CodeQuality\Rector\FuncCall\SetTypeToCastRector;
|
||||
use Rector\CodeQuality\Rector\FuncCall\SimplifyFuncGetArgsCountRector;
|
||||
use Rector\CodeQuality\Rector\FuncCall\SimplifyInArrayValuesRector;
|
||||
use Rector\CodeQuality\Rector\FuncCall\SimplifyRegexPatternRector;
|
||||
|
@ -51,12 +53,15 @@ use Rector\CodeQuality\Rector\If_\SimplifyIfNotNullReturnRector;
|
|||
use Rector\CodeQuality\Rector\If_\SimplifyIfReturnBoolRector;
|
||||
use Rector\CodeQuality\Rector\Include_\AbsolutizeRequireAndIncludePathRector;
|
||||
use Rector\CodeQuality\Rector\LogicalAnd\AndAssignsToSeparateLinesRector;
|
||||
use Rector\CodeQuality\Rector\NotEqual\CommonNotEqualRector;
|
||||
use Rector\CodeQuality\Rector\Return_\SimplifyUselessVariableRector;
|
||||
use Rector\CodeQuality\Rector\Ternary\ArrayKeyExistsTernaryThenValueToCoalescingRector;
|
||||
use Rector\CodeQuality\Rector\Ternary\SimplifyDuplicatedTernaryRector;
|
||||
use Rector\CodeQuality\Rector\Ternary\SimplifyTautologyTernaryRector;
|
||||
use Rector\CodeQuality\Rector\Ternary\UnnecessaryTernaryExpressionRector;
|
||||
use Rector\Php52\Rector\Property\VarToPublicPropertyRector;
|
||||
use Rector\Php71\Rector\FuncCall\RemoveExtraParametersRector;
|
||||
use Rector\Renaming\Rector\Function_\RenameFunctionRector;
|
||||
use Rector\SOLID\Rector\ClassMethod\UseInterfaceOverImplementationInConstructorRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
|
@ -174,4 +179,39 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
|||
$services->set(UnusedForeachValueToArrayKeysRector::class);
|
||||
|
||||
$services->set(ArrayThisCallToThisMethodCallRector::class);
|
||||
|
||||
$services->set(CommonNotEqualRector::class);
|
||||
|
||||
$services->set(RenameFunctionRector::class)
|
||||
->arg('$oldFunctionToNewFunction', [
|
||||
'split' => 'explode',
|
||||
'join' => 'implode',
|
||||
'sizeof' => 'count',
|
||||
# https://www.php.net/manual/en/aliases.php
|
||||
'chop' => 'rtrim',
|
||||
'doubleval' => 'floatval',
|
||||
'gzputs' => 'gzwrites',
|
||||
'fputs' => 'fwrite',
|
||||
'ini_alter' => 'ini_set',
|
||||
'is_double' => 'is_float',
|
||||
'is_integer' => 'is_int',
|
||||
'is_long' => 'is_int',
|
||||
'is_real' => 'is_float',
|
||||
'is_writeable' => 'is_writable',
|
||||
'key_exists' => 'array_key_exists',
|
||||
'pos' => 'current',
|
||||
'strchr' => 'strstr',
|
||||
# mb
|
||||
'mbstrcut' => 'mb_strcut',
|
||||
'mbstrlen' => 'mb_strlen',
|
||||
'mbstrpos' => 'mb_strpos',
|
||||
'mbstrrpos' => 'mb_strrpos',
|
||||
'mbsubstr' => 'mb_substr',
|
||||
]);
|
||||
|
||||
$services->set(SetTypeToCastRector::class);
|
||||
|
||||
$services->set(LogicalToBooleanRector::class);
|
||||
|
||||
$services->set(VarToPublicPropertyRector::class);
|
||||
};
|
||||
|
|
|
@ -47,7 +47,7 @@ CODE_SAMPLE,
|
|||
'source' => [
|
||||
],
|
||||
// e.g. symfony30, target config to append this rector to
|
||||
'set' => SetList::CELEBRITY,
|
||||
'set' => SetList::CODE_QUALITY,
|
||||
]);
|
||||
};
|
||||
```
|
||||
|
|
|
@ -9,8 +9,7 @@
|
|||
- [Architecture](#architecture) (4)
|
||||
- [Autodiscovery](#autodiscovery) (4)
|
||||
- [CakePHP](#cakephp) (6)
|
||||
- [Celebrity](#celebrity) (3)
|
||||
- [CodeQuality](#codequality) (54)
|
||||
- [CodeQuality](#codequality) (57)
|
||||
- [CodingStyle](#codingstyle) (36)
|
||||
- [DeadCode](#deadcode) (40)
|
||||
- [Decomplex](#decomplex) (1)
|
||||
|
@ -435,68 +434,6 @@ return function (ContainerConfigurator $containerConfigurator) : void {
|
|||
|
||||
<br><br>
|
||||
|
||||
## Celebrity
|
||||
|
||||
### `CommonNotEqualRector`
|
||||
|
||||
- class: [`Rector\Celebrity\Rector\NotEqual\CommonNotEqualRector`](/../master/rules/celebrity/src/Rector/NotEqual/CommonNotEqualRector.php)
|
||||
- [test fixtures](/../master/rules/celebrity/tests/Rector/NotEqual/CommonNotEqualRector/Fixture)
|
||||
|
||||
Use common != instead of less known <> with same meaning
|
||||
|
||||
```diff
|
||||
final class SomeClass
|
||||
{
|
||||
public function run($one, $two)
|
||||
{
|
||||
- return $one <> $two;
|
||||
+ return $one != $two;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<br><br>
|
||||
|
||||
### `LogicalToBooleanRector`
|
||||
|
||||
- class: [`Rector\Celebrity\Rector\BooleanOp\LogicalToBooleanRector`](/../master/rules/celebrity/src/Rector/BooleanOp/LogicalToBooleanRector.php)
|
||||
- [test fixtures](/../master/rules/celebrity/tests/Rector/BooleanOp/LogicalToBooleanRector/Fixture)
|
||||
|
||||
Change OR, AND to ||, && with more common understanding
|
||||
|
||||
```diff
|
||||
-if ($f = false or true) {
|
||||
+if (($f = false) || true) {
|
||||
return $f;
|
||||
}
|
||||
```
|
||||
|
||||
<br><br>
|
||||
|
||||
### `SetTypeToCastRector`
|
||||
|
||||
- class: [`Rector\Celebrity\Rector\FuncCall\SetTypeToCastRector`](/../master/rules/celebrity/src/Rector/FuncCall/SetTypeToCastRector.php)
|
||||
- [test fixtures](/../master/rules/celebrity/tests/Rector/FuncCall/SetTypeToCastRector/Fixture)
|
||||
|
||||
Changes `settype()` to (type) where possible
|
||||
|
||||
```diff
|
||||
class SomeClass
|
||||
{
|
||||
- public function run($foo)
|
||||
+ public function run(array $items)
|
||||
{
|
||||
- settype($foo, 'string');
|
||||
+ $foo = (string) $foo;
|
||||
|
||||
- return settype($foo, 'integer');
|
||||
+ return (int) $foo;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<br><br>
|
||||
|
||||
## CodeQuality
|
||||
|
||||
### `AbsolutizeRequireAndIncludePathRector`
|
||||
|
@ -761,6 +698,26 @@ Simplify `$value` = `$value` + 5; assignments to shorter ones
|
|||
|
||||
<br><br>
|
||||
|
||||
### `CommonNotEqualRector`
|
||||
|
||||
- class: [`Rector\CodeQuality\Rector\NotEqual\CommonNotEqualRector`](/../master/rules/code-quality/src/Rector/NotEqual/CommonNotEqualRector.php)
|
||||
- [test fixtures](/../master/rules/code-quality/tests/Rector/NotEqual/CommonNotEqualRector/Fixture)
|
||||
|
||||
Use common != instead of less known <> with same meaning
|
||||
|
||||
```diff
|
||||
final class SomeClass
|
||||
{
|
||||
public function run($one, $two)
|
||||
{
|
||||
- return $one <> $two;
|
||||
+ return $one != $two;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<br><br>
|
||||
|
||||
### `CompactToVariablesRector`
|
||||
|
||||
- class: [`Rector\CodeQuality\Rector\FuncCall\CompactToVariablesRector`](/../master/rules/code-quality/src/Rector/FuncCall/CompactToVariablesRector.php)
|
||||
|
@ -1064,6 +1021,22 @@ Joins concat of 2 strings, unless the lenght is too long
|
|||
|
||||
<br><br>
|
||||
|
||||
### `LogicalToBooleanRector`
|
||||
|
||||
- class: [`Rector\CodeQuality\Rector\BooleanOp\LogicalToBooleanRector`](/../master/rules/code-quality/src/Rector/BooleanOp/LogicalToBooleanRector.php)
|
||||
- [test fixtures](/../master/rules/code-quality/tests/Rector/BooleanOp/LogicalToBooleanRector/Fixture)
|
||||
|
||||
Change OR, AND to ||, && with more common understanding
|
||||
|
||||
```diff
|
||||
-if ($f = false or true) {
|
||||
+if (($f = false) || true) {
|
||||
return $f;
|
||||
}
|
||||
```
|
||||
|
||||
<br><br>
|
||||
|
||||
### `RemoveAlwaysTrueConditionSetInConstructorRector`
|
||||
|
||||
- class: [`Rector\CodeQuality\Rector\If_\RemoveAlwaysTrueConditionSetInConstructorRector`](/../master/rules/code-quality/src/Rector/If_/RemoveAlwaysTrueConditionSetInConstructorRector.php)
|
||||
|
@ -1117,6 +1090,30 @@ Remove `sprintf()` wrapper if not needed
|
|||
|
||||
<br><br>
|
||||
|
||||
### `SetTypeToCastRector`
|
||||
|
||||
- class: [`Rector\CodeQuality\Rector\FuncCall\SetTypeToCastRector`](/../master/rules/code-quality/src/Rector/FuncCall/SetTypeToCastRector.php)
|
||||
- [test fixtures](/../master/rules/code-quality/tests/Rector/FuncCall/SetTypeToCastRector/Fixture)
|
||||
|
||||
Changes `settype()` to (type) where possible
|
||||
|
||||
```diff
|
||||
class SomeClass
|
||||
{
|
||||
- public function run($foo)
|
||||
+ public function run(array $items)
|
||||
{
|
||||
- settype($foo, 'string');
|
||||
+ $foo = (string) $foo;
|
||||
|
||||
- return settype($foo, 'integer');
|
||||
+ return (int) $foo;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<br><br>
|
||||
|
||||
### `ShortenElseIfRector`
|
||||
|
||||
- class: [`Rector\CodeQuality\Rector\If_\ShortenElseIfRector`](/../master/rules/code-quality/src/Rector/If_/ShortenElseIfRector.php)
|
||||
|
@ -2408,7 +2405,7 @@ use Rector\CodingStyle\Rector\ClassMethod\YieldClassMethodToArrayClassMethodRect
|
|||
return function (ContainerConfigurator $containerConfigurator) : void {
|
||||
$services = $containerConfiguration->services();
|
||||
$services->set(YieldClassMethodToArrayClassMethodRector::class)
|
||||
->arg('EventSubscriberInterface', ['getSubscribedEvents']);
|
||||
->arg('$methodsByType', ['EventSubscriberInterface' => ['getSubscribedEvents']]);
|
||||
};
|
||||
```
|
||||
|
||||
|
|
|
@ -29,7 +29,6 @@ final class SetProvider extends AbstractSetProvider
|
|||
SetList::CAKEPHP_38 => __DIR__ . '/../../../config/set/cakephp38.php',
|
||||
SetList::CAKEPHP_40 => __DIR__ . '/../../../config/set/cakephp40.php',
|
||||
SetList::CAKEPHP_FLUENT_OPTIONS => __DIR__ . '/../../../config/set/cakephp-fluent-options.php',
|
||||
SetList::CELEBRITY => __DIR__ . '/../../../config/set/celebrity.php',
|
||||
SetList::CODEIGNITER_40 => __DIR__ . '/../../../config/set/codeigniter-40.php',
|
||||
SetList::CODE_QUALITY => __DIR__ . '/../../../config/set/code-quality.php',
|
||||
SetList::CODING_STYLE => __DIR__ . '/../../../config/set/coding-style.php',
|
||||
|
|
|
@ -56,11 +56,6 @@ final class SetList
|
|||
*/
|
||||
public const CAKEPHP_FLUENT_OPTIONS = 'cakephp-fluent-options';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public const CELEBRITY = 'celebrity';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Celebrity\Rector\BooleanOp;
|
||||
namespace Rector\CodeQuality\Rector\BooleanOp;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\BinaryOp\BooleanAnd;
|
||||
|
@ -16,7 +16,7 @@ use Rector\Core\RectorDefinition\RectorDefinition;
|
|||
/**
|
||||
* @see https://stackoverflow.com/questions/5998309/logical-operators-or-or
|
||||
* @see https://stackoverflow.com/questions/9454870/php-xor-how-to-use-with-if
|
||||
* @see \Rector\Celebrity\Tests\Rector\BooleanOp\LogicalToBooleanRector\LogicalToBooleanRectorTest
|
||||
* @see \Rector\CodeQuality\Tests\Rector\BooleanOp\LogicalToBooleanRector\LogicalToBooleanRectorTest
|
||||
*/
|
||||
final class LogicalToBooleanRector extends AbstractRector
|
||||
{
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Celebrity\Rector\FuncCall;
|
||||
namespace Rector\CodeQuality\Rector\FuncCall;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Arg;
|
||||
|
@ -24,7 +24,7 @@ use Rector\NodeTypeResolver\Node\AttributeKey;
|
|||
/**
|
||||
* @see https://stackoverflow.com/questions/5577003/using-settype-in-php-instead-of-typecasting-using-brackets-what-is-the-differen/5577068#5577068
|
||||
* @see https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/3709
|
||||
* @see \Rector\Celebrity\Tests\Rector\FuncCall\SetTypeToCastRector\SetTypeToCastRectorTest
|
||||
* @see \Rector\CodeQuality\Tests\Rector\FuncCall\SetTypeToCastRector\SetTypeToCastRectorTest
|
||||
*/
|
||||
final class SetTypeToCastRector extends AbstractRector
|
||||
{
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Celebrity\Rector\NotEqual;
|
||||
namespace Rector\CodeQuality\Rector\NotEqual;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\BinaryOp\NotEqual;
|
||||
|
@ -13,7 +13,7 @@ use Rector\NodeTypeResolver\Node\AttributeKey;
|
|||
|
||||
/**
|
||||
* @see https://stackoverflow.com/a/4294663/1348344
|
||||
* @see \Rector\Celebrity\Tests\Rector\NotEqual\CommonNotEqualRector\CommonNotEqualRectorTest
|
||||
* @see \Rector\CodeQuality\Tests\Rector\NotEqual\CommonNotEqualRector\CommonNotEqualRectorTest
|
||||
*/
|
||||
final class CommonNotEqualRector extends AbstractRector
|
||||
{
|
|
@ -2,10 +2,10 @@
|
|||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Celebrity\Tests\Rector\BooleanOp\LogicalToBooleanRector;
|
||||
namespace Rector\CodeQuality\Tests\Rector\BooleanOp\LogicalToBooleanRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\Celebrity\Rector\BooleanOp\LogicalToBooleanRector;
|
||||
use Rector\CodeQuality\Rector\BooleanOp\LogicalToBooleanRector;
|
||||
use Rector\Core\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Rector\Celebrity\Tests\Rector\FuncCall\SetTypeToCastRector\Fixture;
|
||||
namespace Rector\CodeQuality\Tests\Rector\FuncCall\SetTypeToCastRector\Fixture;
|
||||
|
||||
class Assin
|
||||
{
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Rector\Celebrity\Tests\Rector\FuncCall\SetTypeToCastRector\Fixture;
|
||||
namespace Rector\CodeQuality\Tests\Rector\FuncCall\SetTypeToCastRector\Fixture;
|
||||
|
||||
class SomeClass
|
||||
{
|
||||
|
@ -27,7 +27,7 @@ class SomeClass
|
|||
-----
|
||||
<?php
|
||||
|
||||
namespace Rector\Celebrity\Tests\Rector\FuncCall\SetTypeToCastRector\Fixture;
|
||||
namespace Rector\CodeQuality\Tests\Rector\FuncCall\SetTypeToCastRector\Fixture;
|
||||
|
||||
class SomeClass
|
||||
{
|
|
@ -2,10 +2,10 @@
|
|||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Celebrity\Tests\Rector\FuncCall\SetTypeToCastRector;
|
||||
namespace Rector\CodeQuality\Tests\Rector\FuncCall\SetTypeToCastRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\Celebrity\Rector\FuncCall\SetTypeToCastRector;
|
||||
use Rector\CodeQuality\Rector\FuncCall\SetTypeToCastRector;
|
||||
use Rector\Core\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
|
@ -2,10 +2,10 @@
|
|||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Celebrity\Tests\Rector\NotEqual\CommonNotEqualRector;
|
||||
namespace Rector\CodeQuality\Tests\Rector\NotEqual\CommonNotEqualRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\Celebrity\Rector\NotEqual\CommonNotEqualRector;
|
||||
use Rector\CodeQuality\Rector\NotEqual\CommonNotEqualRector;
|
||||
use Rector\Core\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Rector\Celebrity\Tests\Rector\NotEqual\CommonNotEqualRector\Fixture;
|
||||
namespace Rector\CodeQuality\Tests\Rector\NotEqual\CommonNotEqualRector\Fixture;
|
||||
|
||||
final class SomeClass
|
||||
{
|
||||
|
@ -14,7 +14,7 @@ final class SomeClass
|
|||
-----
|
||||
<?php
|
||||
|
||||
namespace Rector\Celebrity\Tests\Rector\NotEqual\CommonNotEqualRector\Fixture;
|
||||
namespace Rector\CodeQuality\Tests\Rector\NotEqual\CommonNotEqualRector\Fixture;
|
||||
|
||||
final class SomeClass
|
||||
{
|
|
@ -4,9 +4,9 @@ sonar.projectKey=rectorphp_rector
|
|||
|
||||
# relative paths to source
|
||||
# wildcards don't work :(
|
||||
sonar.sources=compiler/src,src,rules/autodiscovery/src,rules/architecture/src,packages/attribute-aware-php-doc/src,packages/better-php-doc-parser/src,rules/cakephp/src,rules/celebrity/src,rules/code-quality/src,rules/coding-style/src,packages/console-differ/src,rules/dead-code/src,rules/doctrine/src,rules/doctrine-code-quality/src,rules/framework-migration/src,packages/file-system-rector/src,rules/guzzle/src,rules/laravel/src,rules/legacy/src,rules/mysql-to-mysqli/src,rules/nette-tester-to-phpunit/src,rules/nette-to-symfony/src,rules/nette/src,packages/node-collector/src,packages/node-type-resolver/src,packages/node-name-resolver/src,rules/phpstan/src,packages/phpstan-static-type-mapper/src,rules/phpunit-symfony/src,rules/phpunit/src,rules/psr4/src,rules/php-spec-to-phpunit/src,rules/php52/src,rules/php53/src,rules/php54/src,rules/php55/src,rules/php56/src,rules/php70/src,rules/php71/src,rules/php72/src,rules/php73/src,rules/php74/src,rules/php80/src,rules/removing-static/src,rules/renaming/src,rules/restoration/src,rules/solid/src,rules/sensio/src,packages/static-type-mapper/src,rules/symfony-code-quality/src,rules/symfony-phpunit/src,rules/symfony/src,rules/twig/src,rules/type-declaration/src,packages/vendor-locker/src,packages/rector-generator/src,rules/strict-code-quality/src,packages/dynamic-type-analysis/src,rules/php-deglobalize/src,rules/phalcon/src,rules/doctrine-gedmo-to-knplabs/src,packages/polyfill/src
|
||||
sonar.sources=compiler/src,src,rules/autodiscovery/src,rules/architecture/src,packages/attribute-aware-php-doc/src,packages/better-php-doc-parser/src,rules/cakephp/src,rules/code-quality/src,rules/coding-style/src,packages/console-differ/src,rules/dead-code/src,rules/doctrine/src,rules/doctrine-code-quality/src,rules/framework-migration/src,packages/file-system-rector/src,rules/guzzle/src,rules/laravel/src,rules/legacy/src,rules/mysql-to-mysqli/src,rules/nette-tester-to-phpunit/src,rules/nette-to-symfony/src,rules/nette/src,packages/node-collector/src,packages/node-type-resolver/src,packages/node-name-resolver/src,rules/phpstan/src,packages/phpstan-static-type-mapper/src,rules/phpunit-symfony/src,rules/phpunit/src,rules/psr4/src,rules/php-spec-to-phpunit/src,rules/php52/src,rules/php53/src,rules/php54/src,rules/php55/src,rules/php56/src,rules/php70/src,rules/php71/src,rules/php72/src,rules/php73/src,rules/php74/src,rules/php80/src,rules/removing-static/src,rules/renaming/src,rules/restoration/src,rules/solid/src,rules/sensio/src,packages/static-type-mapper/src,rules/symfony-code-quality/src,rules/symfony-phpunit/src,rules/symfony/src,rules/twig/src,rules/type-declaration/src,packages/vendor-locker/src,packages/rector-generator/src,rules/strict-code-quality/src,packages/dynamic-type-analysis/src,rules/php-deglobalize/src,rules/phalcon/src,rules/doctrine-gedmo-to-knplabs/src,packages/polyfill/src
|
||||
|
||||
sonar.tests=tests,rules/autodiscovery/tests,rules/architecture/tests,packages/better-php-doc-parser/tests,rules/cakephp/tests,rules/celebrity/tests,rules/code-quality/tests,rules/coding-style/tests,rules/dead-code/tests,rules/doctrine/tests,rules/doctrine-code-quality/tests,rules/guzzle/tests,rules/laravel/tests,rules/legacy/tests,rules/mysql-to-mysqli/tests,rules/nette-tester-to-phpunit/tests,rules/nette-to-symfony/tests,rules/nette/tests,packages/node-type-resolver/tests,utils/phpstan-extensions/src,rules/phpstan/tests,rules/phpunit-symfony/tests,rules/phpunit/tests,rules/psr4/tests,rules/php-spec-to-phpunit/tests,rules/php52/tests,rules/php53/tests,rules/php54/tests,rules/php55/tests,rules/php56/tests,rules/php70/tests,rules/php71/tests,rules/php72/tests,rules/php73/tests,rules/php74/tests,rules/php80/tests,rules/removing-static/tests,rules/renaming/tests,rules/restoration/tests,rules/solid/tests,rules/sensio/tests,rules/symfony-code-quality/tests,rules/symfony-phpunit/tests,rules/symfony/tests,rules/twig/tests,rules/type-declaration/tests,rules/strict-code-quality/tests,packages/dynamic-type-analysis/tests,rules/php-deglobalize/tests,rules/phalcon/tests,utils/documentation-generator/src,utils/phpstan-attribute-type-syncer/src,utils/phpstan-static-type-mapper-checker/src,rules/doctrine-gedmo-to-knplabs/tests,packages/polyfill/tests,rules/downgrade/tests
|
||||
sonar.tests=tests,rules/autodiscovery/tests,rules/architecture/tests,packages/better-php-doc-parser/tests,rules/cakephp/tests,rules/code-quality/tests,rules/coding-style/tests,rules/dead-code/tests,rules/doctrine/tests,rules/doctrine-code-quality/tests,rules/guzzle/tests,rules/laravel/tests,rules/legacy/tests,rules/mysql-to-mysqli/tests,rules/nette-tester-to-phpunit/tests,rules/nette-to-symfony/tests,rules/nette/tests,packages/node-type-resolver/tests,utils/phpstan-extensions/src,rules/phpstan/tests,rules/phpunit-symfony/tests,rules/phpunit/tests,rules/psr4/tests,rules/php-spec-to-phpunit/tests,rules/php52/tests,rules/php53/tests,rules/php54/tests,rules/php55/tests,rules/php56/tests,rules/php70/tests,rules/php71/tests,rules/php72/tests,rules/php73/tests,rules/php74/tests,rules/php80/tests,rules/removing-static/tests,rules/renaming/tests,rules/restoration/tests,rules/solid/tests,rules/sensio/tests,rules/symfony-code-quality/tests,rules/symfony-phpunit/tests,rules/symfony/tests,rules/twig/tests,rules/type-declaration/tests,rules/strict-code-quality/tests,packages/dynamic-type-analysis/tests,rules/php-deglobalize/tests,rules/phalcon/tests,utils/documentation-generator/src,utils/phpstan-attribute-type-syncer/src,utils/phpstan-static-type-mapper-checker/src,rules/doctrine-gedmo-to-knplabs/tests,packages/polyfill/tests,rules/downgrade/tests
|
||||
|
||||
# see https://docs.sonarqube.org/latest/project-administration/narrowing-the-focus/#NarrowingtheFocus-patterns
|
||||
sonar.exclusions=src/**/*.php.inc,rules/**/*.php.inc,packages/**/*.php.inc,packages/**/Fixture/**/*,rules/**/Fixture/**/*,tests/**/Source/**/*
|
||||
|
|
Loading…
Reference in New Issue
Block a user