ApiVersionSetEvent   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 21
ccs 5
cts 5
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getApiVersion() 0 3 1
A __construct() 0 3 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
0 ignored issues
show
Deprecated Code introduced by
The class Symfony\Component\EventDispatcher\Event has been deprecated: since Symfony 4.3, use "Symfony\Contracts\EventDispatcher\Event" instead ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

10
class ApiVersionSetEvent extends /** @scrutinizer ignore-deprecated */ Event
Loading history...
11
{
12
    /**
13
     * @var string
14
     */
15
    protected $apiVersion;
16
17
    /**
18
     * @param ApiVersion $apiVersion
19
     */
20 13
    public function __construct(ApiVersion $apiVersion)
21
    {
22 13
        $this->apiVersion = $apiVersion->getApiVersion();
23 13
    }
24
25
    /**
26
     * @return string
27
     */
28 13
    public function getApiVersion(): string
29
    {
30 13
        return $this->apiVersion;
31
    }
32
}
33