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\Core; |
||
| 4 | |||
| 5 | use Chrisyue\PhpM3u8\Stream\StreamInterface; |
||
| 6 | use Chrisyue\PhpM3u8\M3u8\M3u8Interface; |
||
| 7 | use Chrisyue\PhpM3u8\ReaderAwareInterface; |
||
| 8 | use Chrisyue\PhpM3u8\M3u8\OptionsTrait; |
||
| 9 | |||
| 10 | abstract class AbstractAnnotationReadable extends AbstractParentCore |
||
| 11 | { |
||
| 12 | use OptionsTrait; |
||
| 13 | |||
| 14 | private $cores; |
||
| 15 | |||
| 16 | protected function getCores() |
||
| 17 | { |
||
| 18 | if (null === $this->cores) { |
||
| 19 | $this->cores = $this->options['reader']->read($this->options['class'], ChildCoreInterface::class); |
||
| 20 | uasort($this->cores, function(ChildCoreInterface $core, ChildCoreInterface $core2) { |
||
| 21 | return $core->getSequence() > $core2->getSequence(); |
||
| 22 | }); |
||
| 23 | } |
||
| 24 | |||
| 25 | return $this->cores; |
||
| 26 | } |
||
| 27 | |||
| 28 | protected function initResult() |
||
| 29 | { |
||
| 30 | return new $this->options['class']; |
||
| 31 | } |
||
| 32 | |||
| 33 | private function moveToNextLine() |
||
|
0 ignored issues
–
show
|
|||
| 34 | { |
||
| 35 | $this->getStream()->next(); |
||
| 36 | |||
| 37 | return $this->getStream()->valid(); |
||
| 38 | } |
||
| 39 | } |
||
| 40 |
Overwriting private methods is generally fine as long as you also use private visibility. It might still be preferable for understandability to use a different method name.