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

AbstractContext::fillObject()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 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