Swagger\Annotations\AbstractAnnotation::_identity PHP Méthode

_identity() protected méthode

Helper for generating the identity()
protected _identity ( array $properties ) : string
$properties array
Résultat string
    protected function _identity($properties)
    {
        $fields = [];
        foreach ($properties as $property) {
            $value = $this->{$property};
            if ($value !== null && $value !== UNDEFINED) {
                $fields[] = $property . '=' . (is_string($value) ? '"' . $value . '"' : $value);
            }
        }
        return '@' . str_replace('Swagger\\Annotations\\', 'SWG\\', get_class($this)) . '(' . implode(',', $fields) . ')';
    }

Usage Example

 /** @inheritdoc */
 public function identity()
 {
     return parent::_identity(['name', 'in']);
 }