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