SET CHECK
@param string $name
@param string $arg
@return $this
45
public function checks($name, $arg = null) {
        if (empty($arg)) {
            $this->checks[] = $name;
        } else {
            $this->checks[$name] = $arg;
        }
        return $this;
    }
1239489
public function setCommand(string $args): self
	{
		if ($this->mailer instanceof SendmailMailer) {
			$this->mailer->commandArgs = $args;
		}
		return $this;
	}
149958
public function setHeadAuto($name)
    {
        $this->arguments[] = 'set-head';
        $this->arguments[] = $name;
        $this->arguments[] = '--auto';
        return $this;
    }
398713
public function setArgument(Argument $arg)
    {
        if ($this->mode == Getopt::NO_ARGUMENT) {
            throw new \InvalidArgumentException("Option should not have any argument");
        }
        $this->argument = $arg;
        return $this;
    }
521079
public function setAI($arg) {
        $this->aiBegin = max($this->aiBegin, intval($arg));
        return $this;
    }
557077
public static function add(&$set, $args)
    {
        self::assertArgsNumber(1, $args);

        $value = $args[0];

        foreach ($set as $item) {
            if ($item === $value) {
                return;
            }
        }

        $set[] = $value;
    }
1349737
private function funcCondition($name, $arg = null)
    {
        $this->getExpr()->addCondition(new ConditionFunc(
            $name,
            $this,
            $arg !== null ? $this->getExpr()->value($arg) : null
        ));

        return $this->getExpr();
    }
815042
protected function setArgument($arg)
    {
        if ($this->checkDiscription($arg)) {
            $this->advanceArg($arg);
        } else {
            $this->simpleArg($arg);
        }
    }
661899
public static function trigger(string $name, ?array $args = null)
  {
    if (!isset(self::$events[$name])) return false;

    foreach (self::$events[$name] as $event => $callback) {
      if (is_callable($callback)) {
        return call_user_func_array($callback, isset($args) ? $args : []);
      }
      else if (is_array($callback)) {
        (new Events)->triggerGroup($callback, $args);
      }
      else if (is_string($callback)) {
        $call = new $callback;
        return call_user_func_array([$call, 'persist'], $args ?? []);
      }
    }
  }
1336614
public function addArgument($name, Argument $arg = null) {
        if (isset($this->configOpts[$name]) || isset($this->configArgs[$name])) {
            throw new ConfigException('option/argument already set: ' . $name);
        }

        if (is_null($arg)) {
            $arg = new Argument();
        }

        $this->configArgs[$name] = $arg;
        return $arg;
    }
972053
public function setRegexp($name, $regexp = null)
    {
        if (is_array($name)) {
            $this->regexps = array_merge($this->regexps, $name);
        } else {
            $this->regexps[$name] = $regexp;
        }
        return $this;
    }
887906
public static function setInstance($args)
    {
        $name = array_shift($args);

        $name = self::getAccessor($name);

        $reflect = new \ReflectionClass($name);

        return $reflect->newInstanceArgs($args);
    }
909445
public function trigger($name, ...$args)
    {
        //we should deal with strings
        //then callables respectively
        //to allow overriding
        if (is_string($name)) {
            //is it a protocol?
            if (strpos($name, '://') !== false) {
                return $this->triggerProtocol($name, ...$args);
            }

            //they can call a class
            if (strpos($name, '@') !== false) {
                return $this->triggerController($name, ...$args);
            }

            //unless it's a static call
            if (strpos($name, '::') !== false && is_callable($name)) {
                call_user_func_array($name, $args);
                return $this;
            }

            return $this->triggerEvent($name, ...$args);
        }

        if (is_callable($name)) {
            if ($name instanceof Closure) {
                $name = $this->bindCallback($name);
            }

            call_user_func_array($name, $args);
        }

        //we can only deal with callable and strings
        //we don't want to throw an error
        //because it could just be a pseudo
        //placeholder
        return $this;
    }
1348578
protected function cutArgument($name, &$args)
    {
        if (isset($args[$name])) {
            $result = $args[$name];
            unset($args[$name]);
            return $result;
        }

        return null;
    }
413699
public function setArgument($argument, $value)
    {
        Arr::set($this->arguments, $argument, $value);

        return $this;
    }
309302
public function triggerSubEvent($name, $event, $args = [])
    {
        return $this->getDispatcher($name)->triggerEvent($event, $args);
    }
1228873
private function cannotCheck($type, $name, $args)
    {
        if (isset($args[0]) && (is_object($args[0]) && get_class($args[0]) === 'Closure')) {
            $type = 'closure';
            $args[1] = $args[0];
        } elseif (is_string($args[0]) && strpos($args[0], '::') !== false) {
            $type = 'method';
        }

        $this->check('not-equals', $type, $name, $args);
    }