src/Reflection/ReflectionClass.php
public function getImmediateProperties(?int $filter = null) : array
    {
        if ($this->cachedImmediateProperties === null) {
            $properties = [];
            foreach ($this->node->stmts as $stmt) {
                if (! ($stmt instanceof PropertyNode)) {
                    continue;
                }

                foreach ($stmt->props as $propertyPositionInNode => $propertyNode) {
                    $prop                         = ReflectionProperty::createFromNode(
                        $this->reflector,
                        $stmt,
                        $propertyPositionInNode,
                        $this->declaringNamespace,
                        $this,
                        $this
                    );
                    $properties[$prop->getName()] = $prop;
                }
            }

            $this->cachedImmediateProperties = $properties;
        }

        if ($filter === null) {
            return $this->cachedImmediateProperties;
        }

        return array_filter(
            $this->cachedImmediateProperties,
            static function (ReflectionProperty $property) use ($filter) : bool {
                return (bool) ($filter & $property->getModifiers());
            }
        );
    }
public function getImmediateProperties(?int $filter = null) : array
    {
        if ($this->cachedImmediateProperties === null) {
            $properties = [];
            foreach ($this->node->stmts as $stmt) {
                if (! ($stmt instanceof PropertyNode)) {
                    continue;
                }

                foreach ($stmt->props as $propertyPositionInNode => $propertyNode) {
                    $prop                         = ReflectionProperty::createFromNode(
                        $this->reflector,
                        $stmt,
                        $propertyPositionInNode,
                        $this->declaringNamespace,
                        $this,
                        $this
                    );
                    $properties[$prop->getName()] = $prop;
                }
            }

            $this->cachedImmediateProperties = $properties;
        }

        if ($filter === null) {
            return $this->cachedImmediateProperties;
        }

        return array_filter(
            $this->cachedImmediateProperties,
            static function (ReflectionProperty $property) use ($filter) : bool {
                return (bool) ($filter & $property->getModifiers());
            }
        );
    }
Get only the properties for this specific class (i.e. do not search
up parent classes etc.)

@see ReflectionClass::getProperties() for the usage of filter

@return ReflectionProperty[]