(non-PHPdoc)
@see AltrEgo\Adapter.AdapterInterface::_callStatic()
546080
public static function _callStatic($object, $name, $arguments)
    {
		if (is_object($object))
		{
			$class = ($object instanceof AltrEgo) ? get_class($object->getObject()) : get_class($object);
		} elseif (!class_exists($object))
		{
			throw new \Exception('Static call (callStatic) to AltrEgo must be passed either an object or an accessible class name');
		}
		$callable = \Closure::bind(function() use ($name, $arguments, $class){
			return call_user_func_array(array($class, $name), array($arguments));
		}, null, $class);
		return $callable();
    }
379600
public function callServiceMethod(string $call, array $callArgs = null, bool $prepareMethod = false)
    {
        @ [$className, $classMethod] = explode('::', $call);
        if (!isset($className, $classMethod)) {
            throw new AppException('Both service class name & method are required');
        }

        $className = ServiceFactory::toServiceName($className);
        if ($prepareMethod) {
            $classMethod = ServiceFactory::toServiceMethod($classMethod);
        }
        $class = ServiceFactory::toServiceClass($className);
        $classFile = ServiceFactory::toServiceFile($className);

        if (!file_exists($classFile)) {
            throw new AppException("Service class file '{$classFile}' not found");
        }
        if (!class_exists($class)) {
            throw new AppException("Service class '{$class}' not found");
        }
        if (!method_exists($class, $classMethod)) {
            throw new AppException("Service class method '{$classMethod}' not found");
        }

        // keep current service
        $service = $this->service;

        // overrides also in service constructor (so, get_service() etc. sould accurate service info)
        $this->service = new $class($this, $className, $classMethod, $callArgs ?? [], $service);

        $output = $this->service->run(false);

        // restore current service
        $this->service = $service;

        return $output;
    }
1048667
public static function __callstatic($name, $params)
    {

        $matches = static::isBackgroundCall($name);

        if (null === $matches) {
            throw new Exception("Unknown background color function name $name");
        }

        $colorName   = $matches[2];
        $knownColors = static::getKnownColors();
        $colorID     = $knownColors[$colorName];

        if (!$colorID) {
            throw new Exception("Unknown background color name $name");
        }

        $color = static::color($colorID);

        // target string is expected to be:
        $targetString = $params[0][0];

        $element = new TextElement($targetString);
        $element->setBackgroundColor($color);

        return $element->render();
    }
1227223
public static Object invokeStatic(Class target, String methodName, Object[] paras) throws IllegalAccessException,
			IllegalArgumentException, InvocationTargetException
	{
		return invoke(target, null, methodName, paras);

	}
1289604
public static Object invokeStaticMethod(
            BshClassManager bcm, Class<?> clas, String methodName,
            Object [] args, SimpleNode callerInfo )
                    throws ReflectError, UtilEvalError,
                           InvocationTargetException {
        Interpreter.debug("invoke static Method");
        NameSpace ns = getThisNS(clas);
        if (null != ns)
            ns.setNode(callerInfo);
        Invocable method = resolveExpectedJavaMethod(
            bcm, clas, null, methodName, args, true );
        return method.invoke(null, args);
    }
957320
public function setStatus($status, $calledFromActivity = false)
    {
        parent::setStatus($status);

        // Change the Activity as well only if this method has not been called by an Activity instance to avoid recursion.
        if (!$calledFromActivity && $this->getActivity() && $this->getActivity()->getEqualsOperation()) {
            $this->getActivity()->setStatus($this->status, true);
        }

        return $this;
    }
532488
public void invokestatic(ExecutableElement method) throws IOException
    {
        int index = subClass.resolveMethodIndex(method);
        invokestatic(index);
    }
778766
public function setStatic($is_static) {
    if ($is_static) {
      if (!isset($this->static)) {
        $this->static = Token::_static();
        $this->visibility->after([Token::space(), $this->static]);
      }
    }
    else {
      if (isset($this->static)) {
        // Remove whitespace after static keyword.
        $this->static->next()->remove();
        // Remove static keyword.
        $this->static->remove();
      }
    }
    return $this;
  }
48281
public static function _call($reference, $call)
    {
        $static = false;
        if (preg_match('/^::.*/', $call['name'])) {
            $call['name'] = substr($call['name'], 2);
            $call['static'] = true;
        }
        if (is_object($reference)) {
            $call += ['instance' => $reference, 'class' => get_class($reference), 'static' => $static, 'method' => null];
        } elseif ($reference) {
            $call += ['instance' => null, 'class' => $reference, 'static' => $static, 'method' => null];
        } else {
            $call += ['instance' => null, 'class' => null, 'static' => false, 'method' => null];
        }
        return $call;
    }
476575
protected static function setCfgStatic($key, $value = null)
    {
        $calledClassname = get_called_class();
        if (is_string($key)) {
            $cfg = array();
            ArrayUtil::path($cfg, $key, $value);
        } elseif (is_array($key)) {
            $cfg = $key;
        }
        if ($calledClassname === __CLASS__) {
            // \bdk\Debug::_info('calling Config::setCfg');
            $class = null;
            foreach ($cfg as $key => $val) {
                if ($key == 'Debug') {
                    \bdk\Debug::getInstance()->setCfg($val);
                    continue;
                }
                if (class_exists($key)) {
                    // $debug->info('class exists', $key);
                    $class = $key;
                } elseif (class_exists('\\'.__NAMESPACE__.'\\'.$key)) {
                    // $debug->info('class exists 2', $key);
                    $class = '\\'.__NAMESPACE__.'\\'.$key;
                }
                if ($class) {
                    call_user_func(array($class, __FUNCTION__), $val);
                }
            }
        } else {
            // called from inheriting class
            static::$cfgStatic = ArrayUtil::mergeDeep(static::$cfgStatic, $cfg);
        }
    }
270869
public static function call()
	{
		$arguments = func_get_args();

		// get the key
		$key = array_shift( $arguments );

		// container call
		if ( is_string( $key ) && array_key_exists( $key, static::$_container ) && is_callable( static::$_container[$key] ) )
		{
			return call_user_func_array( static::$_container[$key], $arguments );
		}

		if ( !is_callable( $key ) )
		{
			throw new CCException( "CCContainer::call - Cannot call '".$key."' invalid callback." );
		}

		// default callback
		return call_user_func_array( $key, $arguments );
	}
881748
public static Object callStaticMethod(Class staticClass, String methodName, Object[] values) throws PageException {
	if (values == null) values = new Object[0];

	MethodParameterPair mp;
	try {
	    mp = getMethodParameterPairIgnoreCase(staticClass, methodName, values);
	}
	catch (NoSuchMethodException e) {
	    throw Caster.toPageException(e);
	}

	try {
	    return mp.getMethod().invoke(null, mp.getParameters());
	}
	catch (InvocationTargetException e) {
	    Throwable target = e.getTargetException();
	    if (target instanceof PageException) throw (PageException) target;
	    throw Caster.toPageException(e.getTargetException());
	}
	catch (Exception e) {
	    throw Caster.toPageException(e);
	}
    }
1008838
private function validateCall(\stdClass $call)
    {
        $result = null;
        $error = null;
        $data = null;
        $id = is_object($call) && property_exists($call, 'id') ? $call->id : null;
        do {
            if (!is_object($call)) {
                $error = self::INVALIDREQUEST;
                break;
            }

            // hack for inputEx smd tester
            if (property_exists($call, 'version')) {
                if ($call->version == 'json-rpc-2.0') {
                    $call->jsonrpc = '2.0';
                }
            }

            if (!property_exists($call, 'jsonrpc') || $call->jsonrpc != '2.0') {
                $error = self::INVALIDREQUEST;
                break;
            }

            $fullMethod = property_exists($call, 'method') ? $call->method : '';
            $methodInfo = explode('.', $fullMethod, 2);
            $namespace = array_key_exists(1, $methodInfo) ? $methodInfo[0] : '';
            $method = $namespace ? $methodInfo[1] : $fullMethod;
            if (!$method || !array_key_exists($namespace, $this->instances) ||
                !method_exists($this->instances[$namespace], $method) ||
                in_array(strtolower($method), $this->hiddenMethods)) {
                $error = self::METHODNOTFOUND;
                break;
            }

            if (!array_key_exists($fullMethod, $this->reflectionMethods)) {
                $this->reflectionMethods[$fullMethod] = new \ReflectionMethod($this->instances[$namespace], $method);
            }

            /** @var $params array */
            $params = property_exists($call, 'params') ? $call->params : null;
            $paramsType = gettype($params);
            if ($params !== null && $paramsType != 'array' && $paramsType != 'object') {
                $error = self::INVALIDPARAMS;
                $data = 'Cast of params error';
                break;
            }

            // check parameters
            switch ($paramsType) {
                case 'array':
                    $totalRequired = 0;
                    // doesn't hold required, null, required sequence of params
                    foreach ($this->reflectionMethods[$fullMethod]->getParameters() as $param) {
                        if (!$param->isDefaultValueAvailable()) {
                            $totalRequired++;
                        }
                    }

                    if (count($params) < $totalRequired) {
                        $error = self::INVALIDPARAMS;
                        $data = sprintf(
                            'Check numbers of required params (got %d, expected %d)',
                            count($params),
                            $totalRequired
                        );
                    }
                    break;
                case 'object':
                    foreach ($this->reflectionMethods[$fullMethod]->getParameters() as $param) {
                        if (!$param->isDefaultValueAvailable() && !array_key_exists($param->getName(), $params)) {
                            $error = self::INVALIDPARAMS;
                            $data = $param->getName() . ' not found';

                            break 3;
                        }
                    }
                    break;
                case 'NULL':
                    if ($this->reflectionMethods[$fullMethod]->getNumberOfRequiredParameters() > 0) {
                        $error = self::INVALIDPARAMS;
                        $data = 'Empty required params';
                        break 2;
                    }
                    break;
            }
        } while (false);

        if ($error) {
            $result = [$error, $id, $data];
        }

        return $result;
    }
668757
protected function executeCallback()
    {
        if ($this->muted) {
            return $this->executeMutedCallback();
        }

        $this->result->setValue(call_user_func_array($this->callback, $this->params));
    }
1085304
private function _call()
    {

        // Time this
        $t = new Timer('Truecrypt Extension');

        // Deal with calling it
        try {
            $result = $this->_CallExt->exec('truecrypt', '-l -v');
        } catch (Exception $e) {
            // messed up somehow
            Errors::add('Truecrypt Extension', $e->getMessage());
            $this->_res = false;

            // Don't bother going any further
            return false;
        }

        // Store them here
        $this->_res = [];

        // Current one
        $curr = false;

        // Lines of output
        $lines = explode("\n", $result);

        // Go through each line
        for ($i = 0, $num = count($lines); $i < $num; ++$i) {

            // Extract juicy info
            if (!preg_match('/^([^:]+): ([^$]+)$/', $lines[$i], $line_match)) {
                continue;
            }

            // Decide what to do with that
            switch ($line_match[1]) {

                // It starts here
                case 'Slot':
                    if ($curr === false) {
                        $curr = array('slot' => $line_match[2]);
                    } elseif (is_array($curr)) {
                        $this->_res[] = $curr;
                        $curr = false;
                    }
                break;

                // Volume.
                case 'Volume':
                    if (is_array($curr)) {
                        $curr['volume'] = $line_match[2];
                    }
                break;

                // Virtual device
                case 'Virtual Device':
                    if (is_array($curr)) {
                        $curr['virtual_device'] = $line_match[2];
                    }
                break;

                // Where it might be mounted
                case 'Mount Directory':
                    if (is_array($curr)) {
                        $curr['mount_directory'] = $line_match[2];
                    }
                break;

                // Size of it
                case 'Size':
                    if (is_array($curr)) {
                        $curr['size'] = $line_match[2];
                    }
                break;

                // Is it read only?
                case 'Read-Only':
                    if (is_array($curr)) {
                        $curr['read_only'] = $line_match[2];
                    }
                break;

                // We deliberately ignore most keys for security reasons
                default:
                    continue;
                break;
            }
        }

        // Save a remaining one
        if (is_array($curr) && count($curr) > 0) {
            $this->_res[] = $curr;
        }

        // Apparent success
        return true;
    }
742366
public function call()
    {
        $args = func_get_args();
        $function = array_shift($args);
        if (is_callable($function)) {
            array_unshift($args, $this);
            call_user_func_array($function, $args);
        }
    }
662743
public static function call(callable $callable, $args=null)
    {

        if (!is_array($args)) {
            $args = $args === null ? [] : [$args];
        }

        return static::callFast($callable, static::evaluateArgs($args));

    }