@@ -104,13 +104,13 @@ discard block |
||
| 104 | 104 | |
| 105 | 105 | public function __construct(\SimpleXMLElement $xmlData) |
| 106 | 106 | { |
| 107 | - if($xmlData !== null) |
|
| 107 | + if ($xmlData !== null) |
|
| 108 | 108 | { |
| 109 | 109 | foreach ($xmlData->children() as $child) |
| 110 | 110 | { |
| 111 | 111 | $name = $child->getName(); |
| 112 | 112 | $val = $child->__toString(); |
| 113 | - if($name != 'TargetValue') |
|
| 113 | + if ($name != 'TargetValue') |
|
| 114 | 114 | { |
| 115 | 115 | $this->$name = $val; |
| 116 | 116 | } |
@@ -125,15 +125,15 @@ discard block |
||
| 125 | 125 | */ |
| 126 | 126 | public static function loadRulesFromFile() |
| 127 | 127 | { |
| 128 | - $path = str_replace('src','data',__DIR__).'/rules/'; |
|
| 128 | + $path = str_replace('src', 'data', __DIR__).'/rules/'; |
|
| 129 | 129 | $files = scandir($path); |
| 130 | 130 | $rules = array(); |
| 131 | - foreach($files as $file) |
|
| 131 | + foreach ($files as $file) |
|
| 132 | 132 | { |
| 133 | - if($file != '.' && $file != '..') |
|
| 133 | + if ($file != '.' && $file != '..') |
|
| 134 | 134 | { |
| 135 | 135 | $xmlObj = simplexml_load_file($path.$file); |
| 136 | - foreach($xmlObj->children() as $rule) |
|
| 136 | + foreach ($xmlObj->children() as $rule) |
|
| 137 | 137 | { |
| 138 | 138 | $rules[] = new self($rule); |
| 139 | 139 | } |
@@ -113,9 +113,9 @@ |
||
| 113 | 113 | if($name != 'TargetValue') |
| 114 | 114 | { |
| 115 | 115 | $this->$name = $val; |
| 116 | + } else { |
|
| 117 | + $this->$name = filter_var($val, FILTER_VALIDATE_BOOLEAN); |
|
| 116 | 118 | } |
| 117 | - else |
|
| 118 | - $this->$name = filter_var($val, FILTER_VALIDATE_BOOLEAN); |
|
| 119 | 119 | } |
| 120 | 120 | } |
| 121 | 121 | } |