public static function agent()
    {
        static::$constructorArgs = func_get_args();
        static::$agentMode = true;

        $reflection = new \ReflectionClass(get_called_class());

        return $reflection->newInstanceArgs(static::$constructorArgs);
    }
public static function agent()
    {
        static::$constructorArgs = func_get_args();
        static::$agentMode = true;

        $reflection = new \ReflectionClass(get_called_class());

        return $reflection->newInstanceArgs(static::$constructorArgs);
    }
public static function agent ( ) { static :: $ constructorArgs = func_get_args ( ) ; static :: $ agentMode = true ; $ reflection = new \ ReflectionClass ( get_called_class ( ) ) ; return $ reflection -> newInstanceArgs ( static :: $ constructorArgs ) ; }
Factory method for create object of agent class.

Bitrix calls this method to run agent. Your agents should be registered through
`\Notamedia\ConsoleJedi\Agent\AgentTask`. All arguments from this method should
be duplicated in the object constructor:

`agent($arg1, …, $arg2)` → `__construct($arg1, …, $arg2)`.

@return static

@see AgentTask
Factory method for create object of agent class .