| Conditions | 2 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | 5 | public function add(AbstractMergeSourceDetector $merge_source_detector) |
|
| 33 | { |
||
| 34 | 5 | $weight = $merge_source_detector->getWeight(); |
|
| 35 | |||
| 36 | 5 | if ( array_key_exists($weight, $this->_detectors) ) { |
|
| 37 | 1 | throw new \InvalidArgumentException('Another detector with same weight is already added.'); |
|
| 38 | } |
||
| 39 | |||
| 40 | 5 | $this->_detectors[$weight] = $merge_source_detector; |
|
| 41 | 5 | krsort($this->_detectors, SORT_NUMERIC); |
|
| 42 | } |
||
| 65 |