chrisyue /
php-m3u8
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
| 1 | <?php |
||
| 2 | |||
| 3 | namespace Chrisyue\PhpM3u8\M3u8\PropertyReader; |
||
| 4 | |||
| 5 | use Doctrine\Common\Annotations\AnnotationRegistry; |
||
| 6 | use Doctrine\Common\Annotations\AnnotationReader; |
||
| 7 | use Chrisyue\PhpM3u8\M3u8\Core\CoreInterface; |
||
| 8 | |||
| 9 | /** |
||
| 10 | * @Annotation |
||
| 11 | */ |
||
| 12 | class Reader implements PropertyReaderInterface |
||
| 13 | { |
||
| 14 | public function read($class, $type) |
||
| 15 | { |
||
| 16 | $reader = $this->getAnnotationReader(); |
||
| 17 | $class = new \ReflectionClass($class); |
||
| 18 | |||
| 19 | $annots = []; |
||
| 20 | foreach ($class->getProperties() as $property) { |
||
| 21 | $annot = $reader->getPropertyAnnotation($property, $type); |
||
| 22 | if (null === $annot) { |
||
| 23 | continue; |
||
| 24 | } |
||
| 25 | |||
| 26 | $annots[$property->getName()] = $annot; |
||
| 27 | } |
||
| 28 | |||
| 29 | return $annots; |
||
| 30 | } |
||
| 31 | |||
| 32 | protected function getAnnotationReader() |
||
| 33 | { |
||
| 34 | static $reader; |
||
| 35 | if (null === $reader) { |
||
| 36 | AnnotationRegistry::registerLoader('class_exists'); |
||
|
0 ignored issues
–
show
|
|||
| 37 | $reader = new AnnotationReader(); |
||
| 38 | } |
||
| 39 | |||
| 40 | return $reader; |
||
| 41 | } |
||
| 42 | } |
||
| 43 |
This method has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.