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

PropertiesFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A forDefinition() 0 8 1
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