This commit is contained in:
nuno maduro
2026-05-02 15:26:58 +01:00
parent 348b439172
commit 460401c379
2 changed files with 24 additions and 5 deletions

View File

@ -9,12 +9,12 @@ namespace Pest\Plugins\Tia;
*/
final readonly class Fingerprint
{
private const int SCHEMA_VERSION = 14;
private const int SCHEMA_VERSION = 15;
/**
* @return array{
* structural: array<string, int|string|null>,
* environmental: array<string, string|null>,
* environmental: array<string, int|string|null>,
* }
*/
public static function compute(string $projectRoot): array
@ -22,6 +22,7 @@ final readonly class Fingerprint
return [
'structural' => [
'schema' => self::SCHEMA_VERSION,
'composer_lock' => self::composerLockHash($projectRoot),
'phpunit_xml' => self::hashIfExists($projectRoot.'/phpunit.xml'),
'phpunit_xml_dist' => self::hashIfExists($projectRoot.'/phpunit.xml.dist'),
'pest_factory' => self::contentHashOrNull(__DIR__.'/../../Factories/TestCaseFactory.php'),
@ -33,6 +34,10 @@ final readonly class Fingerprint
'composer_json' => self::composerJsonHash($projectRoot),
],
'environmental' => [
'php_minor' => PHP_MAJOR_VERSION,
// 'extensions' => self::extensionsFingerprint($projectRoot),
// 'env_files' => self::envFilesHash($projectRoot),
],
];
}
@ -226,6 +231,11 @@ final readonly class Fingerprint
return $json === false ? null : hash('xxh128', $json);
}
private static function composerLockHash(string $projectRoot): ?string
{
return self::hashIfExists($projectRoot.'/composer.lock');
}
private static function packageLockHash(string $projectRoot): ?string
{
$parts = [];