private function getProperty(string $name): \ReflectionProperty
    {
        $class = $this->getReflection();

        # See if the literal class has this property
        if ($class->hasProperty($name)) {
            return $class->getProperty($name);
        }

        # If not this class then check its parents
        $parent = $class;
        while (true) {
            $parent = $parent->getParentClass();
            if (!$parent) {
                break;
            }

            if ($parent->hasProperty($name)) {
                return $parent->getProperty($name);
            }
        }

        # We didn't find the property, but use this to give a sensible error
        return $class->getProperty($name);
    }