/** * @param FileInterface $file * @return DefinitionInterface[] */ private function collectDefinitionsForFile(FileInterface $file) { return array_map(function ($code) use($file) { return new DocumentationCodeDefinition($code, $file); }, $this->codeExtractor->getCodeFromDocumentation($file->getContents())); }
/** * @param string $className * @param FileInterface $file */ public function loadClass($className, FileInterface $file) { if (!class_exists($className)) { include_once $file->getPath(); } }
/** * @param $file * @return string */ private function prepareJsonContent(FileInterface $file) : string { return preg_replace('!//.*!', '', $file->getContents()); }
/** * @param FileInterface $file * @return bool */ private function getFileIncludesTest(FileInterface $file) { return $file->containsKeyword(Constants::TEST_KEYWORD) || $file->containsKeyword(Constants::EXAMPLE_KEYWORD) || $file->containsKeyword(Constants::CODE_KEYWORD) || $file->containsKeyword(Constants::MARKDOWN_PHP_CODE_KEYWORD); }