modify plugin name

This commit is contained in:
2022-02-17 17:44:28 +08:00
parent 2d0f214a9f
commit 3675a592c4
5 changed files with 38 additions and 222 deletions
+14
View File
@@ -2,6 +2,7 @@
namespace Kiri\Task;
use JetBrains\PhpStorm\Pure;
use Kiri\Abstracts\Component;
use Kiri\Core\HashMap;
use Psr\Container\ContainerExceptionInterface;
@@ -58,6 +59,16 @@ class TaskManager extends Component
}
/**
* @param string $key
* @return bool
*/
#[Pure] public function has(string $key): bool
{
return $this->hashMap->has($key);
}
/**
* @param string $key
* @return OnTaskInterface
@@ -69,6 +80,9 @@ class TaskManager extends Component
$task = $this->hashMap->get($key);
if (is_string($task)) {
$task = $this->getContainer()->get($task);
if (!empty($task)) {
$this->add($key, $task);
}
}
return $task;
}