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.

PlaceholdersController   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A configure() 0 10 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\Config\PlaceholdersRepository;
11
12
final class PlaceholdersController implements Controller
13
{
14
15
    private $placeholdersRepository;
16
17
    public function __construct(PlaceholdersRepository $placeholdersRepository)
18
    {
19
        $this->placeholdersRepository = $placeholdersRepository;
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(
30
            'environment',
31
            'e',
32
            InputArgument::OPTIONAL,
33
            'Set the environment to run the features',
34
            'default'
35
        );
36
    }
37
38
  /**
39
   * Gets the environment option and pass it on to the PlaceholdersReplacer
40
   *
41
   * @param InputInterface $input
42
   * @param OutputInterface $output
43
   * @todo pass environment to StepTester
44
   */
45
    public function execute(InputInterface $input, OutputInterface $output)
46
    {
47
        if ($input->getOption('environment')) {
48
            $this->placeholdersRepository->setEnvironment($input->getOption('environment'));
49
        }
50
    }
51
}
52