BrowscapPHP\Exception\FetcherException::httpError PHP Méthode

httpError() public static méthode

public static httpError ( string $resource, string $error ) : FetcherException
$resource string
$error string
Résultat FetcherException
    public static function httpError($resource, $error)
    {
        return new static(sprintf('Could not fetch HTTP resource "%s": %s', $resource, $error));
    }

Usage Example

 /**
  *
  */
 public function testHttpError()
 {
     /** @var \BrowscapPHP\Exception\FetcherException $exception */
     $exception = FetcherException::httpError('http://example.org', 'Uri not reachable');
     self::assertInstanceOf('\\BrowscapPHP\\Exception\\FetcherException', $exception);
     self::assertSame('Could not fetch HTTP resource "http://example.org": Uri not reachable', $exception->getMessage());
 }
All Usage Examples Of BrowscapPHP\Exception\FetcherException::httpError
FetcherException