public function addCheck(string $name, $check)
    {
        if (array_key_exists($name, $this->checks)) {
            throw new \Exception('Health check with name ' . $name . ' already registered');
        }

        if (!is_callable($check) && !class_exists($check)) {
            throw new \Exception('Health check must be callable object or class name');
        }

        $this->checks[$name] = $check;
    }
public function addCheck(string $name, $check)
    {
        if (array_key_exists($name, $this->checks)) {
            throw new \Exception('Health check with name ' . $name . ' already registered');
        }

        if (!is_callable($check) && !class_exists($check)) {
            throw new \Exception('Health check must be callable object or class name');
        }

        $this->checks[$name] = $check;
    }
public function addCheck ( string $ name , $ check ) { if ( array_key_exists ( $ name , $ this -> checks ) ) { throw new \ Exception ( 'Health check with name ' . $ name . ' already registered' ) ; } if ( ! is_callable ( $ check ) && ! class_exists ( $ check ) ) { throw new \ Exception ( 'Health check must be callable object or class name' ) ; } $ this -> checks [ $ name ] = $ check ; }
Add health check

@param string $name
@param {string|array|callable} $check

@throws \Exception
Add health check