| Conditions | 3 |
| Paths | 3 |
| Total Lines | 21 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | 32 | public function validateParameters( |
|
| 21 | $contextId, |
||
| 22 | array &$config |
||
| 23 | ) { |
||
| 24 | 32 | if (isset($config[AbstractContextCompilerPass::CLASS_PARAMETER])) { |
|
| 25 | 27 | return true; |
|
| 26 | } |
||
| 27 | |||
| 28 | 17 | if (isset($config[AbstractContextCompilerPass::SERVICE_PARAMETER])) { |
|
| 29 | 16 | return true; |
|
| 30 | } |
||
| 31 | |||
| 32 | 1 | throw new InvalidDefinitionException(sprintf( |
|
| 33 | 'You have to specify "%s" or "%s" parameters for %s '. |
||
| 34 | 1 | 'in searching context "%s".', |
|
| 35 | 1 | AbstractContextCompilerPass::CLASS_PARAMETER, |
|
| 36 | 1 | AbstractContextCompilerPass::SERVICE_PARAMETER, |
|
| 37 | 1 | AbstractContextCompilerPass::CRITERIA_COLLECTION_PARAMETER, |
|
| 38 | $contextId |
||
| 39 | )); |
||
| 40 | } |
||
| 41 | } |
||
| 42 |