Skip to content

Commit 441e23f

Browse files
committed
wip: write todo for next plan of attack
1 parent 263f007 commit 441e23f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/Application.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
<?php
22
namespace Gt\WebEngine;
33

4+
use Gt\WebEngine\Debug\Timer;
45
use Gt\WebEngine\Redirection\Redirect;
56

67
class Application {
78
private Redirect $redirect;
9+
private Timer $timer;
810

911
public function __construct(
1012
?Redirect $redirect = null,
@@ -13,6 +15,16 @@ public function __construct(
1315
}
1416

1517
public function start():void {
18+
// Before we start, we check if the current URI should be redirected. If it
19+
// should, we won't go any further into the lifecycle.
1620
$this->redirect->execute();
21+
// The first thing done within the WebEngine lifecycle is start a timer.
22+
// This timer is only used again at the end of the call, when finish() is
23+
// called - at which point the entire duration of the request is logged out (and
24+
// slow requests are highlighted as a NOTICE).
25+
$this->timer = new Timer();
26+
27+
// TODO: Test the timer! Then start some tests on Application (as much as possible in unit tests).
28+
// Then, when tests are passing, begin to reconstruct the Lifecycle in a much more testable way.
1729
}
1830
}

0 commit comments

Comments
 (0)