Passed
Push — master ( 27a3a0...89f0ba )
by Dawid
03:11
created

ApiVersionSetEvent   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 23
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getApiVersion() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Spiechu\SymfonyCommonsBundle\Event\ApiVersion;
6
7
use Spiechu\SymfonyCommonsBundle\Annotation\Controller\ApiVersion;
8
use Symfony\Component\EventDispatcher\Event;
9
10
class ApiVersionSetEvent extends Event
11
{
12
    /**
13
     * @var string
14
     */
15
    protected $apiVersion;
16
17
    /**
18
     * @param ApiVersion $apiVersion
19
     */
20 9
    public function __construct(ApiVersion $apiVersion)
21
    {
22 9
        $this->apiVersion = $apiVersion->getApiVersion();
23 9
    }
24
25
    /**
26
     * @return string
27
     */
28 9
    public function getApiVersion(): string
29
    {
30 9
        return $this->apiVersion;
31
    }
32
}
33