22
33namespace Textalk \WebshopClient ;
44
5- use Tivoka \Client \Request ;
6-
75class Exception extends \Exception {
86 protected static $ class_by_code = array (
97 -32700 => 'ParseError ' ,
@@ -21,8 +19,8 @@ class Exception extends \Exception {
2119 *
2220 * @return Exception Generic or specific subclass
2321 */
24- public static function factory (\Tivoka \ Client \ Connection \ WebSocket $ connection ,
25- Request $ request ) {
22+ public static function factory (\Textalk \ WebshopClient \ ConnectionInterface $ connection ,
23+ \ Tivoka \ Client \ Request $ request ) {
2624 if (array_key_exists ($ request ->error , self ::$ class_by_code )) {
2725 $ exception_class
2826 = 'Textalk \\WebshopClient \\Exception \\' . self ::$ class_by_code [$ request ->error ];
@@ -50,15 +48,16 @@ public function getRpcMessage() { return $this->request->errorMessage; }
5048 // Protected
5149 //
5250
53- protected $ request ; ///< Tivoka\Client\Request The request that failed
54- protected $ connection ; ///< Tivoka\Client\Connection\WebSocket The connection that was used
51+ protected $ connection ; ///< Textalk\WebshopClient\ConnectionInterface The connection that was used.
52+ protected $ request ; ///< Tivoka\Client\Request The request that failed.
5553
5654 /**
5755 * Construct a new Exception.
5856 *
5957 * This can't be protected since it extends Exception, but it shouldn't be used. Use factory.
6058 */
61- public function __construct (\Tivoka \Client \Connection \WebSocket $ connection , Request $ request ) {
59+ public function __construct (\Textalk \WebshopClient \ConnectionInterface $ connection ,
60+ \Tivoka \Client \Request $ request ) {
6261 $ this ->request = $ request ;
6362 $ this ->connection = $ connection ;
6463
0 commit comments