class RuntimeInputsResultCacheValueExtension implements ResultCacheValueExtension

The inputs the booted application was built from: the files the boot ran or read, the environment variables it can read and the files whose presence it checks.

PHPStan compares cached values before anything boots, so the value is computed from the key alone. One aggregated value keeps each boot-derived lookup to a single dependency record. Paths under the working directory are relative, which keeps the key small (PHPStan hashes it on every record) and lets the result cache survive a moved checkout.

Constants

private FILE

private PRESENCE

private DIRECTORY_PRESENCE

private DIRECTORY

private LINKED_DIRECTORY

private LISTING

private VARIABLE

private VARIABLE_PATTERN

Methods

__construct(string $workingDirectory)

Create a new extension instance.

string
createKey(array $files = [], array $presenceFiles = [], array $presenceDirectories = [], array $directories = [], array $linkedDirectories = [], array $listings = [], array $variables = [], array $variablePatterns = [])

Create the key for the given inputs.

static string
fileDigest(string $path)

Get the digest of a file's contents, or 'missing'.

static string
directoryDigest(string $directory, string $pattern, bool $followLinks = false)

Get the digest of the names and contents of the files in a directory, recursively, whose names match the pattern.

static string
listingDigest(string $directory)

Get the digest of the names of the files in a directory, recursively, or 'missing'.

string
getValue(string $key)

Get the current value for the key.

string
keyToResultCache(string $key)

Get the key as the result cache stores it; its paths are already relative to the working directory.

string
keyFromResultCache(string $storedKey)

Get the key back from the result cache.

Details

at line 71
__construct(string $workingDirectory)

Create a new extension instance.

Parameters

string $workingDirectory

at line 89
string createKey(array $files = [], array $presenceFiles = [], array $presenceDirectories = [], array $directories = [], array $linkedDirectories = [], array $listings = [], array $variables = [], array $variablePatterns = [])

Create the key for the given inputs.

Parameters

array $files

files compared by content

array $presenceFiles

files compared only by whether they exist

array $presenceDirectories

directories compared only by whether they exist

array $directories

directories mapped to the fnmatch() pattern of the files compared in them, recursively

array $linkedDirectories

directories compared as $directories are, also through their symlinked directories

array $listings

directories compared by the names of the files in them, recursively, also through their symlinked directories

array $variables

environment variable names

array $variablePatterns

fnmatch() patterns of environment variable names, matched when compared

Return Value

string

at line 125
static string fileDigest(string $path)

Get the digest of a file's contents, or 'missing'.

Parameters

string $path

Return Value

string

at line 133
static string directoryDigest(string $directory, string $pattern, bool $followLinks = false)

Get the digest of the names and contents of the files in a directory, recursively, whose names match the pattern.

Parameters

string $directory
string $pattern
bool $followLinks

Return Value

string

at line 153
static string listingDigest(string $directory)

Get the digest of the names of the files in a directory, recursively, or 'missing'.

The view finder finds views through symlinked directories, so the listing follows them.

Parameters

string $directory

Return Value

string

at line 161
string getValue(string $key)

Get the current value for the key.

Parameters

string $key

Return Value

string

at line 193
string keyToResultCache(string $key)

Get the key as the result cache stores it; its paths are already relative to the working directory.

Parameters

string $key

Return Value

string

at line 201
string keyFromResultCache(string $storedKey)

Get the key back from the result cache.

Parameters

string $storedKey

Return Value

string