| Conditions | 5 |
| Paths | 6 |
| Total Lines | 24 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 8 | ||
| Bugs | 1 | Features | 2 |
| 1 | <?php |
||
| 24 | public static function resolveRef($fields, $refMethods) |
||
| 25 | { |
||
| 26 | $records = []; |
||
| 27 | $functions = self::prepareFunctionNames($refMethods); |
||
| 28 | |||
| 29 | foreach ($fields as $record) { |
||
| 30 | $orgRec = $record; |
||
| 31 | foreach ($functions as $function) { |
||
| 32 | if (method_exists($record, $function)) { |
||
| 33 | $record = $record->$function(); |
||
| 34 | } else { |
||
| 35 | throw new XDynamicKeyException( |
||
| 36 | 'x-dynamic-key ref-field could not be resolved: '.$function |
||
| 37 | ); |
||
| 38 | } |
||
| 39 | } |
||
| 40 | |||
| 41 | if ($record !== null) { |
||
| 42 | $records[$record->getId()] = $orgRec; |
||
| 43 | } |
||
| 44 | } |
||
| 45 | |||
| 46 | return $records; |
||
| 47 | } |
||
| 48 | |||
| 67 |
This check examines a number of code elements and verifies that they conform to the given naming conventions.
You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.