public function canConsume(MediaType $type) : bool { if ($this->consumes === null) { return true; } foreach ($this->consumes as $acceptable) { if ($type->is($acceptable)) { return true; } } return false; }