1111use PHPStan \Rules \Rule ;
1212use PHPStan \Type \ObjectType ;
1313use function count ;
14- use function strtolower ;
1514
1615/**
1716 * @implements Rule<NodeAbstract>
@@ -36,7 +35,7 @@ public function processNode(Node $node, Scope $scope): array
3635 if (count ($ node ->getArgs ()) < 2 ) {
3736 return [];
3837 }
39- if (!$ node ->name instanceof Node \Identifier || strtolower ( $ node ->name ->name ) !== 'assertsame ' ) {
38+ if (!$ node ->name instanceof Node \Identifier || $ node ->name ->toLowerString ( ) !== 'assertsame ' ) {
4039 return [];
4140 }
4241
@@ -45,7 +44,7 @@ public function processNode(Node $node, Scope $scope): array
4544 if (
4645 $ right instanceof Node \Expr \FuncCall
4746 && $ right ->name instanceof Node \Name
48- && strtolower ( $ right ->name ->toString () ) === 'count '
47+ && $ right ->name ->toLowerString ( ) === 'count '
4948 ) {
5049 return [
5150 'You should use assertCount($expectedCount, $variable) instead of assertSame($expectedCount, count($variable)). ' ,
@@ -55,7 +54,7 @@ public function processNode(Node $node, Scope $scope): array
5554 if (
5655 $ right instanceof Node \Expr \MethodCall
5756 && $ right ->name instanceof Node \Identifier
58- && strtolower ( $ right ->name ->toString () ) === 'count '
57+ && $ right ->name ->toLowerString ( ) === 'count '
5958 && count ($ right ->getArgs ()) === 0
6059 ) {
6160 $ type = $ scope ->getType ($ right ->var );
0 commit comments