| Conditions | 5 |
| Paths | 5 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 4 |
| CRAP Score | 9.2876 |
| Changes | 1 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 19 | 12 | public function check(Resource $resource) |
|
| 20 | { |
||
| 21 | 12 | foreach ($resource->properties() as $key => $value) { |
|
| 22 | 8 | if (isset($resource->rewrites()[$key])) { |
|
| 23 | $when = $resource->rewrites()[$key]['when']; |
||
| 24 | $set = $resource->rewrites()[$key]['set']; |
||
| 25 | |||
| 26 | if (isset($when['greater_than'])) { |
||
| 27 | if ($resource->get($key) > $resource->get($when['greater_than'])) { |
||
| 28 | $resource->set($key, $resource->get($set['equals_to'])); |
||
| 29 | } |
||
| 30 | } |
||
| 31 | } |
||
| 32 | } |
||
| 33 | 12 | } |
|
| 34 | } |
||
| 35 |