Exakat\Analyzer\Functions\WrongNumberOfArgumentsMethods::analyze PHP Method

analyze() public method

public analyze ( )
    public function analyze()
    {
        $data = new Methods();
        $methods = $data->getMethodsArgsInterval();
        $argsMins = array();
        $argsMaxs = array();
        // Needs to finish the list of methods and their arguments.
        // Currently, classes are not checked.
        foreach ($methods as $method) {
            if ($method['args_min'] > 0) {
                $argsMins[$method['args_min']][] = $method['name'];
            }
            $argsMaxs[$method['args_max']][] = $method['name'];
        }
        // case for methods
        foreach ($argsMins as $nb => $f) {
            $this->atomIs(array('Methodcall', 'Staticmethodcall'))->outIs('METHOD')->codeIs($f)->outIs('ARGUMENTS')->isLess('count', $nb)->back('first');
            $this->prepareQuery();
        }
        foreach ($argsMaxs as $nb => $f) {
            $this->atomIs(array('Methodcall', 'Staticmethodcall'))->outIs('METHOD')->codeIs($f)->outIs('ARGUMENTS')->isMore('count', $nb)->back('first');
            $this->prepareQuery();
        }
    }
WrongNumberOfArgumentsMethods