Skip to content

Commit

Permalink
Make GuzzleException extend Throwable whereever it's available
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikBooijCB committed Mar 7, 2019
1 parent fa74540 commit 3b74cb4
Showing 1 changed file with 26 additions and 10 deletions.
36 changes: 26 additions & 10 deletions src/Exception/GuzzleException.php
@@ -1,13 +1,29 @@
<?php
namespace GuzzleHttp\Exception;

/**
* @method string getMessage()
* @method \Throwable|null getPrevious()
* @method mixed getCode()
* @method string getFile()
* @method int getLine()
* @method array getTrace()
* @method string getTraceAsString()
*/
interface GuzzleException {}
use Throwable;

if (interface_exists(Throwable::class)) {
/**
* @method string getMessage()
* @method Throwable|null getPrevious()
* @method mixed getCode()
* @method string getFile()
* @method int getLine()
* @method array getTrace()
* @method string getTraceAsString()
*/
interface GuzzleException extends Throwable {}
} else {
/**
* @method string getMessage()
* @method \Throwable|null getPrevious()
* @method mixed getCode()
* @method string getFile()
* @method int getLine()
* @method array getTrace()
* @method string getTraceAsString()
*/
interface GuzzleException {}
}

0 comments on commit 3b74cb4

Please sign in to comment.