protected static function getReflectionClassWithProperty($class, $propertyName)
    {
        Assert::string($class, 'First argument to Reflection::getReflectionClassWithProperty must be string. Variable of type "%s" was given.');
        Assert::classExists($class, 'Could not find class "%s"');

        $refl = new \ReflectionClass($class);
        if ($refl->hasProperty($propertyName)) {
            return $refl;
        }

        if (false === $parent = get_parent_class($class)) {
            // No more parents
            return;
        }

        return self::getReflectionClassWithProperty($parent, $propertyName);
    }
protected static function getReflectionClassWithProperty($class, $propertyName)
    {
        Assert::string($class, 'First argument to Reflection::getReflectionClassWithProperty must be string. Variable of type "%s" was given.');
        Assert::classExists($class, 'Could not find class "%s"');

        $refl = new \ReflectionClass($class);
        if ($refl->hasProperty($propertyName)) {
            return $refl;
        }

        if (false === $parent = get_parent_class($class)) {
            // No more parents
            return;
        }

        return self::getReflectionClassWithProperty($parent, $propertyName);
    }
protected static function getReflectionClassWithProperty ( $ class , $ propertyName ) { Assert :: string ( $ class , 'First argument to Reflection::getReflectionClassWithProperty must be string. Variable of type "%s" was given.' ) ; Assert :: classExists ( $ class , 'Could not find class "%s"' ) ; $ refl = new \ ReflectionClass ( $ class ) ; if ( $ refl -> hasProperty ( $ propertyName ) ) { return $ refl ; } if ( false === $ parent = get_parent_class ( $ class ) ) { // No more parents return ; } return self :: getReflectionClassWithProperty ( $ parent , $ propertyName ) ; }
Get a reflection class that has this property.

@param string $class
@param string $propertyName

@return \ReflectionClass|null

@throws \InvalidArgumentException
Get a reflection class that has this property .