Verzeichnisstruktur phpBB-3.3.15
- Veröffentlicht
- 28.08.2024
So funktioniert es
|
Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück |
Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
PropertyReflection.php
001 <?php
002 /**
003 * Zend Framework (http://framework.zend.com/)
004 *
005 * @link http://github.com/zendframework/zf2 for the canonical source repository
006 * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)
007 * @license http://framework.zend.com/license/new-bsd New BSD License
008 */
009
010 namespace Zend\Code\Reflection;
011
012 use ReflectionProperty as PhpReflectionProperty;
013 use Zend\Code\Annotation\AnnotationManager;
014 use Zend\Code\Scanner\AnnotationScanner;
015 use Zend\Code\Scanner\CachingFileScanner;
016
017 /**
018 * @todo implement line numbers
019 */
020 class PropertyReflection extends PhpReflectionProperty implements ReflectionInterface
021 {
022 /**
023 * @var AnnotationScanner
024 */
025 protected $annotations;
026
027 /**
028 * Get declaring class reflection object
029 *
030 * @return ClassReflection
031 */
032 public function getDeclaringClass()
033 {
034 $phpReflection = parent::getDeclaringClass();
035 $zendReflection = new ClassReflection($phpReflection->getName());
036 unset($phpReflection);
037
038 return $zendReflection;
039 }
040
041 /**
042 * Get DocBlock comment
043 *
044 * @return string|false False if no DocBlock defined
045 */
046 public function getDocComment()
047 {
048 return parent::getDocComment();
049 }
050
051 /**
052 * @return false|DocBlockReflection
053 */
054 public function getDocBlock()
055 {
056 if (! ($docComment = $this->getDocComment())) {
057 return false;
058 }
059
060 $docBlockReflection = new DocBlockReflection($docComment);
061
062 return $docBlockReflection;
063 }
064
065 /**
066 * @param AnnotationManager $annotationManager
067 * @return AnnotationScanner|false
068 */
069 public function getAnnotations(AnnotationManager $annotationManager)
070 {
071 if (null !== $this->annotations) {
072 return $this->annotations;
073 }
074
075 if (($docComment = $this->getDocComment()) == '') {
076 return false;
077 }
078
079 $class = $this->getDeclaringClass();
080 $cachingFileScanner = $this->createFileScanner($class->getFileName());
081 $nameInformation = $cachingFileScanner->getClassNameInformation($class->getName());
082
083 if (! $nameInformation) {
084 return false;
085 }
086
087 $this->annotations = new AnnotationScanner($annotationManager, $docComment, $nameInformation);
088
089 return $this->annotations;
090 }
091
092 /**
093 * @return string
094 */
095 public function toString()
096 {
097 return $this->__toString();
098 }
099
100 /**
101 * Creates a new FileScanner instance.
102 *
103 * By having this as a separate method it allows the method to be overridden
104 * if a different FileScanner is needed.
105 *
106 * @param string $filename
107 *
108 * @return CachingFileScanner
109 */
110 protected function createFileScanner($filename)
111 {
112 return new CachingFileScanner($filename);
113 }
114 }
115