1 | <?php |
||
14 | final class HttplugFactory |
||
15 | { |
||
16 | /** |
||
17 | * @var Discovery |
||
18 | */ |
||
19 | private $discovery; |
||
20 | |||
21 | /** |
||
22 | * @param Discovery $discovery |
||
23 | */ |
||
24 | public function __construct(Discovery $discovery) |
||
28 | |||
29 | /** |
||
30 | * Creates a class of type. |
||
31 | * |
||
32 | * @param string $type |
||
33 | * |
||
34 | * @return object |
||
35 | */ |
||
36 | public function find($type) |
||
43 | |||
44 | /** |
||
45 | * Finds a class of type and resolves optional dependency conditions. |
||
46 | * |
||
47 | * @param string $type |
||
48 | * |
||
49 | * @return string |
||
50 | * |
||
51 | * @throws \RuntimeException if no class is found. |
||
52 | */ |
||
53 | private function findOneByType($type) |
||
75 | |||
76 | /** |
||
77 | * Evaulates conditions to boolean. |
||
78 | * |
||
79 | * @param mixed $condition |
||
80 | * |
||
81 | * @return bool |
||
82 | * |
||
83 | * TODO: review this method |
||
84 | */ |
||
85 | protected function evaluateCondition($condition) |
||
107 | } |
||
108 |