value) { return $this->value; } if ( $context->options->mode === 'parse' && $value instanceof self && $value->value === $this->value ) { return $this->value; } if (!\is_string($value)) { $context->addViolation('Expected token string.', 'invalid_type'); return $value; } $context->addViolation(\sprintf('Expected token "%s".', $this->value), 'invalid_token'); return $value; } /** * Returns the JSON-serializable representation. */ public function jsonSerialize(): string { return $this->value; } /** * Returns the canonical string representation. */ public function __toString(): string { return $this->value; } }