Application::getCommandName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 5
rs 9.4285
1
<?php namespace Simondubois\UnsplashDownloader;
2
3
use Symfony\Component\Console\Application as SymfonyApplication;
4
use Symfony\Component\Console\Input\InputInterface;
5
6
/**
7
 * An Application is the container for a collection of commands.
8
 * It is the main entry point of a Console application.
9
 * This class is optimized for a standard CLI environment.
10
 * @codeCoverageIgnore
11
 */
12
class Application extends SymfonyApplication
13
{
14
    /**
15
     * Gets the name of the command based on input.
16
     * @param InputInterface $input The input interface
17
     * @return string The command name
18
     */
19
    public function getCommandName(InputInterface $input)
20
    {
21
        // This should return the name of your command.
22
        return 'unsplash-downloader';
23
    }
24
25
    /**
26
     * Gets the InputDefinition related to this Application.
27
     * Overridden so that the application doesn't expect the command
28
     * name to be the first argument.
29
     * @return \Symfony\Component\Console\Input\InputDefinition The InputDefinition instance
30
     */
31
    public function getDefinition()
32
    {
33
        $inputDefinition = parent::getDefinition();
34
        // clear out the normal first argument, which is the command name
35
        $inputDefinition->setArguments();
36
37
        return $inputDefinition;
38
    }
39
}
40