private function getClassMethods(File $phpcsFile, $stackPtr)
    {
        $pointer = $stackPtr;
        $methods = [];

        while (($next = $phpcsFile->findNext(T_FUNCTION, $pointer + 1)) !== false) {
            $modifier = $this->getModifier($phpcsFile, $next);
            if ($this->isPublic($modifier) && !$this->isMagicFunction($phpcsFile->getDeclarationName($next))) {
                $methods[] = $next;
            }

            $pointer = $next;
        }

        return $methods;
    }