diff --git a/CHANGELOG.md b/CHANGELOG.md index 91a3bf8..b4f1f02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ * [CHANGE] Scheduler::cancelJob() not throws Exception\JobNotFound if job was not found * [FIX] Fixed driver version (mongodb >= 1.5.0) support for ServerException along ConnectionException to create collection if not propperly setup +* [FIX] Use collection_name from options instead static queue in getCursor() +* [CHANGE] Extended phpstan level to 5 ## 2.0.4 diff --git a/phpstan.neon b/phpstan.neon index 943798d..56d2faf 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -2,8 +2,6 @@ parameters: autoload_directories: - %rootDir%/../../../src - %rootDir%/../../../tests - ignoreErrors: - - '#^Class MongoDB\\BSON\\UTCDateTime constructor invoked with 0 parameters, 1 required\.#' includes: - - vendor/phpstan/phpstan/conf/config.level1.neon + - vendor/phpstan/phpstan/conf/config.level4.neon diff --git a/src/Queue.php b/src/Queue.php index cea117c..32d7456 100644 --- a/src/Queue.php +++ b/src/Queue.php @@ -80,7 +80,7 @@ class Queue /** * Current processing job. * - * @var array + * @var null|array */ protected $current_job; @@ -276,9 +276,9 @@ protected function convertQueue(): self /** * Retrieve next job. * - * @param iterable $cursor + * @param IteratorIterator $cursor */ - protected function retrieveNextJob(Iterable $cursor) + protected function retrieveNextJob(IteratorIterator $cursor) { try { $cursor->next(); diff --git a/src/Scheduler.php b/src/Scheduler.php index 75dcb2d..27295ae 100755 --- a/src/Scheduler.php +++ b/src/Scheduler.php @@ -299,7 +299,7 @@ public function addJobOnce(string $class, $data, array $options = []): ObjectId ], ]; - $result = $this->db->queue->findOne($filter, [ + $result = $this->db->{$this->collection_name}->findOne($filter, [ 'typeMap' => self::TYPE_MAP, ]);