Skip to content

Commit 28086f6

Browse files
committed
use phpstan 2 and remove unnecessary checks that strict typing already covers
1 parent c6b23da commit 28086f6

File tree

4 files changed

+3
-8
lines changed

4 files changed

+3
-8
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"require-dev": {
3535
"ramsey/uuid": "^3.5",
3636
"phpunit/phpunit": "^7.5 || ^8.0 || ^9.0",
37-
"phpstan/phpstan": "^1.9",
37+
"phpstan/phpstan": "^2.1",
3838
"friendsofphp/php-cs-fixer": "^3.40"
3939
},
4040
"suggest": {

phpstan.neon.dist

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,3 @@ parameters:
99
message: "#^Empty array passed to foreach\\.$#"
1010
count: 5
1111
path: src/PHPCR/Util/Console/Helper/PhpcrHelper.php
12-
# only formulated in phpdoc that the return value must be countable
13-
-
14-
message: "#expects array|Countable, Iterator<mixed, PHPCR\\Query\\RowInterface> given\\.$#"
15-
count: 1
16-
path: src/PHPCR/Util/Console/Command/NodesUpdateCommand.php

src/PHPCR/Util/CND/Parser/AbstractParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ protected function checkToken(int $type, ?string $data = null, bool $ignoreCase
4444
}
4545

4646
if ($data && $token->getData() !== $data) {
47-
if ($ignoreCase && is_string($data) && is_string($token->getData())) {
47+
if ($ignoreCase) {
4848
return 0 !== strcasecmp($data, $token->getData());
4949
}
5050

src/PHPCR/Util/QOM/Sql2Generator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ public function evalColumns(iterable $columns): string
270270
public function evalColumn(string $selectorName, ?string $propertyName = null, ?string $colname = null): string
271271
{
272272
$sql2 = '';
273-
if (null !== $selectorName && null === $propertyName && null === $colname) {
273+
if (null === $propertyName && null === $colname) {
274274
$sql2 .= $this->addBracketsIfNeeded($selectorName).'.*';
275275
} else {
276276
$sql2 .= $this->evalPropertyValue($propertyName, $selectorName);

0 commit comments

Comments
 (0)