-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BC BREAK! Use FQCN by default for controller and action.
Instead of converting pretty names to controller names automatically, this needs to be done explicitly by passing a callback to the Invoker contructor. Closes #6
- Loading branch information
Showing
15 changed files
with
233 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
tests/unit/Generator/expected/generate-function-test-function-ns.phps
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Generated; | ||
|
||
/** | ||
* This function is generated by SwitchRoute. | ||
* Do not modify it manually. Any changes will be overwritten. | ||
*/ | ||
function route_generate_function_test_function_ns(string $method, string $path) | ||
{ | ||
$segments = $path === "/" ? [] : explode("/", trim($path, "/")); | ||
$allowedMethods = []; | ||
|
||
switch ($segments[0] ?? "\0") { | ||
case "\0": | ||
$allowedMethods = ['GET']; | ||
switch ($method) { | ||
case 'GET': | ||
return info(); | ||
} | ||
break 1; | ||
} | ||
|
||
return false; | ||
} |
Oops, something went wrong.