Conditions | 8 |
Paths | 16 |
Total Lines | 26 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
7 | public function transform($attribute) |
||
8 | { |
||
9 | foreach ($this->getRefProperties() as $refProp) { |
||
10 | $transformer = $this->reader->getPropertyAnnotation($refProp, Transformer::class); |
||
|
|||
11 | if (null === $transform) { |
||
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) { |
||
21 | $m3u8->setReader($this->reader); |
||
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 | |||
38 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVar
assignment in line 1 and the$higher
assignment in line 2 are dead. The first because$myVar
is never used and the second because$higher
is always overwritten for every possible time line.