protected function serializeProperty(Property $property)
    {
        if ($property->group) {
            $this->cWrite('default', $property->group);
            $this->cWrite('red', '.');
        }

        $this->cWrite('yellow', $property->name);

        foreach ($property->parameters as $param) {
            $this->cWrite('red', ';');
            $this->cWrite('blue', $param->serialize());
        }
        $this->cWrite('red', ':');

        if ($property instanceof Property\Binary) {
            $this->cWrite('default', 'embedded binary stripped. ('.strlen($property->getValue()).' bytes)');
        } else {
            $parts = $property->getParts();
            $first1 = true;
            // Looping through property values
            foreach ($parts as $part) {
                if ($first1) {
                    $first1 = false;
                } else {
                    $this->cWrite('red', $property->delimiter);
                }
                $first2 = true;
                // Looping through property sub-values
                foreach ((array) $part as $subPart) {
                    if ($first2) {
                        $first2 = false;
                    } else {
                        // The sub-value delimiter is always comma
                        $this->cWrite('red', ',');
                    }

                    $subPart = strtr(
                        $subPart,
                        [
                            '\\' => $this->colorize('purple', '\\\\', 'green'),
                            ';' => $this->colorize('purple', '\;', 'green'),
                            ',' => $this->colorize('purple', '\,', 'green'),
                            "\n" => $this->colorize('purple', "\\n\n\t", 'green'),
                            "\r" => '',
                        ]
                    );

                    $this->cWrite('green', $subPart);
                }
            }
        }
        $this->cWrite('default', "\n");
    }
protected function serializeProperty(Property $property)
    {
        if ($property->group) {
            $this->cWrite('default', $property->group);
            $this->cWrite('red', '.');
        }

        $this->cWrite('yellow', $property->name);

        foreach ($property->parameters as $param) {
            $this->cWrite('red', ';');
            $this->cWrite('blue', $param->serialize());
        }
        $this->cWrite('red', ':');

        if ($property instanceof Property\Binary) {
            $this->cWrite('default', 'embedded binary stripped. ('.strlen($property->getValue()).' bytes)');
        } else {
            $parts = $property->getParts();
            $first1 = true;
            // Looping through property values
            foreach ($parts as $part) {
                if ($first1) {
                    $first1 = false;
                } else {
                    $this->cWrite('red', $property->delimiter);
                }
                $first2 = true;
                // Looping through property sub-values
                foreach ((array) $part as $subPart) {
                    if ($first2) {
                        $first2 = false;
                    } else {
                        // The sub-value delimiter is always comma
                        $this->cWrite('red', ',');
                    }

                    $subPart = strtr(
                        $subPart,
                        [
                            '\\' => $this->colorize('purple', '\\\\', 'green'),
                            ';' => $this->colorize('purple', '\;', 'green'),
                            ',' => $this->colorize('purple', '\,', 'green'),
                            "\n" => $this->colorize('purple', "\\n\n\t", 'green'),
                            "\r" => '',
                        ]
                    );

                    $this->cWrite('green', $subPart);
                }
            }
        }
        $this->cWrite('default', "\n");
    }
protected function serializeProperty ( Property $ property ) { if ( $ property -> group ) { $ this -> cWrite ( 'default' , $ property -> group ) ; $ this -> cWrite ( 'red' , '.' ) ; } $ this -> cWrite ( 'yellow' , $ property -> name ) ; foreach ( $ property -> parameters as $ param ) { $ this -> cWrite ( 'red' , ';' ) ; $ this -> cWrite ( 'blue' , $ param -> serialize ( ) ) ; } $ this -> cWrite ( 'red' , ':' ) ; if ( $ property instanceof Property \ Binary ) { $ this -> cWrite ( 'default' , 'embedded binary stripped. (' . strlen ( $ property -> getValue ( ) ) . ' bytes)' ) ; } else { $ parts = $ property -> getParts ( ) ; $ first1 = true ; // Looping through property values foreach ( $ parts as $ part ) { if ( $ first1 ) { $ first1 = false ; } else { $ this -> cWrite ( 'red' , $ property -> delimiter ) ; } $ first2 = true ; // Looping through property sub-values foreach ( ( array ) $ part as $ subPart ) { if ( $ first2 ) { $ first2 = false ; } else { // The sub-value delimiter is always comma $ this -> cWrite ( 'red' , ',' ) ; } $ subPart = strtr ( $ subPart , [ '\\' => $ this -> colorize ( 'purple' , '\\\\' , 'green' ) , ';' => $ this -> colorize ( 'purple' , '\;' , 'green' ) , ',' => $ this -> colorize ( 'purple' , '\,' , 'green' ) , "\n" => $ this -> colorize ( 'purple' , "\\n\n\t" , 'green' ) , "\r" => '' , ] ) ; $ this -> cWrite ( 'green' , $ subPart ) ; } } } $ this -> cWrite ( 'default' , "\n" ) ; }
Colorizes a property.

@param Property $property
Colorizes a property .