From cb7019cbf422d0145daefdfa06649beb0b77f416 Mon Sep 17 00:00:00 2001 From: mscherer Date: Tue, 19 Nov 2024 12:53:01 +0100 Subject: [PATCH] Fix disabling of class tasks --- src/Annotator/ClassAnnotatorTaskCollection.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/Annotator/ClassAnnotatorTaskCollection.php b/src/Annotator/ClassAnnotatorTaskCollection.php index ed0cfbd3..8470b5ac 100644 --- a/src/Annotator/ClassAnnotatorTaskCollection.php +++ b/src/Annotator/ClassAnnotatorTaskCollection.php @@ -32,14 +32,7 @@ class ClassAnnotatorTaskCollection { public function __construct(array $tasks = []) { $defaultTasks = $this->defaultTasks(); $tasks += $defaultTasks; - - foreach ($tasks as $task) { - if (!$task) { - continue; - } - - $this->tasks = $tasks; - } + $this->tasks = $tasks; } /** @@ -52,6 +45,12 @@ public function defaultTasks(): array { if (is_numeric($k)) { $tasks[$v] = $v; unset($tasks[$k]); + + continue; + } + + if (!$v) { + unset($tasks[$k]); } }