Skip to content

Commit

Permalink
[FIX] Can't create SchedulerTask
Browse files Browse the repository at this point in the history
The bug was introduced by inattention of type hinting declarations 
and/or IDEs suggestions.

Relates: #2976
Fixes: #3116
  • Loading branch information
dkd-kaehm committed Dec 10, 2021
1 parent 3529986 commit 05ae55e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions Classes/Task/IndexQueueWorkerTaskAdditionalFieldProvider.php
Expand Up @@ -167,13 +167,13 @@ public function saveAdditionalFields(
/**
* Check that a task is an instance of IndexQueueWorkerTask
*
* @param AbstractTask $task
* @param ?AbstractTask $task
* @return boolean
* @throws LogicException
*/
protected function isTaskInstanceofIndexQueueWorkerTask(AbstractTask $task): bool
protected function isTaskInstanceofIndexQueueWorkerTask(?AbstractTask $task): bool
{
if (!($task instanceof IndexQueueWorkerTask)) {
if ((!is_null($task)) && !($task instanceof IndexQueueWorkerTask)) {
throw new LogicException(
'$task must be an instance of IndexQueueWorkerTask, '
.'other instances are not supported.', 1487499814
Expand Down
2 changes: 1 addition & 1 deletion Classes/Task/OptimizeIndexTaskAdditionalFieldProvider.php
Expand Up @@ -266,7 +266,7 @@ protected function getPageRenderer(): ?PageRenderer
/**
* Check that a task is an instance of ReIndexTask
*
* @param AbstractTask|null $task
* @param ?AbstractTask $task
* @return boolean
*/
protected function isTaskInstanceofOptimizeIndexTask(?AbstractTask $task): bool
Expand Down
8 changes: 4 additions & 4 deletions Classes/Task/ReIndexTaskAdditionalFieldProvider.php
Expand Up @@ -30,6 +30,7 @@
use ApacheSolrForTypo3\Solr\Backend\SiteSelectorField;
use ApacheSolrForTypo3\Solr\Domain\Site\SiteRepository;
use ApacheSolrForTypo3\Solr\Domain\Site\Site;
use LogicException;
use TYPO3\CMS\Core\Page\PageRenderer;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Scheduler\AbstractAdditionalFieldProvider;
Expand Down Expand Up @@ -238,14 +239,13 @@ protected function getPageRenderer()
/**
* Check that a task is an instance of ReIndexTask
*
* @param AbstractTask $task
* @param ?AbstractTask $task
* @return boolean
* @throws \LogicException
*/
protected function isTaskInstanceofReIndexTask($task)
protected function isTaskInstanceofReIndexTask(?AbstractTask $task)
{
if ((!is_null($task)) && (!($task instanceof ReIndexTask))) {
throw new \LogicException(
throw new LogicException(
'$task must be an instance of ReIndexTask, '
. 'other instances are not supported.', 1487500366
);
Expand Down

0 comments on commit 05ae55e

Please sign in to comment.