These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | use Chrisyue\PhpM3u8\Document\Rfc8216\MasterPlaylist; |
||
4 | use Chrisyue\PhpM3u8\Document\Rfc8216\MediaPlaylist; |
||
5 | use Chrisyue\PhpM3u8\M3u8\Core\Playlist; |
||
6 | use Chrisyue\PhpM3u8\M3u8\PropertyReader\Reader; |
||
7 | use Chrisyue\PhpM3u8\Stream\FileStream; |
||
8 | use Chrisyue\PhpM3u8\Stream\TextStream; |
||
9 | use Chrisyue\PhpM3u8\M3u8\Transformer\TagInfo; |
||
10 | use Chrisyue\PhpM3u8\M3u8\Lines\Lines; |
||
11 | |||
12 | require 'vendor/autoload.php'; |
||
13 | |||
14 | $tagInfo = new TagInfo(); |
||
15 | |||
16 | // $lines = new Lines(new FileStream(new \SplFileObject('test.m3u8')), $tagInfo); |
||
0 ignored issues
–
show
|
|||
17 | $lines = new Lines(new FileStream(new \SplFileObject('test2.m3u8')), $tagInfo); |
||
18 | |||
19 | $phpM3u8 = new Playlist(); |
||
20 | // $phpM3u8->class = MediaPlaylist::class; |
||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
37% of this comment could be valid code. Did you maybe forget this after debugging?
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it. The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production. This check looks for comments that seem to be mostly valid code and reports them. ![]() |
|||
21 | $phpM3u8->class = MasterPlaylist::class; |
||
22 | $phpM3u8->reader = new Reader(); |
||
0 ignored issues
–
show
It seems like
new \Chrisyue\PhpM3u8\M3u8\PropertyReader\Reader() of type object<Chrisyue\PhpM3u8\...\PropertyReader\Reader> is incompatible with the declared type object<Chrisyue\PhpM3u8\...ropertyReaderInterface> of property $reader .
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property. Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property.. ![]() |
|||
23 | $phpM3u8->setLines($lines); |
||
24 | |||
25 | $result = $phpM3u8->parse(); |
||
26 | var_export($result); |
||
27 | |||
28 | $text = new TextStream(); |
||
29 | $lines = new Lines($text, $tagInfo); |
||
30 | $phpM3u8->setLines($lines); |
||
31 | $phpM3u8->dump($result); |
||
32 | |||
33 | echo $text; |
||
34 |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.