Passed
Push — master ( 6c9f52...4a3c11 )
by Ryan
12:25
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;
0 ignored issues
show
The type SimplePie\Container was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
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 ignore-type  annotation

21
    /** @scrutinizer ignore-type */ LogLevel::DEBUG,
Loading history...
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
45
echo '--------------------------------------------------------------------------' . PHP_EOL;
46
47
// print_r($feed->getRoot());
48
echo PHP_EOL;
49