BetterReflection\Reflection\ReflectionParameter::getDocBlockTypeStrings PHP Méthode

getDocBlockTypeStrings() public méthode

Get the DocBlock type hints as an array of strings.
public getDocBlockTypeStrings ( ) : string[]
Résultat string[]
    public function getDocBlockTypeStrings()
    {
        $stringTypes = [];
        foreach ($this->getDocBlockTypes() as $type) {
            $stringTypes[] = (string) $type;
        }
        return $stringTypes;
    }

Usage Example

Exemple #1
0
 /**
  * @return string
  */
 public function getHints()
 {
     $hints = $this->reflectionParameter->getDocBlockTypeStrings();
     $hints[] = $this->reflectionParameter->getTypeHint();
     $hints = array_filter($hints, 'strlen');
     return implode('|', $hints);
 }