Completed
Pull Request — develop (#27)
by Chris
01:52
created

Upgrade to new PHP Analysis Engine

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\MediaPlaylist;
4
use Chrisyue\PhpM3u8\Document\Rfc8216\MasterPlaylist;
5
use Chrisyue\PhpM3u8\Stream\FileStream;
6
use Chrisyue\PhpM3u8\Line\Lines;
7
use Chrisyue\PhpM3u8\PdFactory\AnnotReadablePlaylistPdFactory;
8
use Chrisyue\PhpM3u8\PropertyReader\PropertyReader;
9
use Doctrine\Common\Annotations\AnnotationReader;
10
use Doctrine\Common\Annotations\AnnotationRegistry;
11
use Chrisyue\PhpM3u8\Stream\TextStream;
12
13
error_reporting(E_ALL);
14
15
require 'vendor/autoload.php';
16
17
$textStream = new TextStream();
18
19
AnnotationRegistry::registerLoader('class_exists');
0 ignored issues
show
Deprecated Code introduced by
The method Doctrine\Common\Annotati...istry::registerLoader() has been deprecated with message: this method is deprecated and will be removed in doctrine/annotations 2.0 autoloading should be deferred to the globally registered autoloader by then. For now, use @example AnnotationRegistry::registerLoader('class_exists')

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.

Loading history...
20
$factory = new AnnotReadablePlaylistPdFactory(
21
    new PropertyReader(new AnnotationReader()),
22
    // MediaPlaylist::class
23
    MasterPlaylist::class,
24
    new Lines($textStream)
25
);
26
27
$parser = $factory->createParser();
28
// $doc = $parser->parse(new Lines(new FileStream(new \SplFileObject('test.m3u8'))));
0 ignored issues
show
Unused Code Comprehensibility introduced by
60% 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.

Loading history...
29
$doc = $parser->parse(new Lines(new FileStream(new \SplFileObject('test2.m3u8'))));
30
31
var_export($doc);
32
33
$dumper = $factory->createDumper();
34
$dumper->dump($doc);
35
36
echo $textStream;
37