Completed
Pull Request — master (#59)
by Tobias
08:06
created

AbstractStrategy::find()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

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 4
nc 2
nop 1
1
<?php
2
3
namespace Http\Discovery\Strategy;
4
5
/**
6
 *
7
 *
8
 * @author Tobias Nyholm <[email protected]>
9
 */
10
abstract class AbstractStrategy implements DiscoveryStrategy
11
{
12
    protected static $classes = [];
13
14
    /**
15
     * {@inheritdoc}
16
     */
17
    public static function find($type)
18
    {
19
        if (isset(static::$classes[$type])) {
20
            return static::$classes[$type];
21
        }
22
23
        return [];
24
    }
25
}