Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ parameters:
paths:
- src

scanDirectories:
- /usr/share/icinga-php

ignoreErrors:
-
messages:
Expand Down
4 changes: 2 additions & 2 deletions src/BaseFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use ipl\Stdlib\Filter\Rule;

trait BaseFilter

Check failure on line 7 in src/BaseFilter.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.3) / PHPStan 8.3

Trait ipl\Stdlib\BaseFilter is used zero times and is not analysed.

Check failure on line 7 in src/BaseFilter.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.4) / PHPStan 8.4

Trait ipl\Stdlib\BaseFilter is used zero times and is not analysed.

Check failure on line 7 in src/BaseFilter.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.5) / PHPStan 8.5

Trait ipl\Stdlib\BaseFilter is used zero times and is not analysed.

Check failure on line 7 in src/BaseFilter.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.2) / PHPStan 8.2

Trait ipl\Stdlib\BaseFilter is used zero times and is not analysed.
{
/** @var Rule Base filter */
private $baseFilter;
Expand Down Expand Up @@ -32,11 +32,11 @@
/**
* Set the base filter
*
* @param Rule $baseFilter
* @param ?Rule $baseFilter
*
* @return $this
*/
public function setBaseFilter(Rule $baseFilter = null): self
public function setBaseFilter(?Rule $baseFilter = null): self
{
$this->baseFilter = $baseFilter;

Expand Down
6 changes: 1 addition & 5 deletions src/Filter.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php

namespace ipl\Stdlib;
Expand Down Expand Up @@ -259,8 +259,8 @@
if ($ignoreCase && is_string($rowValue)) {
$rowValue = strtolower($rowValue);
/** @var string|string[] $value {@see self::normalizeTypes} ensures this is the case */
$value = is_array($value)

Check failure on line 262 in src/Filter.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.3) / PHPStan 8.3

PHPDoc tag `@var` with type array<string>|string is not subtype of native type array|lowercase-string|null.

Check failure on line 262 in src/Filter.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.4) / PHPStan 8.4

PHPDoc tag `@var` with type array<string>|string is not subtype of native type array|lowercase-string|null.

Check failure on line 262 in src/Filter.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.5) / PHPStan 8.5

PHPDoc tag `@var` with type array<string>|string is not subtype of native type array|lowercase-string|null.

Check failure on line 262 in src/Filter.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.2) / PHPStan 8.2

PHPDoc tag `@var` with type array<string>|string is not subtype of native type array|lowercase-string|null.
? array_map('strtolower', $value)

Check failure on line 263 in src/Filter.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.3) / PHPStan 8.3

Parameter #1 $callback of function array_map expects (callable(mixed): mixed)|null, 'strtolower' given.

Check failure on line 263 in src/Filter.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.4) / PHPStan 8.4

Parameter #1 $callback of function array_map expects (callable(mixed): mixed)|null, 'strtolower' given.

Check failure on line 263 in src/Filter.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.5) / PHPStan 8.5

Parameter #1 $callback of function array_map expects (callable(mixed): mixed)|null, 'strtolower' given.

Check failure on line 263 in src/Filter.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.2) / PHPStan 8.2

Parameter #1 $callback of function array_map expects (callable(mixed): mixed)|null, 'strtolower' given.
: ($value === null ? null : strtolower($value)); // phpstan is wrong here
}

Expand All @@ -285,8 +285,8 @@
if ($ignoreCase && is_string($rowValue)) {
$rowValue = strtolower($rowValue);
/** @var string|string[] $value {@see self::normalizeTypes} ensures this is the case */
$value = is_array($value)

Check failure on line 288 in src/Filter.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.3) / PHPStan 8.3

PHPDoc tag `@var` with type array<string>|string is not subtype of native type array|lowercase-string|null.

Check failure on line 288 in src/Filter.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.4) / PHPStan 8.4

PHPDoc tag `@var` with type array<string>|string is not subtype of native type array|lowercase-string|null.

Check failure on line 288 in src/Filter.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.5) / PHPStan 8.5

PHPDoc tag `@var` with type array<string>|string is not subtype of native type array|lowercase-string|null.

Check failure on line 288 in src/Filter.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.2) / PHPStan 8.2

PHPDoc tag `@var` with type array<string>|string is not subtype of native type array|lowercase-string|null.
? array_map('strtolower', $value)

Check failure on line 289 in src/Filter.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.3) / PHPStan 8.3

Parameter #1 $callback of function array_map expects (callable(mixed): mixed)|null, 'strtolower' given.

Check failure on line 289 in src/Filter.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.4) / PHPStan 8.4

Parameter #1 $callback of function array_map expects (callable(mixed): mixed)|null, 'strtolower' given.

Check failure on line 289 in src/Filter.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.5) / PHPStan 8.5

Parameter #1 $callback of function array_map expects (callable(mixed): mixed)|null, 'strtolower' given.

Check failure on line 289 in src/Filter.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.2) / PHPStan 8.2

Parameter #1 $callback of function array_map expects (callable(mixed): mixed)|null, 'strtolower' given.
: ($value === null ? null : strtolower($value)); // phpstan is wrong here
}

Expand Down Expand Up @@ -536,11 +536,7 @@
*/
protected function extractValue($column, $row)
{
try {
return $row->{$column};
} catch (Throwable $_) {
return null;
}
return $row->$column ?? null;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/PriorityQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ class PriorityQueue extends SplPriorityQueue
* @param TValue $value
* @param TPriority $priority
*
* @return bool
* @return true
*/
public function insert($value, $priority): bool
public function insert($value, $priority): true
{
return parent::insert($value, [$priority, $this->serial--]);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Str.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public static function symmetricSplit(?string $subject, string $delimiter, int $
*
* @return array<string>
*/
public static function trimSplit(?string $subject, string $delimiter = ',', int $limit = null)
public static function trimSplit(?string $subject, string $delimiter = ',', ?int $limit = null)
{
if ($subject === null || empty($delimiter)) {
return [];
Expand Down
Loading