InfoCommand   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 26
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 4 1
A execute() 0 6 1
1
<?php
2
3
/**
4
 * @file InfoCommand.php
5
 * @brief This file contains the InfoCommand class.
6
 * @details
7
 * @author Filippo F. Fadda
8
 */
9
10
11
namespace EoC\CLI\Command;
12
13
14
use Symfony\Component\Console\Input\InputInterface;
15
use Symfony\Component\Console\Output\OutputInterface;
16
17
18
/**
19
 * @brief Displays information about the selected database.
20
 * @nosubgrouping
21
 */
22
class InfoCommand extends AbstractCommand {
23
24
25
  /**
26
   * @brief Configures the command.
27
   */
28
  protected function configure() {
29
    $this->setName("info");
30
    $this->setDescription("Displays information about the selected database");
31
  }
32
33
34
  /**
35
   * @brief Executes the command.
36
   * @param[in] InputInterface $input The input interface
37
   * @param[in] OutputInterface $output The output interface
38
   * @retval string Information about current database.
39
   */
40
  protected function execute(InputInterface $input, OutputInterface $output) {
41
    $couch = $this->getConnection();
42
43
    echo "[database]".PHP_EOL;
44
    echo $couch->getDbInfo($this->getDatabase());
45
  }
46
47
}