Skip to content

Commit b0e1e63

Browse files
authored
Merge pull request #1 from thats4shaw/feature/ensure-delete
Add ensureDelete method
2 parents fab1e42 + 23f0a64 commit b0e1e63

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)