Passed
Pull Request — master (#1361)
by
unknown
02:46
created

Semver   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace JMS\Serializer\Annotation;
6
7
use Composer\Semver\Semver as ComposerSemver;
8
9
/**
10
 * @Annotation
11
 * @Target({"PROPERTY", "METHOD", "ANNOTATION"})
12
 */
13
#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::TARGET_PROPERTY)]
14
final class Semver extends Version
15
{
16
    public function __construct($values = [], ?string $version = null)
17
    {
18
        if (!class_exists(ComposerSemver::class)) {
19
            throw new \LogicException(sprintf('composer/semver must be installed to use "%s".', self::class));
20
        }
21
22
        parent::__construct($values, $version);
23
    }
24
}
25