Completed
Pull Request — 1.5 (#758)
by Paweł
11:13
created

AbstractContext   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 10
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A fillObject() 0 7 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SWP\Behat\Contexts;
6
7
use Symfony\Component\PropertyAccess\PropertyAccess;
8
9
abstract class AbstractContext
10
{
11
    protected function fillObject($object, array $data)
12
    {
13
        $propertyAccessor = PropertyAccess::createPropertyAccessor();
14
        foreach ($data as $column => $value) {
15
            $propertyAccessor->setValue($object, $column, $value);
16
        }
17
    }
18
}
19