Skip to content
Draft
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
17 changes: 17 additions & 0 deletions src/Internal/ComposerHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ final class ComposerHelper

private static ?string $betterReflectionVersion = null;

private static ?string $phpstomStubsVersion = null;

private static ?string $phpDocParserVersion = null;

/** @var array<string, mixed[]> */
Expand Down Expand Up @@ -124,6 +126,21 @@ public static function getBetterReflectionVersion(): string
return self::$betterReflectionVersion = self::processPackageVersion($rootPackage);
}

public static function getPhpStormStubsVersion(): string
{
if (self::$phpstomStubsVersion !== null) {
return self::$phpstomStubsVersion;
}

$installed = self::getInstalled();
$rootPackage = $installed['versions']['jetbrains/phpstorm-stubs'] ?? null;
if ($rootPackage === null) {
return self::$phpstomStubsVersion = self::UNKNOWN_VERSION;
}

return self::$phpstomStubsVersion = self::processPackageVersion($rootPackage);
}

public static function getPhpDocParserVersion(): string
{
if (self::$phpDocParserVersion !== null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@
use PHPStan\BetterReflection\SourceLocator\Type\MemoizingSourceLocator;
use PHPStan\BetterReflection\SourceLocator\Type\PhpInternalSourceLocator;
use PHPStan\BetterReflection\SourceLocator\Type\SourceLocator;
use PHPStan\Cache\Cache;
use PHPStan\DependencyInjection\AutowiredParameter;
use PHPStan\DependencyInjection\AutowiredService;
use PHPStan\Internal\ComposerHelper;
use PHPStan\Php\PhpVersion;
use PHPStan\Reflection\BetterReflection\SourceLocator\AutoloadFunctionsSourceLocator;
use PHPStan\Reflection\BetterReflection\SourceLocator\AutoloadSourceLocator;
use PHPStan\Reflection\BetterReflection\SourceLocator\ComposerJsonAndInstalledJsonSourceLocatorMaker;
use PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator;
use PHPStan\Reflection\BetterReflection\SourceLocator\FileNodesFetcher;
use PHPStan\Reflection\BetterReflection\SourceLocator\OptimizedDirectorySourceLocatorRepository;
use PHPStan\Reflection\BetterReflection\SourceLocator\OptimizedPsrAutoloaderLocatorFactory;
Expand All @@ -34,6 +37,7 @@
use function extension_loaded;
use function is_dir;
use function is_file;
use function sprintf;
use const PHP_VERSION_ID;

#[AutowiredService]
Expand Down Expand Up @@ -74,6 +78,7 @@ public function __construct(
private bool $playgroundMode, // makes all PHPStan classes in the PHAR discoverable with PSR-4
#[AutowiredParameter]
private ?string $singleReflectionFile,
private Cache $cache,
)
{
}
Expand Down Expand Up @@ -161,8 +166,17 @@ public function create(): SourceLocator
}
}

$phpstormStubsVersion = ComposerHelper::getPhpStormStubsVersion();

$locators[] = new RewriteClassAliasSourceLocator(new AggregateSourceLocator($fileLocators));
$locators[] = new SkipClassAliasSourceLocator(new PhpInternalSourceLocator($astPhp8Locator, $this->phpstormStubsSourceStubber));
$locators[] = new SkipClassAliasSourceLocator(
new FileCachedSourceLocator(
new PhpInternalSourceLocator($astPhp8Locator, $this->phpstormStubsSourceStubber),
$this->cache,
$this->phpVersion,
sprintf('phpstorm-stubs-php8-%s', $phpstormStubsVersion),
),
);

$locators[] = new AutoloadSourceLocator($this->fileNodesFetcher, true);
$locators[] = new PhpVersionBlacklistSourceLocator(new PhpInternalSourceLocator($astLocator, $this->reflectionSourceStubber), $this->phpstormStubsSourceStubber);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
<?php declare(strict_types = 1);

namespace PHPStan\Reflection\BetterReflection\SourceLocator;

use PHPStan\BetterReflection\Identifier\Identifier;
use PHPStan\BetterReflection\Identifier\IdentifierType;
use PHPStan\BetterReflection\Reflection\Reflection;
use PHPStan\BetterReflection\Reflection\ReflectionClass;
use PHPStan\BetterReflection\Reflection\ReflectionConstant;
use PHPStan\BetterReflection\Reflection\ReflectionEnum;
use PHPStan\BetterReflection\Reflection\ReflectionFunction;
use PHPStan\BetterReflection\Reflector\Reflector;
use PHPStan\BetterReflection\SourceLocator\Type\SourceLocator;
use PHPStan\Cache\Cache;
use PHPStan\Internal\ComposerHelper;
use PHPStan\Php\PhpVersion;
use PHPStan\Reflection\ConstantNameHelper;
use function array_key_exists;
use function register_shutdown_function;
use function sprintf;
use function strtolower;

final class FileCachedSourceLocator implements SourceLocator
{

/** @var array{classes: array<string, ReflectionClass>, functions: array<string, ReflectionFunction>, constants: array<string, ReflectionConstant>}|null */
private ?array $cachedSymbols = null;

private bool $storeOnShutdown = false;

public function __construct(
private SourceLocator $locator,
private Cache $cache,
private PhpVersion $phpVersion,
private string $cacheKey,
)
{
}

#[\Override]
public function locateIdentifier(Reflector $reflector, Identifier $identifier): ?Reflection
{
$this->cachedSymbols ??= $this->loadCache($reflector);

if ($identifier->isClass()) {
$className = strtolower($identifier->getName());

if (!array_key_exists($className, $this->cachedSymbols['classes'])) {
$this->cachedSymbols['classes'][$className] ??= $this->locator->locateIdentifier($reflector, $identifier);

Check failure on line 49 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.2)

Property PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::$cachedSymbols (array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null) does not accept array{classes: non-empty-array<string, PHPStan\BetterReflection\Reflection\Reflection|null>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}.

Check failure on line 49 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.5)

Property PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::$cachedSymbols (array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null) does not accept array{classes: non-empty-array<string, PHPStan\BetterReflection\Reflection\Reflection|null>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}.

Check failure on line 49 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.3, ubuntu-latest)

Property PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::$cachedSymbols (array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null) does not accept array{classes: non-empty-array<string, PHPStan\BetterReflection\Reflection\Reflection|null>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}.

Check failure on line 49 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.4)

Property PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::$cachedSymbols (array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null) does not accept array{classes: non-empty-array<string, PHPStan\BetterReflection\Reflection\Reflection|null>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}.

Check failure on line 49 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.4, ubuntu-latest)

Property PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::$cachedSymbols (array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null) does not accept array{classes: non-empty-array<string, PHPStan\BetterReflection\Reflection\Reflection|null>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}.

Check failure on line 49 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.3)

Property PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::$cachedSymbols (array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null) does not accept array{classes: non-empty-array<string, PHPStan\BetterReflection\Reflection\Reflection|null>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}.

Check failure on line 49 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2, ubuntu-latest)

Property PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::$cachedSymbols (array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null) does not accept array{classes: non-empty-array<string, PHPStan\BetterReflection\Reflection\Reflection|null>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}.

Check failure on line 49 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.5, ubuntu-latest)

Property PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::$cachedSymbols (array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null) does not accept array{classes: non-empty-array<string, PHPStan\BetterReflection\Reflection\Reflection|null>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}.

Check failure on line 49 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, ubuntu-latest)

Property PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::$cachedSymbols (array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null) does not accept array{classes: non-empty-array<string, PHPStan\BetterReflection\Reflection\Reflection|null>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}.

Check failure on line 49 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.5, windows-latest)

Property PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::$cachedSymbols (array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null) does not accept array{classes: non-empty-array<string, PHPStan\BetterReflection\Reflection\Reflection|null>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}.

Check failure on line 49 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.4, windows-latest)

Property PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::$cachedSymbols (array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null) does not accept array{classes: non-empty-array<string, PHPStan\BetterReflection\Reflection\Reflection|null>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}.

Check failure on line 49 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.3, windows-latest)

Property PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::$cachedSymbols (array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null) does not accept array{classes: non-empty-array<string, PHPStan\BetterReflection\Reflection\Reflection|null>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}.

Check failure on line 49 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2, windows-latest)

Property PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::$cachedSymbols (array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null) does not accept array{classes: non-empty-array<string, PHPStan\BetterReflection\Reflection\Reflection|null>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}.

Check failure on line 49 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, windows-latest)

Property PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::$cachedSymbols (array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null) does not accept array{classes: non-empty-array<string, PHPStan\BetterReflection\Reflection\Reflection|null>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}.
$this->storeOnShutdown();
}
return $this->cachedSymbols['classes'][$className];

Check failure on line 52 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.2)

Offset 'classes' might not exist on array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null.

Check failure on line 52 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.5)

Offset 'classes' might not exist on array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null.

Check failure on line 52 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.3, ubuntu-latest)

Offset 'classes' might not exist on array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null.

Check failure on line 52 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.4)

Offset 'classes' might not exist on array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null.

Check failure on line 52 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.4, ubuntu-latest)

Offset 'classes' might not exist on array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null.

Check failure on line 52 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.3)

Offset 'classes' might not exist on array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null.

Check failure on line 52 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2, ubuntu-latest)

Offset 'classes' might not exist on array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null.

Check failure on line 52 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.5, ubuntu-latest)

Offset 'classes' might not exist on array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null.

Check failure on line 52 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, ubuntu-latest)

Offset 'classes' might not exist on array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null.

Check failure on line 52 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, ubuntu-latest)

Property PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::$cachedSymbols (array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null) does not accept array{classes: non-empty-array<string, PHPStan\BetterReflection\Reflection\Reflection|null>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}.

Check failure on line 52 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.5, windows-latest)

Offset 'classes' might not exist on array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null.

Check failure on line 52 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.4, windows-latest)

Offset 'classes' might not exist on array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null.

Check failure on line 52 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.3, windows-latest)

Offset 'classes' might not exist on array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null.

Check failure on line 52 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2, windows-latest)

Offset 'classes' might not exist on array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null.

Check failure on line 52 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, windows-latest)

Offset 'classes' might not exist on array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null.

Check failure on line 52 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, windows-latest)

Property PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::$cachedSymbols (array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null) does not accept array{classes: non-empty-array<string, PHPStan\BetterReflection\Reflection\Reflection|null>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}.
}
if ($identifier->isFunction()) {
$className = strtolower($identifier->getName());

Check failure on line 55 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, ubuntu-latest)

Offset 'classes' might not exist on array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null.

Check failure on line 55 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, windows-latest)

Offset 'classes' might not exist on array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null.

if (!array_key_exists($className, $this->cachedSymbols['functions'])) {
$this->cachedSymbols['functions'][$className] ??= $this->locator->locateIdentifier($reflector, $identifier);

Check failure on line 58 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.2)

Property PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::$cachedSymbols (array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null) does not accept array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: non-empty-array<string, PHPStan\BetterReflection\Reflection\Reflection|null>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}.

Check failure on line 58 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.5)

Property PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::$cachedSymbols (array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null) does not accept array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: non-empty-array<string, PHPStan\BetterReflection\Reflection\Reflection|null>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}.

Check failure on line 58 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.3, ubuntu-latest)

Property PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::$cachedSymbols (array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null) does not accept array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: non-empty-array<string, PHPStan\BetterReflection\Reflection\Reflection|null>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}.

Check failure on line 58 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.4)

Property PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::$cachedSymbols (array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null) does not accept array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: non-empty-array<string, PHPStan\BetterReflection\Reflection\Reflection|null>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}.

Check failure on line 58 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.4, ubuntu-latest)

Property PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::$cachedSymbols (array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null) does not accept array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: non-empty-array<string, PHPStan\BetterReflection\Reflection\Reflection|null>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}.

Check failure on line 58 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.3)

Property PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::$cachedSymbols (array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null) does not accept array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: non-empty-array<string, PHPStan\BetterReflection\Reflection\Reflection|null>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}.

Check failure on line 58 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2, ubuntu-latest)

Property PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::$cachedSymbols (array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null) does not accept array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: non-empty-array<string, PHPStan\BetterReflection\Reflection\Reflection|null>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}.

Check failure on line 58 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.5, ubuntu-latest)

Property PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::$cachedSymbols (array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null) does not accept array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: non-empty-array<string, PHPStan\BetterReflection\Reflection\Reflection|null>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}.

Check failure on line 58 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, ubuntu-latest)

Property PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::$cachedSymbols (array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null) does not accept array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: non-empty-array<string, PHPStan\BetterReflection\Reflection\Reflection|null>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}.

Check failure on line 58 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.5, windows-latest)

Property PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::$cachedSymbols (array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null) does not accept array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: non-empty-array<string, PHPStan\BetterReflection\Reflection\Reflection|null>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}.

Check failure on line 58 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.4, windows-latest)

Property PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::$cachedSymbols (array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null) does not accept array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: non-empty-array<string, PHPStan\BetterReflection\Reflection\Reflection|null>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}.

Check failure on line 58 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.3, windows-latest)

Property PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::$cachedSymbols (array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null) does not accept array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: non-empty-array<string, PHPStan\BetterReflection\Reflection\Reflection|null>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}.

Check failure on line 58 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2, windows-latest)

Property PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::$cachedSymbols (array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null) does not accept array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: non-empty-array<string, PHPStan\BetterReflection\Reflection\Reflection|null>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}.

Check failure on line 58 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, windows-latest)

Property PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::$cachedSymbols (array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null) does not accept array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: non-empty-array<string, PHPStan\BetterReflection\Reflection\Reflection|null>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}.
$this->storeOnShutdown();
}
return $this->cachedSymbols['functions'][$className];

Check failure on line 61 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.2)

Offset 'functions' might not exist on array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null.

Check failure on line 61 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.5)

Offset 'functions' might not exist on array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null.

Check failure on line 61 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.3, ubuntu-latest)

Offset 'functions' might not exist on array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null.

Check failure on line 61 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.4)

Offset 'functions' might not exist on array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null.

Check failure on line 61 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.4, ubuntu-latest)

Offset 'functions' might not exist on array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null.

Check failure on line 61 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.3)

Offset 'functions' might not exist on array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null.

Check failure on line 61 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2, ubuntu-latest)

Offset 'functions' might not exist on array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null.

Check failure on line 61 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.5, ubuntu-latest)

Offset 'functions' might not exist on array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null.

Check failure on line 61 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, ubuntu-latest)

Offset 'functions' might not exist on array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null.

Check failure on line 61 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, ubuntu-latest)

Property PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::$cachedSymbols (array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null) does not accept array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: non-empty-array<string, PHPStan\BetterReflection\Reflection\Reflection|null>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}.

Check failure on line 61 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.5, windows-latest)

Offset 'functions' might not exist on array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null.

Check failure on line 61 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.4, windows-latest)

Offset 'functions' might not exist on array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null.

Check failure on line 61 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.3, windows-latest)

Offset 'functions' might not exist on array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null.

Check failure on line 61 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2, windows-latest)

Offset 'functions' might not exist on array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null.

Check failure on line 61 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, windows-latest)

Offset 'functions' might not exist on array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null.

Check failure on line 61 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, windows-latest)

Property PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::$cachedSymbols (array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null) does not accept array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: non-empty-array<string, PHPStan\BetterReflection\Reflection\Reflection|null>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}.
}
if ($identifier->isConstant()) {
$constantName = ConstantNameHelper::normalize($identifier->getName());

Check failure on line 64 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, ubuntu-latest)

Offset 'functions' might not exist on array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null.

Check failure on line 64 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, windows-latest)

Offset 'functions' might not exist on array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null.

if (!array_key_exists($constantName, $this->cachedSymbols['constants'])) {
$this->cachedSymbols['constants'][$constantName] ??= $this->locator->locateIdentifier($reflector, $identifier);

Check failure on line 67 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.2)

Property PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::$cachedSymbols (array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null) does not accept array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: non-empty-array<string, PHPStan\BetterReflection\Reflection\Reflection|null>}.

Check failure on line 67 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.5)

Property PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::$cachedSymbols (array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null) does not accept array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: non-empty-array<string, PHPStan\BetterReflection\Reflection\Reflection|null>}.

Check failure on line 67 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.3, ubuntu-latest)

Property PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::$cachedSymbols (array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null) does not accept array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: non-empty-array<string, PHPStan\BetterReflection\Reflection\Reflection|null>}.

Check failure on line 67 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.4)

Property PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::$cachedSymbols (array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null) does not accept array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: non-empty-array<string, PHPStan\BetterReflection\Reflection\Reflection|null>}.

Check failure on line 67 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.4, ubuntu-latest)

Property PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::$cachedSymbols (array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null) does not accept array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: non-empty-array<string, PHPStan\BetterReflection\Reflection\Reflection|null>}.

Check failure on line 67 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.3)

Property PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::$cachedSymbols (array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null) does not accept array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: non-empty-array<string, PHPStan\BetterReflection\Reflection\Reflection|null>}.

Check failure on line 67 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2, ubuntu-latest)

Property PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::$cachedSymbols (array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null) does not accept array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: non-empty-array<string, PHPStan\BetterReflection\Reflection\Reflection|null>}.

Check failure on line 67 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.5, ubuntu-latest)

Property PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::$cachedSymbols (array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null) does not accept array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: non-empty-array<string, PHPStan\BetterReflection\Reflection\Reflection|null>}.

Check failure on line 67 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, ubuntu-latest)

Property PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::$cachedSymbols (array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null) does not accept array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: non-empty-array<string, PHPStan\BetterReflection\Reflection\Reflection|null>}.

Check failure on line 67 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.5, windows-latest)

Property PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::$cachedSymbols (array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null) does not accept array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: non-empty-array<string, PHPStan\BetterReflection\Reflection\Reflection|null>}.

Check failure on line 67 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.4, windows-latest)

Property PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::$cachedSymbols (array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null) does not accept array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: non-empty-array<string, PHPStan\BetterReflection\Reflection\Reflection|null>}.

Check failure on line 67 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.3, windows-latest)

Property PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::$cachedSymbols (array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null) does not accept array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: non-empty-array<string, PHPStan\BetterReflection\Reflection\Reflection|null>}.

Check failure on line 67 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2, windows-latest)

Property PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::$cachedSymbols (array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null) does not accept array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: non-empty-array<string, PHPStan\BetterReflection\Reflection\Reflection|null>}.

Check failure on line 67 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, windows-latest)

Property PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::$cachedSymbols (array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null) does not accept array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: non-empty-array<string, PHPStan\BetterReflection\Reflection\Reflection|null>}.
$this->storeOnShutdown();
}
return $this->cachedSymbols['constants'][$constantName];

Check failure on line 70 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.2)

Offset 'constants' might not exist on array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null.

Check failure on line 70 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.5)

Offset 'constants' might not exist on array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null.

Check failure on line 70 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.3, ubuntu-latest)

Offset 'constants' might not exist on array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null.

Check failure on line 70 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.4)

Offset 'constants' might not exist on array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null.

Check failure on line 70 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.4, ubuntu-latest)

Offset 'constants' might not exist on array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null.

Check failure on line 70 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.3)

Offset 'constants' might not exist on array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null.

Check failure on line 70 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2, ubuntu-latest)

Offset 'constants' might not exist on array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null.

Check failure on line 70 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.5, ubuntu-latest)

Offset 'constants' might not exist on array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null.

Check failure on line 70 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, ubuntu-latest)

Offset 'constants' might not exist on array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null.

Check failure on line 70 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, ubuntu-latest)

Property PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::$cachedSymbols (array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null) does not accept array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: non-empty-array<string, PHPStan\BetterReflection\Reflection\Reflection|null>}.

Check failure on line 70 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.5, windows-latest)

Offset 'constants' might not exist on array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null.

Check failure on line 70 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.4, windows-latest)

Offset 'constants' might not exist on array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null.

Check failure on line 70 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.3, windows-latest)

Offset 'constants' might not exist on array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null.

Check failure on line 70 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2, windows-latest)

Offset 'constants' might not exist on array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null.

Check failure on line 70 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, windows-latest)

Offset 'constants' might not exist on array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null.

Check failure on line 70 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, windows-latest)

Property PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::$cachedSymbols (array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null) does not accept array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: non-empty-array<string, PHPStan\BetterReflection\Reflection\Reflection|null>}.
}

return null;

Check failure on line 73 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, ubuntu-latest)

Offset 'constants' might not exist on array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null.

Check failure on line 73 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, windows-latest)

Offset 'constants' might not exist on array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>}|null.
}

#[\Override]
public function locateIdentifiersByType(Reflector $reflector, IdentifierType $identifierType): array
{
return $this->locator->locateIdentifiersByType($reflector, $identifierType);
}

private function getVariableCacheKey(): string
{
return sprintf('v2-%s-%s', ComposerHelper::getBetterReflectionVersion(), $this->phpVersion->getVersionString());
}

private function storeOnShutdown(): void
{
if ($this->storeOnShutdown) {
return;
}

$this->storeOnShutdown = true;
register_shutdown_function([$this, 'storeCache']);
}

/** @return array{classes: array<string, ReflectionClass>, functions: array<string, ReflectionFunction>, constants: array<string, ReflectionConstant>} */
private function loadCache(Reflector $reflector): array
{
$variableCacheKey = $this->getVariableCacheKey();
$cached = $this->cache->load($this->cacheKey, $variableCacheKey);

Check failure on line 101 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.2)

Parameter #1 $key of method PHPStan\Cache\Cache::load() expects non-empty-string, string given.

Check failure on line 101 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.5)

Parameter #1 $key of method PHPStan\Cache\Cache::load() expects non-empty-string, string given.

Check failure on line 101 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.3, ubuntu-latest)

Parameter #1 $key of method PHPStan\Cache\Cache::load() expects non-empty-string, string given.

Check failure on line 101 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.4)

Parameter #1 $key of method PHPStan\Cache\Cache::load() expects non-empty-string, string given.

Check failure on line 101 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.4, ubuntu-latest)

Parameter #1 $key of method PHPStan\Cache\Cache::load() expects non-empty-string, string given.

Check failure on line 101 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.3)

Parameter #1 $key of method PHPStan\Cache\Cache::load() expects non-empty-string, string given.

Check failure on line 101 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2, ubuntu-latest)

Parameter #1 $key of method PHPStan\Cache\Cache::load() expects non-empty-string, string given.

Check failure on line 101 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.5, ubuntu-latest)

Parameter #1 $key of method PHPStan\Cache\Cache::load() expects non-empty-string, string given.

Check failure on line 101 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, ubuntu-latest)

Parameter #1 $key of method PHPStan\Cache\Cache::load() expects non-empty-string, string given.

Check failure on line 101 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.5, windows-latest)

Parameter #1 $key of method PHPStan\Cache\Cache::load() expects non-empty-string, string given.

Check failure on line 101 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.4, windows-latest)

Parameter #1 $key of method PHPStan\Cache\Cache::load() expects non-empty-string, string given.

Check failure on line 101 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.3, windows-latest)

Parameter #1 $key of method PHPStan\Cache\Cache::load() expects non-empty-string, string given.

Check failure on line 101 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2, windows-latest)

Parameter #1 $key of method PHPStan\Cache\Cache::load() expects non-empty-string, string given.

Check failure on line 101 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, windows-latest)

Parameter #1 $key of method PHPStan\Cache\Cache::load() expects non-empty-string, string given.

$restored = [
'classes' => [],

Check failure on line 104 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, ubuntu-latest)

Parameter #1 $key of method PHPStan\Cache\Cache::load() expects non-empty-string, string given.

Check failure on line 104 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, windows-latest)

Parameter #1 $key of method PHPStan\Cache\Cache::load() expects non-empty-string, string given.
'functions' => [],
'constants' => [],
];
if ($cached === null) {
return $restored;
}

foreach ($cached['classes'] ?? [] as $class => $cachedReflection) {
if ($cachedReflection === null) {
$restored['classes'][$class] = null;
continue;
}

if (array_key_exists('backingType', $cachedReflection)) {
$restored['classes'][$class] = ReflectionEnum::importFromCache($reflector, $cachedReflection);
continue;
}

$restored['classes'][$class] = ReflectionClass::importFromCache($reflector, $cachedReflection);
}
foreach ($cached['functions'] ?? [] as $class => $cachedReflection) {
if ($cachedReflection === null) {
$restored['functions'][$class] = null;
continue;
}
$restored['functions'][$class] = ReflectionFunction::importFromCache($reflector, $cachedReflection);
}
foreach ($cached['constants'] ?? [] as $constantName => $cachedReflection) {
if ($cachedReflection === null) {
$restored['constants'][$constantName] = null;
continue;
}

$restored['constants'][$constantName] = ReflectionConstant::importFromCache($reflector, $cachedReflection);
}
return $restored;

Check failure on line 140 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.2)

Method PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::loadCache() should return array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>} but returns array{classes: array<PHPStan\BetterReflection\Reflection\ReflectionClass|null>, functions: array<PHPStan\BetterReflection\Reflection\ReflectionFunction|null>, constants: array<PHPStan\BetterReflection\Reflection\ReflectionConstant|null>}.

Check failure on line 140 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.5)

Method PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::loadCache() should return array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>} but returns array{classes: array<PHPStan\BetterReflection\Reflection\ReflectionClass|null>, functions: array<PHPStan\BetterReflection\Reflection\ReflectionFunction|null>, constants: array<PHPStan\BetterReflection\Reflection\ReflectionConstant|null>}.

Check failure on line 140 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.3, ubuntu-latest)

Method PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::loadCache() should return array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>} but returns array{classes: array<PHPStan\BetterReflection\Reflection\ReflectionClass|null>, functions: array<PHPStan\BetterReflection\Reflection\ReflectionFunction|null>, constants: array<PHPStan\BetterReflection\Reflection\ReflectionConstant|null>}.

Check failure on line 140 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.4)

Method PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::loadCache() should return array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>} but returns array{classes: array<PHPStan\BetterReflection\Reflection\ReflectionClass|null>, functions: array<PHPStan\BetterReflection\Reflection\ReflectionFunction|null>, constants: array<PHPStan\BetterReflection\Reflection\ReflectionConstant|null>}.

Check failure on line 140 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.4, ubuntu-latest)

Method PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::loadCache() should return array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>} but returns array{classes: array<PHPStan\BetterReflection\Reflection\ReflectionClass|null>, functions: array<PHPStan\BetterReflection\Reflection\ReflectionFunction|null>, constants: array<PHPStan\BetterReflection\Reflection\ReflectionConstant|null>}.

Check failure on line 140 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.3)

Method PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::loadCache() should return array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>} but returns array{classes: array<PHPStan\BetterReflection\Reflection\ReflectionClass|null>, functions: array<PHPStan\BetterReflection\Reflection\ReflectionFunction|null>, constants: array<PHPStan\BetterReflection\Reflection\ReflectionConstant|null>}.

Check failure on line 140 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2, ubuntu-latest)

Method PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::loadCache() should return array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>} but returns array{classes: array<PHPStan\BetterReflection\Reflection\ReflectionClass|null>, functions: array<PHPStan\BetterReflection\Reflection\ReflectionFunction|null>, constants: array<PHPStan\BetterReflection\Reflection\ReflectionConstant|null>}.

Check failure on line 140 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.5, ubuntu-latest)

Method PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::loadCache() should return array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>} but returns array{classes: array<PHPStan\BetterReflection\Reflection\ReflectionClass|null>, functions: array<PHPStan\BetterReflection\Reflection\ReflectionFunction|null>, constants: array<PHPStan\BetterReflection\Reflection\ReflectionConstant|null>}.

Check failure on line 140 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, ubuntu-latest)

Method PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::loadCache() should return array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>} but returns array{classes: array<PHPStan\BetterReflection\Reflection\ReflectionClass|null>, functions: array<PHPStan\BetterReflection\Reflection\ReflectionFunction|null>, constants: array<PHPStan\BetterReflection\Reflection\ReflectionConstant|null>}.

Check failure on line 140 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.5, windows-latest)

Method PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::loadCache() should return array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>} but returns array{classes: array<PHPStan\BetterReflection\Reflection\ReflectionClass|null>, functions: array<PHPStan\BetterReflection\Reflection\ReflectionFunction|null>, constants: array<PHPStan\BetterReflection\Reflection\ReflectionConstant|null>}.

Check failure on line 140 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.4, windows-latest)

Method PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::loadCache() should return array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>} but returns array{classes: array<PHPStan\BetterReflection\Reflection\ReflectionClass|null>, functions: array<PHPStan\BetterReflection\Reflection\ReflectionFunction|null>, constants: array<PHPStan\BetterReflection\Reflection\ReflectionConstant|null>}.

Check failure on line 140 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.3, windows-latest)

Method PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::loadCache() should return array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>} but returns array{classes: array<PHPStan\BetterReflection\Reflection\ReflectionClass|null>, functions: array<PHPStan\BetterReflection\Reflection\ReflectionFunction|null>, constants: array<PHPStan\BetterReflection\Reflection\ReflectionConstant|null>}.

Check failure on line 140 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2, windows-latest)

Method PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::loadCache() should return array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>} but returns array{classes: array<PHPStan\BetterReflection\Reflection\ReflectionClass|null>, functions: array<PHPStan\BetterReflection\Reflection\ReflectionFunction|null>, constants: array<PHPStan\BetterReflection\Reflection\ReflectionConstant|null>}.

Check failure on line 140 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, windows-latest)

Method PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::loadCache() should return array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>} but returns array{classes: array<PHPStan\BetterReflection\Reflection\ReflectionClass|null>, functions: array<PHPStan\BetterReflection\Reflection\ReflectionFunction|null>, constants: array<PHPStan\BetterReflection\Reflection\ReflectionConstant|null>}.
}

private function storeCache(): void

Check failure on line 143 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, ubuntu-latest)

Method PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::loadCache() should return array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>} but returns array{classes: array<PHPStan\BetterReflection\Reflection\ReflectionClass|null>, functions: array<PHPStan\BetterReflection\Reflection\ReflectionFunction|null>, constants: array<PHPStan\BetterReflection\Reflection\ReflectionConstant|null>}.

Check failure on line 143 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, windows-latest)

Method PHPStan\Reflection\BetterReflection\SourceLocator\FileCachedSourceLocator::loadCache() should return array{classes: array<string, PHPStan\BetterReflection\Reflection\ReflectionClass>, functions: array<string, PHPStan\BetterReflection\Reflection\ReflectionFunction>, constants: array<string, PHPStan\BetterReflection\Reflection\ReflectionConstant>} but returns array{classes: array<PHPStan\BetterReflection\Reflection\ReflectionClass|null>, functions: array<PHPStan\BetterReflection\Reflection\ReflectionFunction|null>, constants: array<PHPStan\BetterReflection\Reflection\ReflectionConstant|null>}.
{
$variableCacheKey = $this->getVariableCacheKey();

$exported = [
'classes' => [],
'functions' => [],
'constants' => [],
];
foreach ($this->cachedSymbols ?? [] as $type => $data) {
foreach ($data as $name => $reflection) {
if ($reflection === null) {

Check failure on line 154 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.2)

Strict comparison using === between PHPStan\BetterReflection\Reflection\ReflectionClass|PHPStan\BetterReflection\Reflection\ReflectionConstant|PHPStan\BetterReflection\Reflection\ReflectionFunction and null will always evaluate to false.

Check failure on line 154 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.5)

Strict comparison using === between PHPStan\BetterReflection\Reflection\ReflectionClass|PHPStan\BetterReflection\Reflection\ReflectionConstant|PHPStan\BetterReflection\Reflection\ReflectionFunction and null will always evaluate to false.

Check failure on line 154 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.3, ubuntu-latest)

Strict comparison using === between PHPStan\BetterReflection\Reflection\ReflectionClass|PHPStan\BetterReflection\Reflection\ReflectionConstant|PHPStan\BetterReflection\Reflection\ReflectionFunction and null will always evaluate to false.

Check failure on line 154 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.4)

Strict comparison using === between PHPStan\BetterReflection\Reflection\ReflectionClass|PHPStan\BetterReflection\Reflection\ReflectionConstant|PHPStan\BetterReflection\Reflection\ReflectionFunction and null will always evaluate to false.

Check failure on line 154 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.4, ubuntu-latest)

Strict comparison using === between PHPStan\BetterReflection\Reflection\ReflectionClass|PHPStan\BetterReflection\Reflection\ReflectionConstant|PHPStan\BetterReflection\Reflection\ReflectionFunction and null will always evaluate to false.

Check failure on line 154 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.3)

Strict comparison using === between PHPStan\BetterReflection\Reflection\ReflectionClass|PHPStan\BetterReflection\Reflection\ReflectionConstant|PHPStan\BetterReflection\Reflection\ReflectionFunction and null will always evaluate to false.

Check failure on line 154 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2, ubuntu-latest)

Strict comparison using === between PHPStan\BetterReflection\Reflection\ReflectionClass|PHPStan\BetterReflection\Reflection\ReflectionConstant|PHPStan\BetterReflection\Reflection\ReflectionFunction and null will always evaluate to false.

Check failure on line 154 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.5, ubuntu-latest)

Strict comparison using === between PHPStan\BetterReflection\Reflection\ReflectionClass|PHPStan\BetterReflection\Reflection\ReflectionConstant|PHPStan\BetterReflection\Reflection\ReflectionFunction and null will always evaluate to false.

Check failure on line 154 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, ubuntu-latest)

Strict comparison using === between PHPStan\BetterReflection\Reflection\ReflectionClass|PHPStan\BetterReflection\Reflection\ReflectionConstant|PHPStan\BetterReflection\Reflection\ReflectionFunction and null will always evaluate to false.

Check failure on line 154 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.5, windows-latest)

Strict comparison using === between PHPStan\BetterReflection\Reflection\ReflectionClass|PHPStan\BetterReflection\Reflection\ReflectionConstant|PHPStan\BetterReflection\Reflection\ReflectionFunction and null will always evaluate to false.

Check failure on line 154 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.4, windows-latest)

Strict comparison using === between PHPStan\BetterReflection\Reflection\ReflectionClass|PHPStan\BetterReflection\Reflection\ReflectionConstant|PHPStan\BetterReflection\Reflection\ReflectionFunction and null will always evaluate to false.

Check failure on line 154 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.3, windows-latest)

Strict comparison using === between PHPStan\BetterReflection\Reflection\ReflectionClass|PHPStan\BetterReflection\Reflection\ReflectionConstant|PHPStan\BetterReflection\Reflection\ReflectionFunction and null will always evaluate to false.

Check failure on line 154 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2, windows-latest)

Strict comparison using === between PHPStan\BetterReflection\Reflection\ReflectionClass|PHPStan\BetterReflection\Reflection\ReflectionConstant|PHPStan\BetterReflection\Reflection\ReflectionFunction and null will always evaluate to false.

Check failure on line 154 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, windows-latest)

Strict comparison using === between PHPStan\BetterReflection\Reflection\ReflectionClass|PHPStan\BetterReflection\Reflection\ReflectionConstant|PHPStan\BetterReflection\Reflection\ReflectionFunction and null will always evaluate to false.
$exported[$type][$name] = $reflection;
continue;
}

Check failure on line 157 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, ubuntu-latest)

Strict comparison using === between PHPStan\BetterReflection\Reflection\ReflectionClass|PHPStan\BetterReflection\Reflection\ReflectionConstant|PHPStan\BetterReflection\Reflection\ReflectionFunction and null will always evaluate to false.

Check failure on line 157 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, windows-latest)

Strict comparison using === between PHPStan\BetterReflection\Reflection\ReflectionClass|PHPStan\BetterReflection\Reflection\ReflectionConstant|PHPStan\BetterReflection\Reflection\ReflectionFunction and null will always evaluate to false.
$exported[$type][$name] = $reflection->exportToCache();
}
}

$this->cache->save($this->cacheKey, $variableCacheKey, $exported);

Check failure on line 162 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.2)

Parameter #1 $key of method PHPStan\Cache\Cache::save() expects non-empty-string, string given.

Check failure on line 162 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.5)

Parameter #1 $key of method PHPStan\Cache\Cache::save() expects non-empty-string, string given.

Check failure on line 162 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.3, ubuntu-latest)

Parameter #1 $key of method PHPStan\Cache\Cache::save() expects non-empty-string, string given.

Check failure on line 162 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.4)

Parameter #1 $key of method PHPStan\Cache\Cache::save() expects non-empty-string, string given.

Check failure on line 162 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.4, ubuntu-latest)

Parameter #1 $key of method PHPStan\Cache\Cache::save() expects non-empty-string, string given.

Check failure on line 162 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.3)

Parameter #1 $key of method PHPStan\Cache\Cache::save() expects non-empty-string, string given.

Check failure on line 162 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2, ubuntu-latest)

Parameter #1 $key of method PHPStan\Cache\Cache::save() expects non-empty-string, string given.

Check failure on line 162 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.5, ubuntu-latest)

Parameter #1 $key of method PHPStan\Cache\Cache::save() expects non-empty-string, string given.

Check failure on line 162 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, ubuntu-latest)

Parameter #1 $key of method PHPStan\Cache\Cache::save() expects non-empty-string, string given.

Check failure on line 162 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.5, windows-latest)

Parameter #1 $key of method PHPStan\Cache\Cache::save() expects non-empty-string, string given.

Check failure on line 162 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.4, windows-latest)

Parameter #1 $key of method PHPStan\Cache\Cache::save() expects non-empty-string, string given.

Check failure on line 162 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.3, windows-latest)

Parameter #1 $key of method PHPStan\Cache\Cache::save() expects non-empty-string, string given.

Check failure on line 162 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2, windows-latest)

Parameter #1 $key of method PHPStan\Cache\Cache::save() expects non-empty-string, string given.

Check failure on line 162 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, windows-latest)

Parameter #1 $key of method PHPStan\Cache\Cache::save() expects non-empty-string, string given.
}

}

Check failure on line 165 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, ubuntu-latest)

Parameter #1 $key of method PHPStan\Cache\Cache::save() expects non-empty-string, string given.

Check failure on line 165 in src/Reflection/BetterReflection/SourceLocator/FileCachedSourceLocator.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, windows-latest)

Parameter #1 $key of method PHPStan\Cache\Cache::save() expects non-empty-string, string given.
Loading