Skip to content

Instantly share code, notes, and snippets.

@tomphp
Last active December 21, 2015 12:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomphp/6305709 to your computer and use it in GitHub Desktop.
Save tomphp/6305709 to your computer and use it in GitHub Desktop.
<?php
public function getFileScanner($fileName)
{
if ($this->fileScanner && $this->fileScanner->getFile() == $fileName) {
return $this->fileScanner;
}
$this->fileScanner = new FileScanner($fileName);
return $this->fileScanner;
}
public function setFileScanner(FileScanner $fileScanner)
{
$this->fileScanner = $fileScanner;
}
/**
* @param AnnotationManager $annotationManager
* @return AnnotationCollection
*/
public function getAnnotations(AnnotationManager $annotationManager)
{
$docComment = $this->getDocComment();
if ($docComment == '') {
return false;
}
if ($this->annotations) {
return $this->annotations;
}
$fileScanner = $this->getFileScanner($this->getFileName());
$nameInformation = $fileScanner->getClassNameInformation($this->getName());
if (!$nameInformation) {
return false;
}
$this->annotations = new AnnotationScanner($annotationManager, $docComment, $nameInformation);
return $this->annotations;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment