- The
RoutePathCompilationException::createFromRoute()
method signature has changed to allow bothException
andThrowable
types with dual support for PHP 5 and PHP 7 - The 4th parameter to the callbacks supported by
Klein#onError
will now be able to receiveThrowable
types under PHP 7
- The
HeaderDataCollection::normalizeName()
method has been deprecated in favor of using new normalization options (via constant switches) and other more specific methods on the same class
- Three of the Klein internal callback attributes have changed both name and data structure. These attributes are protected, so the effect will only be felt by users that have extended and/or overwritten Klein's internal behaviors. The following changes were made:
Klein#errorCallbacks
was renamed toKlein#error_callbacks
and it's array data-structure was changed to use anSplStack
Klein#httpErrorCallbacks
was renamed toKlein#http_error_callbacks
and it's array data-structure was changed to use anSplStack
Klein#afterFilterCallbacks
was renamed toKlein#after_filter_callbacks
and it's array data-structure was changed to use anSplQueue
Validator#defaultAdded
was renamed toValidator#default_added
- Handling 404 and 405 errors with a specially registered route callback is now deprecated. It's now suggested to use Klein's new
onHttpError()
method instead. - Autoloading the library with Composer no longer utilizes the PSR-0 spec. The composer autoloader now uses PSR-4.
- Some of the route callback params have changed. This will effect any route definitions with callbacks using the more advanced parameters.
- The old params were (in order):
Request $request
Response $response
Service $service
App $app
int $matched
array $methods_matched
- The new params are (in order):
Request $request
Response $response
Service $service
App $app
Klein $klein
RouteCollection $matched
array $methods_matched
- The old params were (in order):
- Non-match routes (routes that are wildcard and shouldn't consider as "matches") will no longer be considered as part of the "methods matched" array, since they aren't supposed to be matches in the first place
- This may have implications for users that have created "match-all" OPTIONS method routes, as the OPTIONS method will no longer be considered a match.
- If you'd like to conserve the old match behavior, you can simply mark the route as one that should be counted as a match with
$route->setCountMatch(true)