-
-
Notifications
You must be signed in to change notification settings - Fork 694
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
namespace corrections, skip prefix corrections
- Loading branch information
1 parent
b7f98c6
commit 707e7b7
Showing
191 changed files
with
594 additions
and
903 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 0 additions & 10 deletions
10
rules/php70/tests/Rector/ClassMethod/Php4ConstructorRector/Fixture/non_expression.php.inc
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 0 additions & 16 deletions
16
...hp71/tests/Rector/BinaryOp/BinaryOpBetweenNumberAndStringRector/Fixture/edge_case.php.inc
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 0 additions & 12 deletions
12
rules/php71/tests/Rector/FuncCall/CountOnNullRector/Fixture/array_countable_class.php.inc
This file was deleted.
Oops, something went wrong.
40 changes: 0 additions & 40 deletions
40
.../php71/tests/Rector/FuncCall/CountOnNullRector/Fixture/countable_annotated_params.php.inc
This file was deleted.
Oops, something went wrong.
25 changes: 0 additions & 25 deletions
25
rules/php71/tests/Rector/FuncCall/CountOnNullRector/Fixture/double_same_variable.php.inc
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
rules/php71/tests/Rector/FuncCall/CountOnNullRector/Fixture/external_property.php.inc
This file was deleted.
Oops, something went wrong.
21 changes: 0 additions & 21 deletions
21
rules/php71/tests/Rector/FuncCall/CountOnNullRector/Fixture/preg_match_array.php.inc
This file was deleted.
Oops, something went wrong.
43 changes: 43 additions & 0 deletions
43
...1/tests/Rector/FuncCall/CountOnNullRector/Fixture/skip_countable_annotated_params.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
rules/php71/tests/Rector/FuncCall/CountOnNullRector/Fixture/skip_countable_class.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
...s/php71/tests/Rector/FuncCall/CountOnNullRector/Fixture/skip_double_same_variable.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 []; | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
rules/php71/tests/Rector/FuncCall/CountOnNullRector/Fixture/skip_external_property.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { | ||
} | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
rules/php71/tests/Rector/FuncCall/CountOnNullRector/Fixture/skip_preg_match_array.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.