Skip to content
Closed
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
26 changes: 13 additions & 13 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/Cache/FileCacheStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@

private const CACHED_CLEARED_VERSION = 'v2-new';

/**
* @param non-empty-string $directory
*/
public function __construct(private string $directory)
{
}
Expand Down Expand Up @@ -114,7 +117,7 @@

return [
$firstDirectory,
$secondDirectory,

Check failure on line 120 in src/Cache/FileCacheStorage.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, ubuntu-latest)

Parameter #3 of function sprintf is expected to be string by placeholder #2 ("%s"), string|false given.

Check failure on line 120 in src/Cache/FileCacheStorage.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, windows-latest)

Parameter #3 of function sprintf is expected to be string by placeholder #2 ("%s"), string|false given.
$filePath,
];
}
Expand Down
4 changes: 3 additions & 1 deletion src/Rules/Cast/InvalidCastRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use PHPStan\Rules\Rule;
use PHPStan\Rules\RuleErrorBuilder;
use PHPStan\Rules\RuleLevelHelper;
use PHPStan\ShouldNotHappenException;
use PHPStan\Type\ErrorType;
use PHPStan\Type\Type;
use PHPStan\Type\VerbosityLevel;
Expand Down Expand Up @@ -82,15 +83,16 @@
if ($castType instanceof ErrorType) {
$classReflection = $this->reflectionProvider->getClass(get_class($node));
$shortName = $classReflection->getNativeReflection()->getShortName();

$shortName = strtolower($shortName);
if ($shortName === 'double') {
$shortName = 'float';
} else {
} elseif ($shortName !== '') {
$shortName = substr($shortName, 0, -1);
}

return [
RuleErrorBuilder::message(sprintf(

Check failure on line 95 in src/Rules/Cast/InvalidCastRule.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, ubuntu-latest)

Parameter #3 of function sprintf is expected to be string by placeholder #2 ("%s"), string|false given.

Check failure on line 95 in src/Rules/Cast/InvalidCastRule.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, windows-latest)

Parameter #3 of function sprintf is expected to be string by placeholder #2 ("%s"), string|false given.
'Cannot cast %s to %s.',
$scope->getType($node->expr)->describe(VerbosityLevel::value()),
$shortName,
Expand Down
Loading