Skip to content

Commit 7af4a9f

Browse files
committed
Remove Arr::get where not necessary
1 parent 7300e94 commit 7af4a9f

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

src/Connection.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use function class_exists;
66
use Composer\InstalledVersions;
77
use Illuminate\Database\Connection as BaseConnection;
8-
use Illuminate\Support\Arr;
98
use InvalidArgumentException;
109
use Jenssegers\Mongodb\Concerns\ManagesTransactions;
1110
use MongoDB\Client;
@@ -48,7 +47,7 @@ public function __construct(array $config)
4847
$dsn = $this->getDsn($config);
4948

5049
// You can pass options directly to the MongoDB constructor
51-
$options = Arr::get($config, 'options', []);
50+
$options = $config['options'] ?? [];
5251

5352
// Create the connection
5453
$this->connection = $this->createConnection($dsn, $config, $options);

src/Query/Builder.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
use Illuminate\Support\Arr;
1111
use Illuminate\Support\Collection;
1212
use Illuminate\Support\LazyCollection;
13-
use Illuminate\Support\Str;
1413
use Jenssegers\Mongodb\Connection;
1514
use MongoDB\BSON\Binary;
1615
use MongoDB\BSON\ObjectID;

src/Queue/MongoConnector.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use Illuminate\Database\ConnectionResolverInterface;
66
use Illuminate\Queue\Connectors\ConnectorInterface;
7-
use Illuminate\Support\Arr;
87

98
class MongoConnector implements ConnectorInterface
109
{
@@ -34,10 +33,10 @@ public function __construct(ConnectionResolverInterface $connections)
3433
public function connect(array $config)
3534
{
3635
return new MongoQueue(
37-
$this->connections->connection(Arr::get($config, 'connection')),
36+
$this->connections->connection($config['connection']),
3837
$config['table'],
3938
$config['queue'],
40-
Arr::get($config, 'expire', 60)
39+
$config['expire'] ?? 60
4140
);
4241
}
4342
}

0 commit comments

Comments
 (0)