Passed
Push — master ( 81d3f9...4ab6f6 )
by Gabriel
11:06
created

PropertiesFactory::forDefinition()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 8
rs 10
cc 1
nc 1
nop 3
1
<?php
2
3
namespace ByTIC\Models\SmartProperties\Properties;
4
5
use ByTIC\Models\SmartProperties\Properties\AbstractProperty\Generic as Property;
6
7
/**
8
 * Class PropertiesFactory
9
 * @package ByTIC\Models\SmartProperties\Properties
10
 */
11
class PropertiesFactory
12
{
13
    public static function forDefinition($definition, $className, $baseNamespace)
14
    {
15
        $object = new $className();
16
        /** @var Property $object */
17
        $object->setManager($definition->getManager());
18
        $object->setField($definition->getField());
19
        $object->setNamespace($baseNamespace);
20
        return $object;
21
    }
22
}
23