Property::set()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 3
crap 2
1
<?php
2
3
namespace Kunstmaan\FixturesBundle\Populator\Methods;
4
5
class Property implements MethodInterface
6
{
7
    /**
8
     * {@inheritdoc}
9
     */
10
    public function canSet($object, $property, $value)
11
    {
12
        return property_exists($object, $property);
13
    }
14
15
    /**
16
     * {@inheritdoc}
17
     */
18
    public function set($object, $property, $value)
19
    {
20
        $refl = new \ReflectionProperty($object, $property);
21
        $refl->setAccessible(true);
22
        $refl->setValue($object, $value);
23
    }
24
}
25