You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
By default RouteCollection::$HTTPVerb is not set, nor does the constructor attempt to set it. This means that calling getHTTPVerb() on a "vanilla" instance will cause the following error:
TypeError: Return value of CodeIgniter\Router\RouteCollection::getHTTPVerb() must be of the type string, null returned
/var/www/project/vendor/codeigniter4/codeigniter4/system/Router/RouteCollection.php:552
/var/www/project/codeigniter4/system/Router/RouteCollection.php:496
/var/www/project/tests/feature/FeatureTest.php:13
/var/www/project/vendor/phpunit/phpunit/src/TextUI/Command.php:142
/var/www/project/vendor/phpunit/phpunit/src/TextUI/Command.php:95
To recreate simply call service('routes', false')->getHTTPVerb().
CodeIgniter 4 version develop
Affected module(s)
RouteCollection
Expected behavior, and steps to reproduce if appropriate
I wonder if a RouteCollection even needs to know the "active verb"? Seems like it should always be requested externally. Router already provides it albeit, ironically, from RouteCollection itself:
Describe the bug
By default
RouteCollection::$HTTPVerb
is not set, nor does the constructor attempt to set it. This means that callinggetHTTPVerb()
on a "vanilla" instance will cause the following error:To recreate simply call
service('routes', false')->getHTTPVerb()
.CodeIgniter 4 version
develop
Affected module(s)
RouteCollection
Expected behavior, and steps to reproduce if appropriate
I wonder if a
RouteCollection
even needs to know the "active verb"? Seems like it should always be requested externally.Router
already provides it albeit, ironically, fromRouteCollection
itself:CodeIgniter4/system/Router/Router.php
Line 373 in 3fd3863
The text was updated successfully, but these errors were encountered: