Farm   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 15
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 8 2
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
}