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.
Completed
Push — master ( dc1b83...0c9d28 )
by Bruno
02:10
created

PlaceholdersController   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A configure() 0 4 1
A execute() 0 6 2
1
<?php
2
namespace Ciandt\Behat\PlaceholdersExtension\Cli;
3
4
use Behat\Testwork\Cli\Controller;
5
use Symfony\Component\Console\Command\Command as SymfonyCommand;
6
use Symfony\Component\Console\Input\InputArgument;
7
use Symfony\Component\Console\Input\InputInterface;
8
use Symfony\Component\Console\Input\InputOption;
9
use Symfony\Component\Console\Output\OutputInterface;
10
use Ciandt\Behat\PlaceholdersExtension\Tester\PlaceholdersReplacer;
11
12
final class PlaceholdersController implements Controller
13
{
14
15
    private $placeholderReplacer;
16
17
    function __construct(PlaceholdersReplacer $placeholderReplacer)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
18
    {
19
        $this->placeholderReplacer = $placeholderReplacer;
20
    }
21
22
    /**
23
     * Adds the optional --environment / -e option to the Behat CLI
24
     *
25
     * @param SymfonyCommand $command
26
     */
27
    public function configure(SymfonyCommand $command)
28
    {
29
        $command->addOption('environment', 'e', InputArgument::OPTIONAL, 'Set the environment to run the features', 'default');
30
    }
31
32
    /**
33
     * Gets the environment option and pass it on to the PlaceholdersReplacer
34
     * 
35
     * @param InputInterface $input
36
     * @param OutputInterface $output
37
     * @todo pass environment to StepTester
38
     */
39
    public function execute(InputInterface $input, OutputInterface $output)
40
    {
41
        if ($input->getOption('environment')) {
42
            $this->placeholderReplacer->setEnvironment($input->getOption('environment'));
43
        }
44
    }
45
}
46