Skip to content

Commit

Permalink
Merge pull request #3027 from edudobay/fix_FastRoute_dispatcher_and_d…
Browse files Browse the repository at this point in the history
…ata_generator

Fix: FastRoute dispatcher and data generator should match
  • Loading branch information
l0gicgate authored Nov 30, 2020
2 parents 8dbe684 + e188fa3 commit 372ffd1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Slim/Routing/Dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Slim\Routing;

use FastRoute\DataGenerator\GroupCountBased;
use FastRoute\RouteCollector as FastRouteCollector;
use FastRoute\RouteParser\Std;
use Slim\Interfaces\DispatcherInterface;
Expand Down Expand Up @@ -50,13 +51,15 @@ protected function createDispatcher(): FastRouteDispatcher
if ($cacheFile) {
/** @var FastRouteDispatcher $dispatcher */
$dispatcher = \FastRoute\cachedDispatcher($routeDefinitionCallback, [
'dataGenerator' => GroupCountBased::class,
'dispatcher' => FastRouteDispatcher::class,
'routeParser' => new Std(),
'cacheFile' => $cacheFile,
]);
} else {
/** @var FastRouteDispatcher $dispatcher */
$dispatcher = \FastRoute\simpleDispatcher($routeDefinitionCallback, [
'dataGenerator' => GroupCountBased::class,
'dispatcher' => FastRouteDispatcher::class,
'routeParser' => new Std(),
]);
Expand Down

0 comments on commit 372ffd1

Please # to comment.