src/Console.php
public function execute(string $collection = null, string $command = null, array $args = []): void
	{
		$collection = Strings::lower($collection);

		if (isset($this->collections[$collection])) {
			$class = new ClassType($this->collections[$collection]);
		} else {
			$class = null;
		}

		if ($command === 'help' || (empty($command) && empty($collection)) || (($collection === 'help' || $class !== null) && empty($command))) {
			$this->help($class);
			return;
		} elseif ($class !== null) {
			if ($class->hasMethod($command)) {
				$method = $class->getMethod($command);
				if ($method->isPublic() && !$method->isAbstract() && !$method->isStatic()) {
					$this->printTime($class->getShortName() . ' => ' . $method->name);

					$parameters = [];
					foreach ($method->getParameters() as $param) {
						if (isset($args[$param->name])) {
							$parameters[$param->name] = $args[$param->name];
						}
					}

					$method->invokeArgs($this->collections[$collection], $parameters);
					$this->printTime($method->name . ' done');
					return;
				}
			}
		}
		throw new InvalidArgumentException;
	}
public function execute(string $collection = null, string $command = null, array $args = []): void
	{
		$collection = Strings::lower($collection);

		if (isset($this->collections[$collection])) {
			$class = new ClassType($this->collections[$collection]);
		} else {
			$class = null;
		}

		if ($command === 'help' || (empty($command) && empty($collection)) || (($collection === 'help' || $class !== null) && empty($command))) {
			$this->help($class);
			return;
		} elseif ($class !== null) {
			if ($class->hasMethod($command)) {
				$method = $class->getMethod($command);
				if ($method->isPublic() && !$method->isAbstract() && !$method->isStatic()) {
					$this->printTime($class->getShortName() . ' => ' . $method->name);

					$parameters = [];
					foreach ($method->getParameters() as $param) {
						if (isset($args[$param->name])) {
							$parameters[$param->name] = $args[$param->name];
						}
					}

					$method->invokeArgs($this->collections[$collection], $parameters);
					$this->printTime($method->name . ' done');
					return;
				}
			}
		}
		throw new InvalidArgumentException;
	}
Spusti prikaz
@param string $collection
@param string $command
@param array $args
@throws InvalidArgumentException