Passed
Push — master ( fcd681...95b3ba )
by Ryan
17:12 queued 03:45
created

sandbox.php (22 issues)

1
#! /usr/bin/env php
2
<?php
3
require_once __DIR__ . '/vendor/autoload.php';
4
5
use GuzzleHttp\Psr7;
6
use Monolog\Handler\ErrorLogHandler;
7
use Monolog\Logger;
8
use Psr\Log\LogLevel;
9
use SimplePie\Configuration;
10
use SimplePie\Container;
11
use SimplePie\Enum\DateFormat;
12
use SimplePie\HandlerStack;
13
use SimplePie\Middleware\Xml\Atom;
14
use SimplePie\SimplePie;
15
16
//------------------------------------------------------------------------------
17
18
$container = new Container();
19
20
$container['simplepie.logger'] = function () {
21
    $logger = new Logger('SimplePie');
22
    $logger->pushHandler(new ErrorLogHandler(
23
        ErrorLogHandler::OPERATING_SYSTEM,
24
        LogLevel::DEBUG,
0 ignored issues
show
Psr\Log\LogLevel::DEBUG of type string is incompatible with the type integer expected by parameter $level of Monolog\Handler\ErrorLogHandler::__construct(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

24
        /** @scrutinizer ignore-type */ LogLevel::DEBUG,
Loading history...
25
        true,
26
        false
27
    ));
28
29
    return $logger;
30
};
31
32
$container['simplepie.middleware'] = function () {
33
    return $stack = (new HandlerStack())
0 ignored issues
show
The assignment to $stack is dead and can be removed.
Loading history...
34
        ->append(new Atom(), 'atom')
35
    ;
36
};
37
38
Configuration::setContainer($container);
39
40
//------------------------------------------------------------------------------
41
42
$simplepie = new SimplePie();
43
44
$stream = Psr7\stream_for(file_get_contents(__DIR__ . '/releases.atom'));
45
$parser = $simplepie->parseXml($stream, true);
46
47
$feed = $parser->getFeed();
48
49
echo '--------------------------------------------------------------------------' . PHP_EOL;
50
51
echo 'feed->getId: ' . $feed->getId('atom10') . PHP_EOL;
0 ignored issues
show
Are you sure $feed->getId('atom10') of type SimplePie\Type\Node|DateTime can be used in concatenation? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

51
echo 'feed->getId: ' . /** @scrutinizer ignore-type */ $feed->getId('atom10') . PHP_EOL;
Loading history...
The method getId() does not exist on SimplePie\Type\Feed. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

51
echo 'feed->getId: ' . $feed->/** @scrutinizer ignore-call */ getId('atom10') . PHP_EOL;
Loading history...
52
echo 'feed->getLang: ' . $feed->getLang() . PHP_EOL;
0 ignored issues
show
The method getLang() does not exist on SimplePie\Type\Feed. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

52
echo 'feed->getLang: ' . $feed->/** @scrutinizer ignore-call */ getLang() . PHP_EOL;
Loading history...
Are you sure $feed->getLang() of type SimplePie\Type\Node|DateTime can be used in concatenation? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

52
echo 'feed->getLang: ' . /** @scrutinizer ignore-type */ $feed->getLang() . PHP_EOL;
Loading history...
53
echo 'feed->getLang->getSerialization: ' . $feed->getLang()->getSerialization() . PHP_EOL;
0 ignored issues
show
The method getSerialization() does not exist on DateTime. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

53
echo 'feed->getLang->getSerialization: ' . $feed->getLang()->/** @scrutinizer ignore-call */ getSerialization() . PHP_EOL;

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
54
echo 'feed->getLanguage: ' . $feed->getLanguage() . PHP_EOL;
0 ignored issues
show
Are you sure $feed->getLanguage() of type SimplePie\Type\Node|DateTime can be used in concatenation? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

54
echo 'feed->getLanguage: ' . /** @scrutinizer ignore-type */ $feed->getLanguage() . PHP_EOL;
Loading history...
The method getLanguage() does not exist on SimplePie\Type\Feed. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

54
echo 'feed->getLanguage: ' . $feed->/** @scrutinizer ignore-call */ getLanguage() . PHP_EOL;
Loading history...
55
echo 'feed->getLanguage->getSerialization: ' . $feed->getLanguage()->getSerialization() . PHP_EOL;
56
echo 'feed->getRights: ' . $feed->getRights() . PHP_EOL;
0 ignored issues
show
The method getRights() does not exist on SimplePie\Type\Feed. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

56
echo 'feed->getRights: ' . $feed->/** @scrutinizer ignore-call */ getRights() . PHP_EOL;
Loading history...
Are you sure $feed->getRights() of type SimplePie\Type\Node|DateTime can be used in concatenation? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

56
echo 'feed->getRights: ' . /** @scrutinizer ignore-type */ $feed->getRights() . PHP_EOL;
Loading history...
57
echo 'feed->getSubtitle: ' . $feed->getSubtitle() . PHP_EOL;
0 ignored issues
show
The method getSubtitle() does not exist on SimplePie\Type\Feed. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

57
echo 'feed->getSubtitle: ' . $feed->/** @scrutinizer ignore-call */ getSubtitle() . PHP_EOL;
Loading history...
Are you sure $feed->getSubtitle() of type SimplePie\Type\Node|DateTime can be used in concatenation? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

57
echo 'feed->getSubtitle: ' . /** @scrutinizer ignore-type */ $feed->getSubtitle() . PHP_EOL;
Loading history...
58
echo 'feed->getSummary: ' . $feed->getSummary() . PHP_EOL;
0 ignored issues
show
Are you sure $feed->getSummary() of type SimplePie\Type\Node|DateTime can be used in concatenation? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

58
echo 'feed->getSummary: ' . /** @scrutinizer ignore-type */ $feed->getSummary() . PHP_EOL;
Loading history...
The method getSummary() does not exist on SimplePie\Type\Feed. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

58
echo 'feed->getSummary: ' . $feed->/** @scrutinizer ignore-call */ getSummary() . PHP_EOL;
Loading history...
59
echo 'feed->getTitle: ' . $feed->getTitle() . PHP_EOL;
0 ignored issues
show
Are you sure $feed->getTitle() of type SimplePie\Type\Node|DateTime can be used in concatenation? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

59
echo 'feed->getTitle: ' . /** @scrutinizer ignore-type */ $feed->getTitle() . PHP_EOL;
Loading history...
The method getTitle() does not exist on SimplePie\Type\Feed. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

59
echo 'feed->getTitle: ' . $feed->/** @scrutinizer ignore-call */ getTitle() . PHP_EOL;
Loading history...
60
61
echo '--------------------------------------------------------------------------' . PHP_EOL;
62
63
echo 'feed->getPublished: ' . $feed->getPublished()
0 ignored issues
show
The method getPublished() does not exist on SimplePie\Type\Feed. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

63
echo 'feed->getPublished: ' . $feed->/** @scrutinizer ignore-call */ getPublished()
Loading history...
64
    ->setTimezone(new \DateTimeZone('America/New_York'))
0 ignored issues
show
The method setTimezone() does not exist on SimplePie\Type\Node. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

64
    ->/** @scrutinizer ignore-call */ setTimezone(new \DateTimeZone('America/New_York'))

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
65
    ->format(DateFormat::RSS20) . PHP_EOL;
66
67
echo 'feed->getPubDate: ' . $feed->getPubDate()
0 ignored issues
show
The method getPubDate() does not exist on SimplePie\Type\Feed. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

67
echo 'feed->getPubDate: ' . $feed->/** @scrutinizer ignore-call */ getPubDate()
Loading history...
68
    ->format(DateFormat::RSS20) . PHP_EOL;
0 ignored issues
show
The method format() does not exist on SimplePie\Type\Node. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

68
    ->/** @scrutinizer ignore-call */ format(DateFormat::RSS20) . PHP_EOL;

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
69
70
echo 'feed->getUpdated: ' . $feed->getUpdated()
0 ignored issues
show
The method getUpdated() does not exist on SimplePie\Type\Feed. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

70
echo 'feed->getUpdated: ' . $feed->/** @scrutinizer ignore-call */ getUpdated()
Loading history...
71
    ->setTimezone(new \DateTimeZone('America/Los_Angeles'))
72
    ->format(DateFormat::RSS20) . PHP_EOL;
73
74
echo '--------------------------------------------------------------------------' . PHP_EOL;
75
76
echo 'feed->getGenerator: ' . $feed->getGenerator() . PHP_EOL;
77
echo 'feed->getGenerator->getName: ' . $feed->getGenerator()->getName() . PHP_EOL;
78
echo 'feed->getGenerator->getUri: ' . $feed->getGenerator()->getUri() . PHP_EOL;
79
echo 'feed->getGenerator->getVersion: ' . $feed->getGenerator()->getVersion() . PHP_EOL;
80
echo 'feed->getGenerator->getVersion->getSerialization: ' . $feed->getGenerator()->getVersion()->getSerialization() . PHP_EOL;
81
82
echo '--------------------------------------------------------------------------' . PHP_EOL;
83
print_r($feed->getRoot());
84
85
echo PHP_EOL;
86