private static function _encodeConstants(\ReflectionClass $cls)
    {
        $result    = "constants : {";
        $constants = $cls->getConstants();

        $tmpArray = array();
        if (!empty($constants)) {
            foreach ($constants as $key => $value) {
                $tmpArray[] = "$key: " . self::encode($value);
            }

            $result .= implode(', ', $tmpArray);
        }

        return $result . "}";
    }
private static function _encodeConstants(\ReflectionClass $cls)
    {
        $result    = "constants : {";
        $constants = $cls->getConstants();

        $tmpArray = array();
        if (!empty($constants)) {
            foreach ($constants as $key => $value) {
                $tmpArray[] = "$key: " . self::encode($value);
            }

            $result .= implode(', ', $tmpArray);
        }

        return $result . "}";
    }
private static function _encodeConstants ( \ ReflectionClass $ cls ) { $ result = "constants : {" ; $ constants = $ cls -> getConstants ( ) ; $ tmpArray = array ( ) ; if ( ! empty ( $ constants ) ) { foreach ( $ constants as $ key => $ value ) { $ tmpArray [ ] = "$key: " . self :: encode ( $ value ) ; } $ result .= implode ( ', ' , $ tmpArray ) ; } return $ result . "}" ; }
Encode the constants associated with the \ReflectionClass
parameter. The encoding format is based on the class2 format

@param \ReflectionClass $cls
@return string Encoded constant block in class2 format
Encode the constants associated with the \ ReflectionClass parameter . The encoding format is based on the class2 format