src/lapistano/ProxyObject/Generator.php
protected static function generateProxiedPropertyDefinition($templateDir, \ReflectionProperty $property,
                                                                \ReflectionClass $class)
    {
        $template = self::createTemplateObject(
            $templateDir . 'proxied_property.tpl'
        );

        $property->setAccessible(true);
        $properties = $class->getDefaultProperties();
        $value = $properties[$property->getName()];

        if ($value === (array)$value) {
            $value = self::arrayToString($value);
            $value = sprintf(' = array(%s)', $value);
        } else {
            if ($value === (string)$value) {
                $value = sprintf(' = \'%s\'', $value);
            } else {
                if (is_object($value)) {
                    $value = '';
                } else {
                    if ($value === (float)$value) {
                        $value = sprintf(' = %f', $value);
                    }
                }
            }
        }

        $template->setVar(
            array(
                'keyword' => $property->isStatic() ? 'static ' : '',
                'property_name' => $property->getName(),
                'property_value' => $value
            )
        );

        return $template->render();
    }
protected static function generateProxiedPropertyDefinition($templateDir, \ReflectionProperty $property,
                                                                \ReflectionClass $class)
    {
        $template = self::createTemplateObject(
            $templateDir . 'proxied_property.tpl'
        );

        $property->setAccessible(true);
        $properties = $class->getDefaultProperties();
        $value = $properties[$property->getName()];

        if ($value === (array)$value) {
            $value = self::arrayToString($value);
            $value = sprintf(' = array(%s)', $value);
        } else {
            if ($value === (string)$value) {
                $value = sprintf(' = \'%s\'', $value);
            } else {
                if (is_object($value)) {
                    $value = '';
                } else {
                    if ($value === (float)$value) {
                        $value = sprintf(' = %f', $value);
                    }
                }
            }
        }

        $template->setVar(
            array(
                'keyword' => $property->isStatic() ? 'static ' : '',
                'property_name' => $property->getName(),
                'property_value' => $value
            )
        );

        return $template->render();
    }
Generates the definition of a method to be proxied.

@param string              $templateDir Location of the templates to be used to create the proxy.
@param \ReflectionProperty $property    Name of the property to be reflected.
@param \ReflectionClass    $class       Name of the class to be reflected.

@return array Information about the method to be proxied.