Passed
Push — master ( e52ce1...eef7fd )
by Ryan
13:31
created

sandbox.php (2 issues)

Labels
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
$logger = new Logger('SimplePie');
19
$logger->pushHandler(new ErrorLogHandler(
20
    ErrorLogHandler::OPERATING_SYSTEM,
21
    LogLevel::DEBUG,
22
    true,
23
    false
24
));
25
26
$middleware = (new HandlerStack())
27
    ->append(new Atom(), 'atom')
28
;
29
30
$simplepie = (new SimplePie())
31
    ->setLogger($logger)
32
    ->setMiddlewareStack($middleware)
33
;
34
35
//------------------------------------------------------------------------------
36
37
$stream = Psr7\stream_for(file_get_contents(__DIR__ . '/tests/Integration/feeds/test.atom'));
38
$parser = $simplepie->parseXml($stream, true);
39
40
$feed = $parser->getFeed();
41
42
echo '--------------------------------------------------------------------------' . PHP_EOL;
43
44
echo 'feed->getRights: ' . $feed->getRights() . PHP_EOL;
0 ignored issues
show
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

44
echo 'feed->getRights: ' . /** @scrutinizer ignore-type */ $feed->getRights() . PHP_EOL;
Loading history...
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

44
echo 'feed->getRights: ' . $feed->/** @scrutinizer ignore-call */ getRights() . PHP_EOL;
Loading history...
45
46
echo '--------------------------------------------------------------------------' . PHP_EOL;
47
48
// print_r($feed->getRoot());
49
echo PHP_EOL;
50