PhpCss\Ast\Visitor\Overload::getMethodByClass PHP Method

getMethodByClass() protected method

Map the class name of the PhpCssAst instance to a method name, validate if it exists and return it as callback.
protected getMethodByClass ( Ast $object, string $prefix = 'visit' ) : array | null
$object PhpCss\Ast
$prefix string
return array | null
    protected function getMethodByClass(Ast $object, $prefix = 'visit')
    {
        $method = $prefix . substr(str_replace('\\', '', get_class($object)), 9);
        if (method_exists($this, $method)) {
            return array($this, $method);
        } else {
            return NULL;
        }
    }