scanner = $scanner; } private function getSnippetExcludeList() { return static::$snippetExcludeList; } /** * Creates a list of all snippets which should be covered. * * @return Snippet[] * * @experimental * @internal */ public function buildListToCover() { $files = $this->scanner->files(); $classes = $this->scanner->classes($files, $this->getSnippetExcludeList()); $this->snippets = $this->scanner->snippets($classes); return $this->snippets; } /** * Mark a snippet as covered. * * @param string $identifier The identifier of the snippet being covered. * @return void * * @experimental * @internal */ public function cover($identifier) { $this->covered[] = $identifier; } /** * Return a list of all snippets not marked a covered. * * @return Snippet[] * * @experimental * @internal */ public function uncovered() { return array_diff_key($this->snippets, array_flip($this->covered)); } /** * @param string|int $identifier * @return Snippet|null * * @experimental * @internal */ public function cache($identifier) { return (array_key_exists($identifier, $this->snippets)) ? $this->snippets[$identifier] : null; } }