Passed
Pull Request — master (#405)
by Kirill
08:21 queued 04:03
created

DoctrineLikeArrayConstructorFixture   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 14
rs 10
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 3
1
<?php
2
3
/**
4
 * This file is part of Spiral Framework package.
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
declare(strict_types=1);
11
12
namespace Spiral\Tests\Attributes\Instantiator\Fixtures;
13
14
class DoctrineLikeArrayConstructorFixture
15
{
16
    public $a;
17
    public $b;
18
    public $c;
19
20
    /**
21
     * @param array $values
22
     */
23
    public function __construct(array $values)
24
    {
25
        foreach ($values as $name => $value) {
26
            if (\property_exists($this, $name)) {
27
                $this->$name = $value;
28
            }
29
        }
30
    }
31
}
32