src/Analyse/Callback/Iterate/ThroughProperties.php
public function callMe()
    {
        $output = $this->dispatchStartEvent();

        // I need to preprocess them, since I do not want to render a
        // reflection property.
        /** @var \Brainworxx\Krexx\Service\Reflection\ReflectionClass $ref */
        $ref = $this->parameters[static::PARAM_REF];

        foreach ($this->parameters[static::PARAM_DATA] as $refProperty) {
            // Check memory and runtime.
            if ($this->pool->emergencyHandler->checkEmergencyBreak() === true) {
                return '';
            }

            // Stitch together our additional info about the data:
            // public access, protected access, private access and info if it was
            // inherited from somewhere.
            $additional = $this->getAdditionalData($refProperty, $ref);

            // Every other additional string requires a special connector,
            // so we do this here.
            $connectorType = Connectors::NORMAL_PROPERTY;
            /** @var \ReflectionProperty $refProperty */
            $propName = $refProperty->getName();

            // Static properties are very special.
            if ($refProperty->isStatic() === true) {
                $connectorType = Connectors::STATIC_PROPERTY;
                // There is always a $ in front of a static property.
                $propName = '$' . $propName;
            }

            $value = $ref->retrieveValue($refProperty);

            if (isset($refProperty->isUnset) === true) {
                $additional .= 'unset ';
            }

            if (isset($refProperty->isUndeclared) === true) {
                // The property 'isUndeclared' is not a part of the reflectionProperty.
                // @see \Brainworxx\Krexx\Analyse\Callback\Analyse\Objects
                $additional .= 'dynamic property ';

                // Check for very special chars in there.
                // AFAIK this is only possible for dynamically declared properties
                // which can never be static.
                if ($this->isPropertyNameNormal($propName) === false) {
                    $propName = $this->pool->encodingService->encodeStringForCodeGeneration($propName);
                    $connectorType = Connectors::SPECIAL_CHARS_PROP;
                }

                // There is no comment ora declaration place for a dynamic property.
                $comment = '';
                $declarationPlace = 'undeclared';
            } else {
                // Since we are dealing with a declared Property here, we can
                // get the comment and the declaration place.
                $comment = $this->pool
                    ->createClass('Brainworxx\\Krexx\\Analyse\\Comment\\Properties')
                    ->getComment($refProperty);
                $declarationPlace = $this->retrieveDeclarationPlace($refProperty);
            }

            // Stitch together our model
            $output .= $this->pool->routing->analysisHub(
                $this->dispatchEventWithModel(
                    __FUNCTION__ . static::EVENT_MARKER_END,
                    $this->pool->createClass('Brainworxx\\Krexx\\Analyse\\Model')
                        ->setData($value)
                        ->setName($this->pool->encodingService->encodeString($propName))
                        ->addToJson(static::META_COMMENT, $comment)
                        ->addToJson(static::META_DECLARED_IN, $declarationPlace)
                        ->setAdditional($additional)
                        ->setConnectorType($connectorType)
                        ->setIsPublic($refProperty->isPublic())
                )
            );
        }

        return $output;
    }
public function callMe()
    {
        $output = $this->dispatchStartEvent();

        // I need to preprocess them, since I do not want to render a
        // reflection property.
        /** @var \Brainworxx\Krexx\Service\Reflection\ReflectionClass $ref */
        $ref = $this->parameters[static::PARAM_REF];

        foreach ($this->parameters[static::PARAM_DATA] as $refProperty) {
            // Check memory and runtime.
            if ($this->pool->emergencyHandler->checkEmergencyBreak() === true) {
                return '';
            }

            // Stitch together our additional info about the data:
            // public access, protected access, private access and info if it was
            // inherited from somewhere.
            $additional = $this->getAdditionalData($refProperty, $ref);

            // Every other additional string requires a special connector,
            // so we do this here.
            $connectorType = Connectors::NORMAL_PROPERTY;
            /** @var \ReflectionProperty $refProperty */
            $propName = $refProperty->getName();

            // Static properties are very special.
            if ($refProperty->isStatic() === true) {
                $connectorType = Connectors::STATIC_PROPERTY;
                // There is always a $ in front of a static property.
                $propName = '$' . $propName;
            }

            $value = $ref->retrieveValue($refProperty);

            if (isset($refProperty->isUnset) === true) {
                $additional .= 'unset ';
            }

            if (isset($refProperty->isUndeclared) === true) {
                // The property 'isUndeclared' is not a part of the reflectionProperty.
                // @see \Brainworxx\Krexx\Analyse\Callback\Analyse\Objects
                $additional .= 'dynamic property ';

                // Check for very special chars in there.
                // AFAIK this is only possible for dynamically declared properties
                // which can never be static.
                if ($this->isPropertyNameNormal($propName) === false) {
                    $propName = $this->pool->encodingService->encodeStringForCodeGeneration($propName);
                    $connectorType = Connectors::SPECIAL_CHARS_PROP;
                }

                // There is no comment ora declaration place for a dynamic property.
                $comment = '';
                $declarationPlace = 'undeclared';
            } else {
                // Since we are dealing with a declared Property here, we can
                // get the comment and the declaration place.
                $comment = $this->pool
                    ->createClass('Brainworxx\\Krexx\\Analyse\\Comment\\Properties')
                    ->getComment($refProperty);
                $declarationPlace = $this->retrieveDeclarationPlace($refProperty);
            }

            // Stitch together our model
            $output .= $this->pool->routing->analysisHub(
                $this->dispatchEventWithModel(
                    __FUNCTION__ . static::EVENT_MARKER_END,
                    $this->pool->createClass('Brainworxx\\Krexx\\Analyse\\Model')
                        ->setData($value)
                        ->setName($this->pool->encodingService->encodeString($propName))
                        ->addToJson(static::META_COMMENT, $comment)
                        ->addToJson(static::META_DECLARED_IN, $declarationPlace)
                        ->setAdditional($additional)
                        ->setConnectorType($connectorType)
                        ->setIsPublic($refProperty->isPublic())
                )
            );
        }

        return $output;
    }
public function callMe ( ) { $ output = $ this -> dispatchStartEvent ( ) ; // I need to preprocess them, since I do not want to render a // reflection property. /** @var \Brainworxx\Krexx\Service\Reflection\ReflectionClass $ref */ $ ref = $ this -> parameters [ static :: PARAM_REF ] ; foreach ( $ this -> parameters [ static :: PARAM_DATA ] as $ refProperty ) { // Check memory and runtime. if ( $ this -> pool -> emergencyHandler -> checkEmergencyBreak ( ) === true ) { return '' ; } // Stitch together our additional info about the data: // public access, protected access, private access and info if it was // inherited from somewhere. $ additional = $ this -> getAdditionalData ( $ refProperty , $ ref ) ; // Every other additional string requires a special connector, // so we do this here. $ connectorType = Connectors :: NORMAL_PROPERTY ; /** @var \ReflectionProperty $refProperty */ $ propName = $ refProperty -> getName ( ) ; // Static properties are very special. if ( $ refProperty -> isStatic ( ) === true ) { $ connectorType = Connectors :: STATIC_PROPERTY ; // There is always a $ in front of a static property. $ propName = '$' . $ propName ; } $ value = $ ref -> retrieveValue ( $ refProperty ) ; if ( isset ( $ refProperty -> isUnset ) === true ) { $ additional .= 'unset ' ; } if ( isset ( $ refProperty -> isUndeclared ) === true ) { // The property 'isUndeclared' is not a part of the reflectionProperty. // @see \Brainworxx\Krexx\Analyse\Callback\Analyse\Objects $ additional .= 'dynamic property ' ; // Check for very special chars in there. // AFAIK this is only possible for dynamically declared properties // which can never be static. if ( $ this -> isPropertyNameNormal ( $ propName ) === false ) { $ propName = $ this -> pool -> encodingService -> encodeStringForCodeGeneration ( $ propName ) ; $ connectorType = Connectors :: SPECIAL_CHARS_PROP ; } // There is no comment ora declaration place for a dynamic property. $ comment = '' ; $ declarationPlace = 'undeclared' ; } else { // Since we are dealing with a declared Property here, we can // get the comment and the declaration place. $ comment = $ this -> pool -> createClass ( 'Brainworxx\\Krexx\\Analyse\\Comment\\Properties' ) -> getComment ( $ refProperty ) ; $ declarationPlace = $ this -> retrieveDeclarationPlace ( $ refProperty ) ; } // Stitch together our model $ output .= $ this -> pool -> routing -> analysisHub ( $ this -> dispatchEventWithModel ( __FUNCTION__ . static :: EVENT_MARKER_END , $ this -> pool -> createClass ( 'Brainworxx\\Krexx\\Analyse\\Model' ) -> setData ( $ value ) -> setName ( $ this -> pool -> encodingService -> encodeString ( $ propName ) ) -> addToJson ( static :: META_COMMENT , $ comment ) -> addToJson ( static :: META_DECLARED_IN , $ declarationPlace ) -> setAdditional ( $ additional ) -> setConnectorType ( $ connectorType ) -> setIsPublic ( $ refProperty -> isPublic ( ) ) ) ) ; } return $ output ; }
Renders the properties of a class.

@return string
The generated markup.
Renders the properties of a class .