Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
A5hleyRich committed Apr 20, 2018
1 parent c84587c commit 73632c4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/WP_Queue/Connections/SyncConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class SyncConnection implements ConnectionInterface {
/**
* Push a job onto the queue.
* Execute the job immediately without pushing to the queue.
*
* @param Job $job
* @param int $delay
Expand Down
2 changes: 0 additions & 2 deletions src/WP_Queue/QueueManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ class QueueManager {
* @return Queue
*/
public static function resolve( $connection ) {
$connection = apply_filters( 'wp_queue_default_connection', $connection );

if ( isset( static::$instances[ $connection ] ) ) {
return static::$instances[ $connection ];
}
Expand Down
8 changes: 6 additions & 2 deletions src/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@
/**
* Return Queue instance.
*
* @param string $connection
* @param string|null $connection
*
* @return Queue
*/
function wp_queue( $connection = 'database' ) {
function wp_queue( $connection = null ) {
if(is_null($connection)) {
$connection = apply_filters( 'wp_queue_default_connection', 'database' );
}

return QueueManager::resolve( $connection );
}
}
Expand Down

0 comments on commit 73632c4

Please sign in to comment.