protected function checkAllowedMethods()
{
$availableMethods = $this->methods->getOptions($this->request->getUrl());
if (!$availableMethods || in_array($this->request->method, $availableMethods)) {
return;
}
$allow = implode(', ', $availableMethods);
$this->response->setHeader('Allow', $allow);
throw BadRequestException::methodNotSupported('Method not supported. Available methods: ' . $allow);
}