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; |
||||||
0 ignored issues
–
show
|
|||||||
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, |
||||||
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
![]() |
|||||||
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
![]() 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
![]() |
|||||||
45 | |||||||
46 | echo '--------------------------------------------------------------------------' . PHP_EOL; |
||||||
47 | |||||||
48 | // print_r($feed->getRoot()); |
||||||
49 | echo PHP_EOL; |
||||||
50 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths