fileStatuses[$filename])) { throw new InvalidArgumentException(sprintf('File "%s" is already in the parse queue', $filename)); } $this->fileStatuses[$filename] = $parseNeeded; } public function isFileKnownToParseQueue(string $filename): bool { return array_key_exists($filename, $this->fileStatuses); } public function doesFileRequireParsing(string $filename): bool { if (! $this->isFileKnownToParseQueue($filename)) { throw new InvalidArgumentException(sprintf('File "%s" is not known to the parse queue', $filename)); } return $this->fileStatuses[$filename]; } /** @return string[] */ public function getAllFilesThatRequireParsing(): array { return array_keys(array_filter($this->fileStatuses, static function (bool $parseNeeded): bool { return $parseNeeded; })); } }