GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

PredefinedHydratorGenerationCommand   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A configure() 0 4 1
A execute() 0 8 2
1
<?php
2
3
namespace RemiSan\Serializer\Console;
4
5
use RemiSan\Serializer\Hydrator\HydratorFactory;
6
use Symfony\Component\Console\Command\Command;
7
use Symfony\Component\Console\Input\InputInterface;
8
use Symfony\Component\Console\Output\OutputInterface;
9
10
/**
11
 * @codeCoverageIgnore
12
 */
13
class PredefinedHydratorGenerationCommand extends Command
14
{
15
    /**
16
     * @var HydratorFactory
17
     */
18
    private $hydratorFactory;
19
20
    /**
21
     * @var string[]
22
     */
23
    private $classes;
24
25
    /**
26
     * Constructor.
27
     *
28
     * @param HydratorFactory $hydratorFactory
29
     * @param string[]        $classes
30
     * @param string          $name
31
     */
32
    public function __construct(HydratorFactory $hydratorFactory, array $classes, $name = null)
33
    {
34
        $this->hydratorFactory = $hydratorFactory;
35
        $this->classes = $classes;
36
37
        parent::__construct($name);
38
    }
39
40
    /**
41
     * Configures the command.
42
     */
43
    protected function configure()
44
    {
45
        $this->setDescription('Generates hydrators cache files');
46
    }
47
48
    /**
49
     * Code executed when command invoked.
50
     *
51
     * @param InputInterface  $input
52
     * @param OutputInterface $output
53
     */
54
    protected function execute(InputInterface $input, OutputInterface $output)
55
    {
56
        foreach ($this->classes as $className) {
57
            $output->write('Generating "<info>' . $className . '</info>" ');
58
            $this->hydratorFactory->getHydratorClassName($className);
59
            $output->writeLn('<comment>Done</comment>');
60
        }
61
    }
62
}
63