BlogFeedConsumerTask::run()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 2
1
<?php
2
declare(strict_types=1);
3
4
namespace Acelaya\Website\Console\Task;
5
6
use Acelaya\Website\Feed\Service\BlogFeedConsumerInterface;
7
use Symfony\Component\Console\Input\InputInterface;
8
use Symfony\Component\Console\Output\OutputInterface;
9
10
class BlogFeedConsumerTask implements LongTaskInterface
11
{
12
    /**
13
     * @var BlogFeedConsumerInterface
14
     */
15
    private $blogFeedConsumer;
16
17
    public function __construct(BlogFeedConsumerInterface $blogFeedConsumer)
18
    {
19
        $this->blogFeedConsumer = $blogFeedConsumer;
20
    }
21
22
    public function run(InputInterface $input, OutputInterface $output)
23
    {
24
        $feed = $this->blogFeedConsumer->refreshFeed();
25
        if ($output->isVerbose()) {
26
            $output->writeln(print_r($feed, true));
27
        }
28
    }
29
}
30