Skip to content

Commit fc7d8ec

Browse files
committed
Update phpstan baseline
1 parent 06aa7b0 commit fc7d8ec

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

phpstan-baseline.neon

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
parameters:
22
ignoreErrors:
3+
-
4+
message: "#^Access to an undefined property Illuminate\\\\Container\\\\Container\\:\\:\\$config\\.$#"
5+
count: 3
6+
path: src/MongoDBBusServiceProvider.php
7+
38
-
49
message: "#^Method Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:push\\(\\) invoked with 3 parameters, 0 required\\.$#"
510
count: 2

src/MongoDBBusServiceProvider.php

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,10 @@ public function register()
2929
$this->app->extend(BatchRepository::class, function (BatchRepository $repository, Container $app) {
3030
$driver = $app->config->get('queue.batching.driver');
3131

32-
return $driver === 'mongodb'
33-
? $app->make(MongoBatchRepository::class)
34-
: $repository;
35-
});
36-
// Add database driver.
37-
$this->app->resolving('db', function ($db) {
38-
$db->extend('mongodb', function ($config, $name) {
39-
$config['name'] = $name;
40-
41-
return new Connection($config);
42-
});
32+
return match ($driver) {
33+
'mongodb' => $app->make(MongoBatchRepository::class),
34+
default => $repository,
35+
};
4336
});
4437
}
4538

0 commit comments

Comments
 (0)