ConnectionHelper   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 5
c 1
b 0
f 0
dl 0
loc 29
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getName() 0 3 1
A getConnection() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Arp\LaminasDoctrine\Console\Helper;
6
7
use Doctrine\DBAL\Connection;
8
use Symfony\Component\Console\Helper\Helper;
9
10
/**
11
 * @author  Alex Patterson <[email protected]>
12
 * @package Arp\LaminasDoctrine\Console\Helper
13
 */
14
final class ConnectionHelper extends Helper
15
{
16
    /**
17
     * @var Connection
18
     */
19
    private Connection $connection;
20
21
    /**
22
     * @param Connection $connection
23
     */
24
    public function __construct(Connection $connection)
25
    {
26
        $this->connection = $connection;
27
    }
28
29
    /**
30
     * @return string
31
     */
32
    public function getName(): string
33
    {
34
        return 'connection';
35
    }
36
37
    /**
38
     * @return Connection
39
     */
40
    public function getConnection(): Connection
41
    {
42
        return $this->connection;
43
    }
44
}
45