Ejemplo n.º 1
0
 public function parse(RequestInterface $request, ResponseInterface $response, MapInterface $attributes) : MapInterface
 {
     $start = $this->clock->now();
     if (!$response->headers()->has('Content-Type') || !$response->headers()->get('Content-Type') instanceof ContentType) {
         return $attributes;
     }
     return $attributes->put(self::key(), new Attribute(self::key(), MediaType::fromString((string) $response->headers()->get('Content-Type')->values()->current()), $this->clock->now()->elapsedSince($start)->milliseconds()));
 }
Ejemplo n.º 2
0
 public function __construct(string $mime, int $priority)
 {
     $this->mime = FilesystemMediaType::fromString($mime);
     $this->priority = $priority;
 }