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\Transformer\AnnotationReadable; |
||
| 4 | |||
| 5 | class AttributeObject implements TransformerInterface |
||
| 6 | { |
||
| 7 | public function transform($attribute) |
||
| 8 | { |
||
| 9 | foreach ($this->getRefProperties() as $refProp) { |
||
| 10 | $transformer = $this->reader->getPropertyAnnotation($refProp, Transformer::class); |
||
|
0 ignored issues
–
show
|
|||
| 11 | if (null === $transform) { |
||
|
0 ignored issues
–
show
The variable
$transform does not exist. Did you mean $transformer?
This check looks for variables that are accessed but have not been defined. It raises an issue if it finds another variable that has a similar name. The variable may have been renamed without also renaming all references. Loading history...
|
|||
| 12 | continue; |
||
| 13 | } |
||
| 14 | |||
| 15 | $value = null === $this->getResult() ? null : $refProp->getValue($this->getResult()); |
||
| 16 | if (null !== $value) { |
||
| 17 | continue; |
||
| 18 | } |
||
| 19 | |||
| 20 | if ($m3u8 instanceof ReaderAwareInterface) { |
||
|
0 ignored issues
–
show
The class
Chrisyue\PhpM3u8\Transfo...le\ReaderAwareInterface does not exist. Did you forget a USE statement, or did you not list all dependencies?
This error could be the result of: 1. Missing dependenciesPHP Analyzer uses your Are you sure this class is defined by one of your dependencies, or did you maybe
not list a dependency in either the 2. Missing use statementPHP does not complain about undefined classes in if ($x instanceof DoesNotExist) {
// Do something.
}
If you have not tested against this specific condition, such errors might go unnoticed. Loading history...
|
|||
| 21 | $m3u8->setReader($this->reader); |
||
|
0 ignored issues
–
show
|
|||
| 22 | } |
||
| 23 | |||
| 24 | $parsed = $m3u8->setStream($this->getStream())->parse()->getResult(); |
||
| 25 | if (null !== $parsed) { |
||
| 26 | is_array($value) ? $value[] = $parsed : $value = $parsed; |
||
| 27 | $refProp->setValue($this->ensureResult(), $value); |
||
| 28 | |||
| 29 | break; |
||
| 30 | } |
||
| 31 | } |
||
| 32 | } |
||
| 33 | |||
| 34 | public function reverse($object) |
||
| 35 | { |
||
| 36 | |||
| 37 | } |
||
| 38 | } |
||
| 39 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVarassignment in line 1 and the$higherassignment in line 2 are dead. The first because$myVaris never used and the second because$higheris always overwritten for every possible time line.