| Conditions | 3 |
| Paths | 3 |
| Total Lines | 17 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | 3 | public function extractFromRuleXmlElement(SimpleXMLElement $ruleElement) : array |
|
| 15 | { |
||
| 16 | 3 | if (!isset($ruleElement->properties)) { |
|
| 17 | 1 | return []; |
|
| 18 | } |
||
| 19 | |||
| 20 | 2 | $sniffCode = (string) $ruleElement['ref']; |
|
| 21 | |||
| 22 | 2 | $customPropertyValues = []; |
|
| 23 | 2 | foreach ($ruleElement->properties->property as $property) { |
|
| 24 | 2 | $name = (string) $property['name']; |
|
| 25 | 2 | $value = $this->resolveValue($property); |
|
| 26 | 2 | $customPropertyValues[$sniffCode]['properties'][$name] = $value; |
|
| 27 | } |
||
| 28 | |||
| 29 | 2 | return $customPropertyValues; |
|
| 30 | } |
||
| 31 | |||
| 68 |