Skip to content

Commit

Permalink
Remove class MongoFailedJobProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
GromNaN committed Jul 12, 2024
1 parent 533d1b7 commit 6a05d69
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 27 deletions.
1 change: 0 additions & 1 deletion src/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

use Exception;
use MongoDB\BSON\ObjectID;
use MongoDB\BSON\UTCDateTime;
use MongoDB\Collection as MongoCollection;

use function array_walk_recursive;
Expand Down
5 changes: 0 additions & 5 deletions src/MongoDBQueueServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,8 @@
use Illuminate\Queue\Failed\DatabaseFailedJobProvider;
use Illuminate\Queue\Failed\NullFailedJobProvider;
use Illuminate\Queue\QueueServiceProvider;
use MongoDB\Laravel\Queue\Failed\MongoFailedJobProvider;

use function array_key_exists;
use function trigger_error;

use const E_USER_DEPRECATED;

class MongoDBQueueServiceProvider extends QueueServiceProvider
{
Expand Down Expand Up @@ -56,7 +52,6 @@ protected function registerFailedJobServices()
protected function mongoFailedJobProvider(array $config): DatabaseFailedJobProvider
{
if (! isset($config['collection']) && isset($config['table'])) {
trigger_error('Since mongodb/laravel-mongodb 4.4: Using "table" option for the queue is deprecated. Use "collection" instead.', E_USER_DEPRECATED);
$config['collection'] = $config['table'];
}

Expand Down
2 changes: 1 addition & 1 deletion src/Query/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ public function aggregate($function = null, $columns = ['*'])
if (isset($results[0])) {
$result = (array) $results[0];

return $this->aliasIdForResult($result['aggregate']);
return $result['aggregate'];
}
}

Expand Down
12 changes: 0 additions & 12 deletions src/Queue/Failed/MongoFailedJobProvider.php

This file was deleted.

3 changes: 2 additions & 1 deletion tests/Query/AggregationBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use MongoDB\Laravel\Query\AggregationBuilder;
use MongoDB\Laravel\Tests\Models\User;
use MongoDB\Laravel\Tests\TestCase;
use stdClass;

class AggregationBuilderTest extends TestCase
{
Expand Down Expand Up @@ -84,7 +85,7 @@ public function testCreateAggregationBuilder(): void

// Execute the pipeline and return the first result
$result = $pipeline->first();
$this->assertInstanceOf(\stdClass::class, $result);
$this->assertInstanceOf(stdClass::class, $result);
$this->assertInstanceOf(ObjectId::class, $result->_id);
$this->assertSame('John Doe', $result->name);
}
Expand Down
1 change: 0 additions & 1 deletion tests/QueryBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
use function md5;
use function sort;
use function strlen;
use function strtotime;

class QueryBuilderTest extends TestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,22 @@

namespace MongoDB\Laravel\Tests\Queue\Failed;

use Illuminate\Queue\Failed\DatabaseFailedJobProvider;
use Illuminate\Support\Facades\Date;
use Illuminate\Support\Facades\DB;
use MongoDB\BSON\ObjectId;
use MongoDB\BSON\UTCDateTime;
use MongoDB\Laravel\Queue\Failed\MongoFailedJobProvider;
use MongoDB\Laravel\Tests\TestCase;
use OutOfBoundsException;

use function array_map;
use function range;
use function sprintf;

class MongoFailedJobProviderTest extends TestCase
/**
* Test the Laravel class with MongoDB's Query Builder
*/
class DatabaseFailedJobProviderTest extends TestCase
{
public function setUp(): void
{
Expand Down Expand Up @@ -142,8 +145,8 @@ public function testPrune(): void
$this->assertEquals(3, $provider->count());
}

private function getProvider(): MongoFailedJobProvider
private function getProvider(): DatabaseFailedJobProvider
{
return new MongoFailedJobProvider(DB::getFacadeRoot(), '', 'failed_jobs');
return new DatabaseFailedJobProvider(DB::getFacadeRoot(), '', 'failed_jobs');
}
}
2 changes: 0 additions & 2 deletions tests/QueueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
use Illuminate\Support\Facades\Queue;
use Illuminate\Support\Str;
use Mockery;
use MongoDB\BSON\UTCDateTime;
use MongoDB\Laravel\Queue\Failed\MongoFailedJobProvider;
use MongoDB\Laravel\Queue\MongoJob;
use MongoDB\Laravel\Queue\MongoQueue;

Expand Down

0 comments on commit 6a05d69

Please sign in to comment.