Emarref\Jwt\Token\PropertyList::jsonSerialize PHP Method

jsonSerialize() public method

public jsonSerialize ( ) : string
return 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

Beispiel #1
0
 /**
  * @return string
  */
 public function jsonSerialize()
 {
     return $this->propertyList->jsonSerialize();
 }