BlogFeedConsumerTask   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 20
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A run() 0 7 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