| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 40 | protected function doHealthCheck(HealthBuilder $builder) |
||
| 41 | 9 | { |
|
| 42 | $directoryPath = $this->properties->getDirectory(); |
||
| 43 | 9 | $diskFreeInBytes = disk_free_space($directoryPath); |
|
| 44 | 9 | if ($diskFreeInBytes >= $this->properties->getThreshold()) { |
|
| 45 | 9 | $builder->up(); |
|
| 46 | 3 | } else { |
|
| 47 | 3 | $builder->down(); |
|
| 48 | 6 | } |
|
| 49 | $builder->withDetail('total', disk_total_space($directoryPath)); |
||
| 50 | 9 | $builder->withDetail('free', $diskFreeInBytes); |
|
| 51 | 9 | $builder->withDetail('threshold', $this->properties->getThreshold()); |
|
| 52 | 9 | } |
|
| 53 | } |
||
| 54 |