diff --git a/Annotation/Loader.php b/Annotation/Loader.php index 097dae56..1049785d 100644 --- a/Annotation/Loader.php +++ b/Annotation/Loader.php @@ -235,10 +235,7 @@ class Loader extends BaseObject $path = '/' . trim($path, '/'); foreach ($this->_directory as $key => $_path) { $key = '/' . trim($key, '/'); - if (!str_starts_with($key, $path)) { - continue; - } - if (in_array($key, $outPath)) { + if (!str_starts_with($key, $path) || in_array($key, $outPath)) { continue; } $this->execute($_path); diff --git a/System/Channel.php b/System/Channel.php index 8e3c764f..b79ccfa2 100644 --- a/System/Channel.php +++ b/System/Channel.php @@ -71,21 +71,15 @@ class Channel extends Component * @return mixed * @throws Exception */ - public function pop(string $name, Closure $closure, int|float $timeout = null): mixed + public function pop(string $name, Closure $closure): mixed { if (($channel = $this->channelInit($name)) == false) { return $this->addError('Channel is full.'); } - if (!$channel->isEmpty()) { - return $channel->shift(); + if ($channel->isEmpty()) { + return call_user_func($closure); } - if ($timeout !== null) { - $data = $channel->dequeue(); - } - if (empty($data)) { - $data = call_user_func($closure); - } - return $data; + return $channel->dequeue(); }