Workaround to make the `Reveal::is()` static calls, mockable.

@param Object $TestCase [description]
@param array $methods [description]
@param array $parametersMatchers [description]
@return Reveal
343630
public static function getMock($TestCase, $methods, $parametersMatchers) {
		if (empty(self::$__mockedInstance)) {
			self::$__mockedInstance = $TestCase->getMock(__CLASS__, $methods);
		}

		foreach ($parametersMatchers as $parametersMatcher) {
			if (empty(self::$__mockedInstance->parametersMatchers) || !in_array($parametersMatcher, self::$__mockedInstance->parametersMatchers)) {
				self::$__mockedInstance->parametersMatchers[] = (array) $parametersMatcher;
			}
		}

		return self::$__mockedInstance;
	}
888592
public function readCallee($contextClass, ReflectionMethod $method, $docLine, $description)
    {
        if (!preg_match(self::$regex, $docLine, $match)) {
            return null;
        }

        $pattern = $match[1];
        $callable = array($contextClass, $method->getName());

        foreach ($this->simpleTransformations() as $transformation) {
            if ($transformation::supportsPatternAndMethod($pattern, $method)) {
                return new $transformation($pattern, $callable, $description);
            }
        }

        return new PatternTransformation($pattern, $callable, $description);
    }
682335
public function getOrderedListOfArgumentValue(
        ReflectionMethod $reflectedMethod,
        array $paramsWithSelectors
    ) {
        $orderedParamList = $this->getEmptyListOfParamsOf($reflectedMethod);
        foreach ($paramsWithSelectors as $paramValue) {
            $this->addParamValueToList($reflectedMethod, $paramValue, $orderedParamList);
        }
        
        return $orderedParamList;
    }
595388
public function notification(string $method, array $parameters)
    {
        if ($this->isSingleRequest) {
            $this->units = [];
        }

        $this->units[] = new Notification($method, $parameters);

        if ($this->isSingleRequest) {
            $this->execute(new InvokeSpec($this->units, true));
            return null;
        }

        return $this;
    }
1192810
protected function parseMethod( ADT_PHP_Interface $parent, $matches )
	{
		$method	= new ADT_PHP_Method( $matches[6] );
		$method->setParent( $parent );
		$method->setLine( $this->lineNumber );
		if( !empty( $matches[4] ) )
			$method->setAccess( trim( $matches[4] ) );
		$method->setAbstract( (bool) $matches[1] );
		$method->setFinal( (bool) $matches[2] );
		$method->setStatic( (bool) $matches[3] || (bool) $matches[5] );

		$return		= new ADT_PHP_Return( "unknown" );
		$return->setParent( $method );
		$method->setReturn( $return );

		if( trim( $matches[7] ) )
		{
			$paramList	= array();
			foreach( explode( ",", $matches[7] ) as $param )
			{
				$param	 = trim( $param );
				if( !preg_match( $this->regexParam, $param, $matches ) )
					continue;
				$method->setParameter( $this->parseParameter( $method, $matches ) );
			}
		}
		if( $this->openBlocks )
		{
			$methodBlock	= array_pop( $this->openBlocks );
			$this->decorateCodeDataWithDocData( $method, $methodBlock );
			$this->openBlocks	= array();
		}
#		if( !$method->getAccess() )
#			$method->setAccess( 'public' );
		return $method;
	}
855362
public function invokeMethod($method, $params)
    {
        // for named parameters, convert from object to assoc array
        if (is_object($params)) {
            $array = array();
            foreach ($params as $key => $val) {
                $array[$key] = $val;
            }
            $params = array($array);
        }
        // for no params, pass in empty array
        if ($params === null) {
            $params = array();
        }
        $reflection = new \ReflectionMethod($this->exposed_instance, $method);
        
        // only allow calls to public functions
        if (!$reflection->isPublic()) {
            throw new Serverside\Exception("Called method is not publically accessible.");
        }

        // enforce correct number of arguments
        $num_required_params = $reflection->getNumberOfRequiredParameters();
        if ($num_required_params > count($params)) {
            throw new Serverside\Exception("Too few parameters passed.");
        }
        
        return $reflection->invokeArgs($this->exposed_instance, $params);
    }
1187970
public function process(\ReflectionProperty $property, TestCase $test)
    {
        /** @var \ReflectionProperty $property */
        $propertyDocComment = $property->getDocComment();
        if (preg_match(self::REGEX_MOCK, $propertyDocComment, $matches)) {
            $isPrivate = $property->isPrivate();
            if ($isPrivate) {
                $property->setAccessible(true);
            }
            $mock = $this->mockObjectFactory->create($matches[1]);
            $property->setValue($test, $mock);
            if ($isPrivate) {
                $property->setAccessible(false);
            }
        }
    }
935484
public static Method getMethod(final Class<?> clazz, final String methodName, Class<?>... parameterTypes) {
		Method method = MethodUtils.getMatchingMethod(clazz, methodName, parameterTypes);
		if (method != null) {
			makeAccessible(method);
		}
		return method;
	}
197740
protected function _replaceParamsCallback($matches)
    {
        $key    = substr($matches[0], 1);
        $prefix = '';

        if(in_array($this->show, array('FULL TABLES', 'OPEN TABLES', 'TABLE STATUS', 'TABLES')) &&
            ($this->like && $key == 'like' || $this->where && ($key == 'name' || $key == 'table')))
        {
            $prefix = $this->getDriver()->getTablePrefix();
        }

        $replacement = $this->getDriver()->quoteValue($prefix.$this->_parameters[$key]);

        return is_array($this->_parameters[$key]) ? '('.$replacement.')' : $replacement;
    }
1333492
protected function bubble($method, array $arguments = [], $testLinked = true)
    {
        if (!$testLinked || $this->linked) {
            return $this->parent ? call_user_func_array(array($this->parent, $method), $arguments) : $this;
        }

        return call_user_func_array(array($this, 'parent::' . $method), $arguments);
    }
99976
protected static function checkArrayFunctionArgumentsMatch(
        StatementsAnalyzer $statements_analyzer,
        array $args,
        $method_id,
        bool $check_functions
    ) {
        $closure_index = $method_id === 'array_map' ? 0 : 1;

        $array_arg_types = [];

        foreach ($args as $i => $arg) {
            if ($i === 0 && $method_id === 'array_map') {
                continue;
            }

            if ($i === 1 && $method_id === 'array_filter') {
                break;
            }

            $array_arg = isset($arg->value) ? $arg->value : null;

            /** @var ObjectLike|TArray|null */
            $array_arg_type = $array_arg
                    && isset($array_arg->inferredType)
                    && isset($array_arg->inferredType->getTypes()['array'])
                ? $array_arg->inferredType->getTypes()['array']
                : null;

            if ($array_arg_type instanceof ObjectLike) {
                $array_arg_type = $array_arg_type->getGenericArrayType();
            }

            $array_arg_types[] = $array_arg_type;
        }

        /** @var null|PhpParser\Node\Arg */
        $closure_arg = isset($args[$closure_index]) ? $args[$closure_index] : null;

        /** @var Type\Union|null */
        $closure_arg_type = $closure_arg && isset($closure_arg->value->inferredType)
                ? $closure_arg->value->inferredType
                : null;

        if ($closure_arg && $closure_arg_type) {
            $min_closure_param_count = $max_closure_param_count = count($array_arg_types);

            if ($method_id === 'array_filter') {
                $max_closure_param_count = count($args) > 2 ? 2 : 1;
            }

            foreach ($closure_arg_type->getTypes() as $closure_type) {
                if (self::checkArrayFunctionClosureType(
                    $statements_analyzer,
                    $method_id,
                    $closure_type,
                    $closure_arg,
                    $min_closure_param_count,
                    $max_closure_param_count,
                    $array_arg_types,
                    $check_functions
                ) === false) {
                    return false;
                }
            }
        }
    }
1044859
private function func_arr_params_callback($matches) {
    	$func = $matches[1];
    	$params_str = $matches[2];
        $in_matches = [];
    	preg_match_all("/([a-z_]+)\=[\"\']?([^\"\']+)[\"\']?/i", stripslashes($params_str), $in_matches, PREG_SET_ORDER);
    	$params = null;
    	foreach($in_matches as $v) {
    		$params[$v[1]] = $v[2];
    	}
    	return "<?php print_r( " . $func . "(" . ArrayHelper::toRaw($params) . ') ); ?>';
    }
1285681
protected function wrapInCallable($class, array $parameters = [])
    {

        return function ($container) use ($class, $parameters) {

            //if reflection class has a constructor
            if (($constructor = $class->getConstructor()) !== null) { //will return null if no constructor;
                //The container will always be passed as the last argument to the constructor;
                if (($required = $constructor->getNUmberOfParameters()) > 0) { //int

                    $dependencies = $constructor->getParameters();
                    $passed = count($parameters);
                    $needfrom = ($required - $passed) > 0 ? (($passed - 1) < 0 ? 0 : $passed - 1) : $required;

                    for ($i = $needfrom; $i < $required; $i++) {
                        $parameter = $dependencies[$i]; //instance of ReflectionParamter;
                        //If this parameter has not been passed, and the default value is not defined
                        if (!$parameter->isOptional() && !$parameter->isDefaultValueAvailable()) {

                            $hintedType = $parameter->getClass();
                            $hintedTypeName = $hintedType->getName();
                            //$hintedInstance = null;

                            //$hintedType = $reflectionException = null;
                            try {
                                //if the required class exists in the container


                                //If its not in the container, we will try to load it;
                                if ($hintedType->isInstantiable()) {
                                    $hintedInstance =
                                        ($hintedType->getName() == "Budkit\\Dependency\\Container") ? $container
                                            : $container->createInstance($hintedType->getName());
                                    array_push($parameters, $hintedInstance);

                                }
                            } catch (ReflectionException $reflectionException) {

                                //print_R($hintedInstance); die;

                                throw new ReflectionException(
                                    sprintf('The %1s Class requires parameter number %2s which could not be located. %3s',
                                        $class->getName(), ($i + 1) . " of type {" . $hintedTypeName . "}", $reflectionException->getMessage())
                                );
                            }
                        }
                        //if this parameter has not been passed but we have default values
                        if ($parameter->isDefaultValueAvailable()) {
                            array_push($parameters, $parameter->getDefaultValue());
                        }
                    }
                }

                //var_dump($class, $parameters, "<br />");
                return $class->newInstanceArgs($parameters);
            }

            return $class->newInstanceWithoutConstructor();
        };
    }
845761
public static MethodDescriptor buildHiddenMethodDescriptor(
    Class actionClass, String methodName, String[] parameterNames, Class[] parameterTypes )
  {
    MethodDescriptor md = _buildMethodDescriptor( actionClass, methodName, parameterNames, parameterTypes, parameterTypes );
    md.setHidden( true );
    return md;
  }
275858
private function parseCastParamaters($paramaters)
    {
        foreach ($paramaters as &$value) {
            // Local callable method. ($someMethod())
            if (substr($value, 0, 1) === '$' && stripos($value, '()') !== false) {
                $method = substr($value, 1, -2);
                $value = is_callable([$this, $method]) ? $this->{$method}() : null;

            // Local attribute. ($some_attribute)
            } elseif (substr($value, 0, 1) === '$') {
                $key = substr($value, 1);
                $value = $this->{$key};

            // Callable function (eg helper). (some_function())
            } elseif (stripos($value, '()') !== false) {
                $method = substr($value, 0, -2);
                $value = is_callable($method) ? $method() : null;
            }

            // String value.
        }

        return $paramaters;
    }
966867
public static boolean hasMethod(Class<?> targetClass, String methodName, Class... parameterTypes) {
        try {
            targetClass.getMethod(methodName, parameterTypes);
            return true;
        } catch (NoSuchMethodException e) {
            return false;
        }
    }
690388
public function match(
        /*# string */ $httpMethod,
        /*# string */ $uriPath,
        array $parameters = []
    )/*# :  bool */ {
        $this->initResult($httpMethod, $uriPath);
        $this->getResult()->setParameters($parameters);

        $param = ['result' => $this->result];
        if ($this->trigger(self::EVENT_BEFORE_MATCH, $param) &&
            $this->matchWithCollectors() &&
            $this->trigger(self::EVENT_AFTER_MATCH, $param)
        ) {
            return true;
        }
        return false;
    }