Skip to content

Commit 23f0a64

Browse files
committed
Add ensureDelete method
1 parent fab1e42 commit 23f0a64

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/Controllers/ApiController.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,4 +435,16 @@ public function ensurePOST()
435435
$this->httpError(400, 'Request must be provided as a POST request');
436436
}
437437
}
438+
439+
/**
440+
* @throws HTTPResponse_Exception
441+
*/
442+
public function ensureDelete(): void
443+
{
444+
if ($this->request->isDELETE()) {
445+
return;
446+
}
447+
448+
$this->httpError(400, 'Request must be provided as a DELETE request');
449+
}
438450
}

0 commit comments

Comments
 (0)