\ncc\CLI > Main > getArgs() will try to fetch $argv if available
https://git.n64.cc/nosial/ncc/-/issues/23
This commit is contained in:
parent
b9a356fe40
commit
b465bcefa5
1 changed files with 16 additions and 3 deletions
|
@ -31,6 +31,7 @@
|
|||
*
|
||||
* @param $argv
|
||||
* @return void
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public static function start($argv): void
|
||||
{
|
||||
|
@ -137,10 +138,22 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
* @return array
|
||||
*/
|
||||
public static function getArgs()
|
||||
public static function getArgs(): array
|
||||
{
|
||||
if (self::$args == null)
|
||||
{
|
||||
if(isset($argv))
|
||||
{
|
||||
self::$args = Resolver::parseArguments(implode(' ', $argv));
|
||||
}
|
||||
else
|
||||
{
|
||||
self::$args = [];
|
||||
}
|
||||
}
|
||||
|
||||
return self::$args;
|
||||
}
|
||||
|
||||
|
@ -157,7 +170,7 @@
|
|||
/**
|
||||
* @return void
|
||||
*/
|
||||
public static function shutdown()
|
||||
public static function shutdown(): void
|
||||
{
|
||||
Console::outDebug('clearing cache');
|
||||
RuntimeCache::clearCache();
|
||||
|
|
Loading…
Add table
Reference in a new issue