Emarref\Jwt\Token\PropertyList::jsonSerialize PHP Метод

jsonSerialize() публичный Метод

public jsonSerialize ( ) : string
Результат string
    public function jsonSerialize()
    {
        $properties = new \stdClass();
        foreach ($this->properties as $property) {
            $name = $property->getName();
            $value = $property->getValue();
            if (empty($name) || empty($value)) {
                continue;
            }
            $properties->{$name} = $value;
        }
        return json_encode($properties);
    }

Usage Example

Пример #1
0
 /**
  * @return string
  */
 public function jsonSerialize()
 {
     return $this->propertyList->jsonSerialize();
 }