Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor routing to a pattern-based implementation #110

Closed
wants to merge 7 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Move CannotRoute to web package, removing web.routing package alltoge…
…ther
thekid committed Mar 30, 2024
commit 0813ad67a069d4b9dbac6f0418dd2bf4f0c5918e
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php namespace web\routing;
<?php namespace web;

class CannotRoute extends \web\Error {
class CannotRoute extends Error {

public function __construct($request) {
parent::__construct(404, 'Cannot route request to '.$request->uri()->path());
1 change: 0 additions & 1 deletion src/main/php/web/Routing.class.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php namespace web;

use web\handler\Call;
use web\routing\CannotRoute;

/**
* Routing takes care of directing the request to the correct target
3 changes: 1 addition & 2 deletions src/test/php/web/unittest/RoutingTest.class.php
Original file line number Diff line number Diff line change
@@ -2,8 +2,7 @@

use test\{Assert, Expect, Test, Values};
use web\io\{TestInput, TestOutput};
use web\routing\{CannotRoute, Target};
use web\{Application, Environment, Filters, Handler, Request, Response, Route, Routing};
use web\{Application, Environment, Filters, Handler, Request, Response, CannotRoute, Routing};

class RoutingTest {
private $handlers;