Skip to content

Commit b7367ff

Browse files
authored
Merge pull request #164 from php-api-clients/short-cicuit-when-there-is-a-new-additional-file-to-hash
Short cicuit when there is a new additional file to hash
2 parents a367392 + 1a07c3f commit b7367ff

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Generator.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,10 @@ public function __construct(
164164
$this->state->specHash === $this->currentSpecHash &&
165165
(static function (string $root, Files $files, string ...$additionalFiles): bool {
166166
foreach ($additionalFiles as $additionalFile) {
167+
if (!$files->has($additionalFile)) {
168+
return false;
169+
}
170+
167171
if ($files->has($additionalFile) && (! file_exists($root . $additionalFile) || $files->get($additionalFile)->hash !== md5(file_get_contents($root . $additionalFile)))) {
168172
return false;
169173
}

0 commit comments

Comments
 (0)