| 1 | <?php |
||
| 13 | class CompositeHealthIndicator implements HealthIndicatorInterface |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * @var HealthIndicatorInterface[] |
||
| 17 | */ |
||
| 18 | private $indicators; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @var HealthAggregatorInterface |
||
| 22 | */ |
||
| 23 | private $healthAggregator; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Create a new CompositeHealthIndicator from the specified indicators. |
||
| 27 | * |
||
| 28 | * @param HealthAggregatorInterface $healthAggregator |
||
| 29 | * @param HealthIndicatorInterface[] $indicators |
||
| 30 | */ |
||
| 31 | 15 | public function __construct(HealthAggregatorInterface $healthAggregator, array $indicators = array()) |
|
| 38 | |||
| 39 | /** |
||
| 40 | * @param string $name |
||
| 41 | * @param HealthIndicatorInterface $indicator |
||
| 42 | */ |
||
| 43 | 12 | public function addHealthIndicator($name, HealthIndicatorInterface $indicator) |
|
| 47 | |||
| 48 | /** |
||
| 49 | * Return an indication of health. |
||
| 50 | * |
||
| 51 | * @return Health |
||
| 52 | */ |
||
| 53 | 15 | public function health() |
|
| 62 | } |
||
| 63 |