public function getMethods(?int $filter = null) : array
    {
        if ($filter === null) {
            return array_values($this->getMethodsIndexedByName());
        }

        return array_values(
            array_filter(
                $this->getMethodsIndexedByName(),
                static function (ReflectionMethod $method) use ($filter) : bool {
                    return (bool) ($filter & $method->getModifiers());
                }
            )
        );
    }
public function getMethods(?int $filter = null) : array
    {
        if ($filter === null) {
            return array_values($this->getMethodsIndexedByName());
        }

        return array_values(
            array_filter(
                $this->getMethodsIndexedByName(),
                static function (ReflectionMethod $method) use ($filter) : bool {
                    return (bool) ($filter & $method->getModifiers());
                }
            )
        );
    }
public function getMethods ( ? int $ filter = null ) : array { if ( $ filter === null ) { return array_values ( $ this -> getMethodsIndexedByName ( ) ) ; } return array_values ( array_filter ( $ this -> getMethodsIndexedByName ( ) , static function ( ReflectionMethod $ method ) use ( $ filter ) : bool { return ( bool ) ( $ filter & $ method -> getModifiers ( ) ) ; } ) ) ; }
Fetch an array of all methods for this class.

Filter the results to include only methods with certain attributes. Defaults
to no filtering.
Any combination of \ReflectionMethod::IS_STATIC,
\ReflectionMethod::IS_PUBLIC,
\ReflectionMethod::IS_PROTECTED,
\ReflectionMethod::IS_PRIVATE,
\ReflectionMethod::IS_ABSTRACT,
\ReflectionMethod::IS_FINAL.
For example if $filter = \ReflectionMethod::IS_PUBLIC | \ReflectionMethod::IS_FINAL
the only the final public methods will be returned

@return ReflectionMethod[]
Fetch an array of all methods for this class .