Skip to content

Commit 42d89a2

Browse files
committed
feat: add trigger_error E_USER_DEPRECATED
1 parent 4b98ddf commit 42d89a2

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

system/Filters/Filters.php

+5
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,11 @@ protected function processMethods()
505505
// @deprecated 4.5.0
506506
// @TODO remove this in the future.
507507
elseif (array_key_exists(strtolower($method), $this->config->methods)) {
508+
@trigger_error(
509+
'Setting lowercase HTTP method key "' . $method . '" is deprecated. Use uppercase HTTP method like "GET".',
510+
E_USER_DEPRECATED
511+
);
512+
508513
$found = true;
509514
$method = strtolower($method);
510515
}

system/Router/RouteCollection.php

+7
Original file line numberDiff line numberDiff line change
@@ -1012,6 +1012,13 @@ public function match(array $verbs = [], string $from = '', $to = '', ?array $op
10121012
}
10131013

10141014
foreach ($verbs as $verb) {
1015+
if ($verb === strtolower($verb)) {
1016+
@trigger_error(
1017+
'Passing lowercase HTTP method "' . $verb . '" is deprecated. Use uppercase HTTP method like "GET".',
1018+
E_USER_DEPRECATED
1019+
);
1020+
}
1021+
10151022
/**
10161023
* @TODO We should use correct uppercase verb.
10171024
* @deprecated 4.5.0

system/Test/FeatureTestTrait.php

+7
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@ protected function withRoutes(?array $routes = null)
5151
$collection->resetRoutes();
5252

5353
foreach ($routes as $route) {
54+
if ($route[0] = strtolower($route[0])) {
55+
@trigger_error(
56+
'Passing lowercase HTTP method "' . $route[0] . '" is deprecated. Use uppercase HTTP method like "GET".',
57+
E_USER_DEPRECATED
58+
);
59+
}
60+
5461
/**
5562
* @TODO For backward compatibility. Remove strtolower() in the future.
5663
* @deprecated 4.5.0

0 commit comments

Comments
 (0)