Completed
Push — master ( 06fafe...34abd7 )
by Marcos Sigueros
14:42
created

Farm::create()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 8
rs 9.4285
cc 2
eloc 5
nc 2
nop 1
1
<?php
2
3
namespace Cowsayphp;
4
5
class Farm
6
{
7
    /**
8
     * @param $animal
9
     * @return AnimalInterface
10
     */
11
    public static function create($animal)
12
    {
13
        $result = null;
14
        if(class_exists($animal)) {
15
            $result = new $animal;
16
        }
17
        return $result;
18
    }
19
}