simplepie /
simplepie-ng
| 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
Bug
introduced
by
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
|
|||||||
| 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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 |