-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix for class extends from (missing start slash). Added Exception cod…
…e name.
- Loading branch information
Showing
4 changed files
with
42 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Windows image file caches | ||
Thumbs.db | ||
ehthumbs.db | ||
|
||
# Folder config file | ||
Desktop.ini | ||
|
||
# Recycle Bin used on file shares | ||
$RECYCLE.BIN/ | ||
|
||
nbproject | ||
vendor | ||
composer.phar | ||
composer.lock | ||
.idea | ||
|
||
# Windows Installer files | ||
*.cab | ||
*.msi | ||
*.msm | ||
*.msp | ||
|
||
# Windows shortcuts | ||
*.lnk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,10 +17,8 @@ | |
* @see http://v2.wp-api.org/ | ||
* | ||
* @author Andre Schuurman <[email protected]> | ||
* @since 2.0 | ||
* | ||
*/ | ||
class Client extends yii\base\Object { | ||
class Client extends \yii\base\Object { | ||
|
||
/** | ||
* @var string API endpoint (default production) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,20 +8,33 @@ | |
* Error codes handling retry and other specific conditions | ||
* | ||
* @author Andre Schuurman <[email protected]> | ||
* @since 2.0 | ||
*/ | ||
class Exception extends yii\base\Exception { | ||
class Exception extends \yii\base\Exception { | ||
|
||
const FAIL = 0; | ||
const RETRY = 1; | ||
const WAIT_RETRY = 2; | ||
const ITEM_EXISTS = 3; | ||
|
||
static $code_names = [ | ||
self::FAIL => ' unrecoverable', | ||
self::RETRY => ' and can be retried', | ||
self::WAIT_RETRY => ' and can be retried after wait time', | ||
self::ITEM_EXISTS => ' because item already exists', | ||
]; | ||
|
||
/** | ||
* @return string the user-friendly name of this exception | ||
*/ | ||
public function getName() | ||
{ | ||
return 'API response failed, retry'; | ||
return 'API request failed'.$this->getCodeName(); | ||
} | ||
|
||
/** | ||
* @return mixed|string | ||
*/ | ||
public function getCodeName() { | ||
return isset(self::$code_names[$this->getCode()])?self::$code_names[$this->getCode()]:''; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,9 +30,8 @@ | |
* @see https://wordpress.org/plugins/rest-api-oauth1/ | ||
* | ||
* @author Andre Schuurman <[email protected]> | ||
* @since 2.0 | ||
*/ | ||
class OAuth1 extends yii\authclient\OAuth1 | ||
class OAuth1 extends \yii\authclient\OAuth1 | ||
{ | ||
/** | ||
* @inheritdoc | ||
|