DatabaseField::__construct()   A
last analyzed

Complexity

Conditions 3
Paths 4

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.9666
c 0
b 0
f 0
cc 3
nc 4
nop 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace HDNET\Autoloader\Annotation;
6
7
/**
8
 * @Annotation
9
 * @Target({"PROPERTY"})
10
 */
11
class DatabaseField
12
{
13
    /**
14
     * @var string
15
     */
16
    public $type;
17
    /**
18
     * @var string
19
     */
20
    public $sql;
21
22
    /**
23
     * @throws \InvalidArgumentException
24
     */
25
    public function __construct(array $values)
26
    {
27
        if (isset($values['type'])) {
28
            $this->type = $values['type'];
29
        }
30
        if (isset($values['sql'])) {
31
            $this->sql = $values['sql'];
32
        }
33
    }
34
}
35