Skip to content

Commit 56bf55f

Browse files
committed
Update SA tool and soothe them
The commit introduces `is_string` function in a condition in `MethodSignatureString.php`. Several tools in `composer.lock` have been updated to newer versions, including packages like `amphp/amp`, `amphp/byte-stream`, and others. This commit thus refactors the code for improved validation and updates dependencies for enhanced project features.
1 parent 1f50707 commit 56bf55f

File tree

3 files changed

+305
-291
lines changed

3 files changed

+305
-291
lines changed

Diff for: sl-src/CacheReader.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use function array_merge;
1616
use function assert;
1717
use function filemtime;
18+
use function is_string;
1819
use function max;
1920
use function rawurlencode;
2021

@@ -161,7 +162,7 @@ private function getLastModification(ReflectionClass $class): int // @phpstan-i
161162
$parent = $class->getParentClass();
162163

163164
$lastModification = max(array_merge(
164-
[$filename ? filemtime($filename) : 0],
165+
[is_string($filename) ? filemtime($filename) : 0],
165166
array_map(function (ReflectionClass $reflectionTrait): int {
166167
return $this->getTraitLastModificationTime($reflectionTrait);
167168
}, $class->getTraits()),
@@ -185,7 +186,7 @@ private function getTraitLastModificationTime(ReflectionClass $reflectionTrait):
185186
}
186187

187188
$lastModificationTime = max(array_merge(
188-
[$fileName ? filemtime($fileName) : 0],
189+
[is_string($fileName) ? filemtime($fileName) : 0],
189190
array_map(function (ReflectionClass $reflectionTrait): int {
190191
return $this->getTraitLastModificationTime($reflectionTrait);
191192
}, $reflectionTrait->getTraits())

Diff for: src/MethodSignatureString.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
use function implode;
1212
use function is_numeric;
13+
use function is_string;
1314
use function preg_replace;
1415
use function sprintf;
1516
use function str_replace;
@@ -40,7 +41,7 @@ public function get(ReflectionMethod $method): string
4041

4142
// PHPDocを取得
4243
$docComment = $method->getDocComment();
43-
if ($docComment) {
44+
if (is_string($docComment)) {
4445
$signatureParts[] = $docComment . PHP_EOL;
4546
}
4647

0 commit comments

Comments
 (0)