Discriminator::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 1 Features 1
Metric Value
cc 1
eloc 1
c 2
b 1
f 1
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
4
namespace Apie\OpenapiSchema\Spec;
5
6
use Apie\CompositeValueObjects\CompositeValueObjectTrait;
7
use Apie\OpenapiSchema\Map\DiscriminatorMapping;
8
use Apie\ValueObjects\ValueObjectInterface;
9
10
/**
11
 * @see https://swagger.io/specification/#discriminator-object
12
 */
13
class Discriminator implements ValueObjectInterface
14
{
15
    use CompositeValueObjectTrait;
0 ignored issues
show
Bug introduced by
The trait Apie\CompositeValueObjec...mpositeValueObjectTrait requires the property $name which is not provided by Apie\OpenapiSchema\Spec\Discriminator.
Loading history...
16
17
    /**
18
     * @var string
19
     */
20
    private $propertyName;
21
22
    /**
23
     * @var null|DiscriminatorMapping
24
     */
25
    private $mapping;
0 ignored issues
show
introduced by
The private property $mapping is not used, and could be removed.
Loading history...
26
27
    public function __construct(string $propertyName)
28
    {
29
        $this->propertyName = $propertyName;
30
    }
31
}
32