Skip to content

Commit

Permalink
namespace corrections, skip prefix corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Jan 3, 2021
1 parent b7f98c6 commit 707e7b7
Show file tree
Hide file tree
Showing 191 changed files with 594 additions and 903 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/code_analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ jobs:
name: Validate Fixtures class name
run: bin/rector validate-fixture-classname --ansi

# make sure skipped files have "skip_" prefix
-
name: Validate Fixtures skip file prefix
run: vendor/bin/easy-testing validate-fixture-skip-naming rules tests

-
name: 'Validate Sets Loading'
# this is very slow, so it has to be in own workflow
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,9 @@
"rules/dead-code/tests/Rector/MethodCall/RemoveDefaultArgumentValueRector/Source/UserDefined.php",
"rules/naming/tests/ValueObjectFactory/PropertyRenameFactory/Fixture/SomeClass.php.inc",
"rules/renaming/tests/Rector/FileWithoutNamespace/PseudoNamespaceToNamespaceRector/Source/ChangeMeAnotherNamespace.php",
"rules/renaming/tests/Rector/Name/RenameClassRector/Source/ClassImportingSameName.php",
"rules/renaming/tests/Rector/Name/RenameClassRector/Source/SkipClassImportingSameName.php",
"rules/renaming/tests/Rector/Name/RenameClassRector/Source/SkipSameNamedInterface.php",
"rules/renaming/tests/Rector/Name/RenameClassRector/Source/Manual_Twig_Filter.php",
"rules/renaming/tests/Rector/Name/RenameClassRector/Source/SomeInterface.php",
"rules/renaming/tests/Rector/Name/RenameClassRector/Source/TwigFilter.php",
"rules/renaming/tests/Rector/Name/RenameClassRector/Source/Twig_Extension_Sandbox.php",
"rules/transform/tests/Rector/FuncCall/FuncCallToMethodCallRector/Source/some_view_function.php",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Rector\Php56\Tests\Rector\FunctionLike\AddDefaultValueForUndefinedVariableRector\Fixture;

class AnonymousFunction
class SkipAnonymousFunction
{
public function run()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Rector\Php70\Tests\Rector\Assign\ListSwapArrayOrderRector\Fixture;

class SkipEmpty
class MissingListItem
{
public function b()
{
Expand All @@ -16,7 +16,7 @@ class SkipEmpty

namespace Rector\Php70\Tests\Rector\Assign\ListSwapArrayOrderRector\Fixture;

class SkipEmpty
class MissingListItem
{
public function b()
{
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ declare(strict_types=1);

namespace Rector\Php70\Tests\Rector\ClassMethod\Php4ConstructorRector\Fixture;

final class InNamespace
final class SkipInNamespace
{
public function InNamespacePhp4ConstructorClass()
public function SkipInNamespace()
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace Rector\Php70\Tests\Rector\MethodCall\ThisCallOnStaticMethodToStaticCal

use Rector\Php70\Tests\Rector\MethodCall\ThisCallOnStaticMethodToStaticCallRector\Source\AnotherClass;

class AnotherCall
class SkipAnotherCall
{
public function __construct()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace Rector\Php70\Tests\Rector\StaticCall\StaticCallOnNonStaticToInstanceCa

use Rector\Php70\Tests\Rector\StaticCall\StaticCallOnNonStaticToInstanceCallRector\Source\WithOnlyStaticMethods;

final class StaticCallOnProperty
final class SkipStaticCallOnProperty
{
/**
* @var WithOnlyStaticMethods
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Rector\Php71\Tests\Rector\BinaryOp\BinaryOpBetweenNumberAndStringRector\Fixture;

class IgnoreConcatenationDot
final class SkipConcatenationDot
{
public function run()
{
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php

namespace Rector\Php71\Tests\Rector\FuncCall\CountOnNullRector\Fixture;

class SkipCountableAnnotatedParams
{
function a(array $a = [])
{
count($a);
}

/**
* @param array $b
*/
function b($b = [])
{
count($b);
}

/**
* @param array $c
*/
function c($c)
{
count($c);
}

/**
* @param mixed[] $d
*/
function d($d)
{
count($d);
}

/**
* @param string[] $e
*/
function e($e)
{
count($e);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace Rector\Php71\Tests\Rector\FuncCall\CountOnNullRector\Fixture;

use Rector\Php71\Tests\Rector\FuncCall\CountOnNullRector\Source\CountableClass;

class SkipCountableClass
{
public function run()
{
$values = [];
$count = count($values);

$values = new CountableClass();
$count = count($values);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

declare(strict_types=1);

namespace Rector\Php71\Tests\Rector\FuncCall\CountOnNullRector\Fixture;

class SkipDoubleSameVariable
{
public function run()
{
$fn = function() {
$primaryColumns = Dibi::getColumns();

if (count($primaryColumns) === 0) {
throw new \Exception("x");
}

if (count($primaryColumns) > 1) {
throw new \Exception("y");
}
};
}
}


class Dibi
{
public static function getColumns(): array
{
return [];
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

namespace Rector\Php71\Tests\Rector\FuncCall\CountOnNullRector\Fixture;

use PhpParser\Node\Expr\Isset_;

class SkipExternalProperty
{
public function run()
{
$issetNode = new Isset_([]);

if (! isset($issetNode->vars[0]) || count($issetNode->vars) > 1) {
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

// @covers https://github.com/rectorphp/rector/issues/786

namespace Rector\Php71\Tests\Rector\FuncCall\CountOnNullRector\Fixture;

class SkipPregMatchArray
{
function pregMatchArray()
{
$version = 'hi';
preg_match('#\d\.\d(\.\d)?(-?\S*)?#i', $version, $matches);

if (count($matches) > 0) {
return 'found';
}

preg_match_all('#\d\.\d(\.\d)?(-?\S*)?#i', $version, $matches);

if (count($matches) > 0) {
return 'found';
}

return 'none';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Rector\Php71\Tests\Rector\FuncCall\CountOnNullRector\Fixture;

trait PropertyWithinTraitMethod
trait SkipPropertyWithinTraitMethod
{
/**
* @var array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

namespace Rector\Php71\Tests\Rector\FuncCall\CountOnNullRector\Fixture;

use Rector\Php71\Tests\Rector\FuncCall\CountOnNullRector\Source\CountableClass;

class SomeClassUsingTrait
class SkipVariableWithintTraitMethod
{
use VariableWithinTraitMethod;
}
Expand Down
Loading

0 comments on commit 707e7b7

Please sign in to comment.