Exemplo n.º 1
0
 /**
  * @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()));
 }
Exemplo n.º 2
0
 /**
  * @param string        $className
  * @param FileInterface $file
  */
 public function loadClass($className, FileInterface $file)
 {
     if (!class_exists($className)) {
         include_once $file->getPath();
     }
 }
Exemplo n.º 3
0
 /**
  * @param $file
  * @return string
  */
 private function prepareJsonContent(FileInterface $file) : string
 {
     return preg_replace('!//.*!', '', $file->getContents());
 }
Exemplo n.º 4
0
 /**
  * @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);
 }