src/Reflection/ReflectionClass.php
public function getImmediateMethods(?int $filter = null) : array
    {
        /** @var ReflectionMethod[] $methods */
        $methods = array_map(
            function (ClassMethod $methodNode) : ReflectionMethod {
                return ReflectionMethod::createFromNode(
                    $this->reflector,
                    $methodNode,
                    $this->declaringNamespace,
                    $this,
                    $this
                );
            },
            $this->node->getMethods()
        );

        $methodsByName = [];

        foreach ($methods as $method) {
            if ($filter !== null && ! ($filter & $method->getModifiers())) {
                continue;
            }

            $methodsByName[$method->getName()] = $method;
        }

        return $methodsByName;
    }
public function getImmediateMethods(?int $filter = null) : array
    {
        /** @var ReflectionMethod[] $methods */
        $methods = array_map(
            function (ClassMethod $methodNode) : ReflectionMethod {
                return ReflectionMethod::createFromNode(
                    $this->reflector,
                    $methodNode,
                    $this->declaringNamespace,
                    $this,
                    $this
                );
            },
            $this->node->getMethods()
        );

        $methodsByName = [];

        foreach ($methods as $method) {
            if ($filter !== null && ! ($filter & $method->getModifiers())) {
                continue;
            }

            $methodsByName[$method->getName()] = $method;
        }

        return $methodsByName;
    }
Get only the methods that this class implements (i.e. do not search
up parent classes etc.)

@see ReflectionClass::getMethods for the usage of $filter

@return ReflectionMethod[]