WsdlToPhp\PackageGenerator\Generator\Utils::cleanComment PHP Method

cleanComment() public static method

Clean comment
public static cleanComment ( string $comment, string $glueSeparator = ',', boolean $uniqueValues = true ) : string
$comment string the comment to clean
$glueSeparator string ths string to use when gathering values
$uniqueValues boolean indicates if comment values must be unique or not
return string
    public static function cleanComment($comment, $glueSeparator = ',', $uniqueValues = true)
    {
        if (!is_scalar($comment) && !is_array($comment)) {
            return '';
        }
        return trim(str_replace('*/', '*[:slash:]', is_scalar($comment) ? $comment : implode($glueSeparator, $uniqueValues ? array_unique($comment) : $comment)));
    }

Usage Example

Beispiel #1
0
 /**
  * @param string $metaName
  * @param mixed $metaValue
  * @return string|null
  */
 public static function getMetaValueAnnotation($metaName, $metaValue)
 {
     $meta = null;
     if (is_array($metaValue)) {
         $metaValue = implode(' | ', $metaValue);
     }
     $metaValue = GeneratorUtils::cleanComment($metaValue, ', ', stripos($metaName, 'SOAPHeader') === false);
     if (is_scalar($metaValue)) {
         $meta = sprintf("\t- %s: %s", $metaName, $metaValue);
     }
     return $meta;
 }
All Usage Examples Of WsdlToPhp\PackageGenerator\Generator\Utils::cleanComment