From 51b86451bbd22ee64ce5146e873ab7bbf256bd6c Mon Sep 17 00:00:00 2001 From: "Ian M. Jones" Date: Tue, 30 Oct 2018 15:21:20 +0000 Subject: [PATCH 1/2] Updated composer.json's required PHP version as code requires PHP 5.5 features in some places. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 1faea78..0a7a85b 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ } ], "require": { - "php": ">=5.3.0", + "php": ">=5.5.0", "nesbot/carbon": "^1.22" }, "autoload": { From 7f4cd67af1522020de0e8b51edd2e0ab84f107ff Mon Sep 17 00:00:00 2001 From: "Ian M. Jones" Date: Tue, 30 Oct 2018 15:34:49 +0000 Subject: [PATCH 2/2] Improved accuracy of PHPDoc blocks to help tooling (e.g. PhpStorm). --- src/WP_Queue/Connections/ConnectionInterface.php | 2 +- src/WP_Queue/Connections/DatabaseConnection.php | 4 ++-- src/WP_Queue/Connections/RedisConnection.php | 2 ++ src/WP_Queue/QueueManager.php | 1 + src/functions.php | 1 + 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/WP_Queue/Connections/ConnectionInterface.php b/src/WP_Queue/Connections/ConnectionInterface.php index 8ac0ac0..351fed1 100644 --- a/src/WP_Queue/Connections/ConnectionInterface.php +++ b/src/WP_Queue/Connections/ConnectionInterface.php @@ -44,7 +44,7 @@ public function release( $job ); * @param Job $job * @param Exception $exception * - * @return + * @return bool */ public function failure( $job, Exception $exception ); diff --git a/src/WP_Queue/Connections/DatabaseConnection.php b/src/WP_Queue/Connections/DatabaseConnection.php index ffe9707..dc5adac 100644 --- a/src/WP_Queue/Connections/DatabaseConnection.php +++ b/src/WP_Queue/Connections/DatabaseConnection.php @@ -9,7 +9,7 @@ class DatabaseConnection implements ConnectionInterface { /** - * @var wpdb + * @var \wpdb */ protected $database; @@ -26,7 +26,7 @@ class DatabaseConnection implements ConnectionInterface { /** * DatabaseQueue constructor. * - * @param wpdb $wpdb + * @param \wpdb $wpdb */ public function __construct( $wpdb ) { $this->database = $wpdb; diff --git a/src/WP_Queue/Connections/RedisConnection.php b/src/WP_Queue/Connections/RedisConnection.php index f6cda6b..346a348 100644 --- a/src/WP_Queue/Connections/RedisConnection.php +++ b/src/WP_Queue/Connections/RedisConnection.php @@ -51,6 +51,8 @@ public function release( $job ) { * * @param Job $job * @param Exception $exception + * + * @return bool */ public function failure( $job, Exception $exception ) { // diff --git a/src/WP_Queue/QueueManager.php b/src/WP_Queue/QueueManager.php index 907e4c9..648b222 100644 --- a/src/WP_Queue/QueueManager.php +++ b/src/WP_Queue/QueueManager.php @@ -20,6 +20,7 @@ class QueueManager { * @param string $connection * * @return Queue + * @throws \Exception */ public static function resolve( $connection ) { if ( isset( static::$instances[ $connection ] ) ) { diff --git a/src/functions.php b/src/functions.php index 37c8231..c4b7a0c 100644 --- a/src/functions.php +++ b/src/functions.php @@ -10,6 +10,7 @@ * @param string $connection * * @return Queue + * @throws Exception */ function wp_queue( $connection = '' ) { if( empty( $connection ) ) {