src/lapistano/ProxyObject/Generator.php
protected static function getProxiedProperties($fullClassName, \ReflectionClass $class, array $properties = null)
    {
        $proxiedProperties = '';
        $templateDir = __DIR__ . DIRECTORY_SEPARATOR . 'Generator' . DIRECTORY_SEPARATOR;
        $proxyProperties = $class->getProperties(\ReflectionMethod::IS_PROTECTED | \ReflectionMethod::IS_PRIVATE);

        if (empty($properties)) {
            foreach ($proxyProperties as $property) {
                $proxiedProperties .= self::generateProxiedPropertyDefinition($templateDir, $property, $class);
            }
        } else {

            foreach ($properties as $propertyName) {

                if ($class->hasProperty($propertyName)) {
                    $property = $class->getProperty($propertyName);
                    $proxiedProperties .= self::generateProxiedPropertyDefinition($templateDir, $property, $class);
                    continue;
                }

                throw new GeneratorException(
                    sprintf(
                        'Class "%s" has no protected or private property "%s".', $fullClassName, $propertyName
                    ),
                    GeneratorException::NO_PROTECTED_OR_PRIVATE_PROPERTY_DEFINED
                );
            }
        }

        return $proxiedProperties;
    }
protected static function getProxiedProperties($fullClassName, \ReflectionClass $class, array $properties = null)
    {
        $proxiedProperties = '';
        $templateDir = __DIR__ . DIRECTORY_SEPARATOR . 'Generator' . DIRECTORY_SEPARATOR;
        $proxyProperties = $class->getProperties(\ReflectionMethod::IS_PROTECTED | \ReflectionMethod::IS_PRIVATE);

        if (empty($properties)) {
            foreach ($proxyProperties as $property) {
                $proxiedProperties .= self::generateProxiedPropertyDefinition($templateDir, $property, $class);
            }
        } else {

            foreach ($properties as $propertyName) {

                if ($class->hasProperty($propertyName)) {
                    $property = $class->getProperty($propertyName);
                    $proxiedProperties .= self::generateProxiedPropertyDefinition($templateDir, $property, $class);
                    continue;
                }

                throw new GeneratorException(
                    sprintf(
                        'Class "%s" has no protected or private property "%s".', $fullClassName, $propertyName
                    ),
                    GeneratorException::NO_PROTECTED_OR_PRIVATE_PROPERTY_DEFINED
                );
            }
        }

        return $proxiedProperties;
    }
Generate string representing the set of properties to be reflected.

@param string           $fullClassName
@param \ReflectionClass $class
@param array            $properties

@return string
@throws \lapistano\ProxyObject\GeneratorException