| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| 1 | <?php |
||
| 25 | public function createRule( |
||
| 26 | $ruleName, |
||
| 27 | $config, |
||
| 28 | $params, |
||
| 29 | ValidationProviderInterface $validationProvider |
||
| 30 | ) { |
||
| 31 | $ruleName = ucfirst($ruleName); |
||
| 32 | |||
| 33 | if (!file_exists(__DIR__.'/../Rules/'.$ruleName.'.php')) { |
||
| 34 | trigger_error('Such rule doesn\'t exists: '.$ruleName, E_USER_ERROR); |
||
| 35 | } |
||
| 36 | |||
| 37 | $class = 'TheSupportGroup\\Common\\Validator\\Rules\\'.$ruleName; |
||
| 38 | $ruleInstance = new $class($config, $validationProvider); |
||
| 39 | $ruleInstance->setParams($params); |
||
| 40 | |||
| 41 | return $ruleInstance; |
||
| 42 | } |
||
| 43 | } |
||
| 44 |
This check looks for the generic type
arrayas a return type and suggests a more specific type. This type is inferred from the actual code.