| Total Complexity | 5 |
| Total Lines | 30 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | class PipelineBuilder implements PipelineBuilderContract |
||
| 10 | { |
||
| 11 | private $filterDict = []; |
||
| 12 | |||
| 13 | public function registerFilter(FilterContract $filter) : PipelineBuilderContract |
||
| 14 | { |
||
| 15 | $name = $this->detectName($filter); |
||
| 16 | $this->filterDict[$name] = $filter; |
||
| 17 | return $this; |
||
| 18 | } |
||
| 19 | |||
| 20 | public function make($filterNames){ |
||
| 21 | $filters = array_map(function($name) { |
||
| 22 | if (is_string($name)) { |
||
| 23 | return $this->filterDict[$name]; |
||
| 24 | } else { |
||
| 25 | return $name; |
||
| 26 | } |
||
| 27 | }, $filterNames); |
||
| 28 | |||
| 29 | return new Pipeline($filters); |
||
| 30 | } |
||
| 31 | |||
| 32 | private function detectName(FilterContract $filter) { |
||
| 35 | } |
||
| 36 | |||
| 37 | private function getClassName($obj) { |
||
| 39 | } |
||
| 40 | } |