55 * @subpackage : Kernel Component
66 * @version : 1.0.0
77 * @category : PHP framework
8- * @copyright : (c) 2017 - 2021 JIHAD SINNAOUR <mail@jihadsinnaour.com>
8+ * @copyright : (c) 2017 - 2022 Jihad Sinnaour <mail@jihadsinnaour.com>
99 * @link : https://www.floatphp.com
10- * @license : MIT License
10+ * @license : MIT
1111 *
12- * This file if a part of FloatPHP Framework
12+ * This file if a part of FloatPHP Framework.
1313 */
1414
15+ declare (strict_types=1 );
16+
1517namespace FloatPHP \Kernel ;
1618
17- use FloatPHP \Classes \Http \ Response ;
18- use FloatPHP \ Classes \ Filesystem \TypeCheck ;
19- use FloatPHP \ Classes \ Filesystem \ Stringify ;
20- use FloatPHP \ Classes \ Filesystem \ Arrayify ;
19+ use FloatPHP \Classes \{
20+ Filesystem \ TypeCheck , Filesystem \ Stringify , Filesystem \Arrayify ,
21+ Http \ Response
22+ } ;
2123use FloatPHP \Interfaces \Classes \RouterInterface ;
2224
2325final class Middleware
@@ -30,32 +32,32 @@ final class Middleware
3032 private $ match ;
3133
3234 /**
33- * Middleware system
34- * $router->addMatchTypes(['name'=>'regex']);
35+ * Middleware system.
3536 *
3637 * @param RouterInterface $router
38+ * @see $router->addMatchTypes(['name'=>'regex']);
3739 */
3840 public function __construct (RouterInterface $ router )
3941 {
4042 // Init configuration
4143 $ this ->initConfig ();
4244
43- // prepare router from config
45+ // Prepare router from config
4446 $ router ->setBasePath ($ this ->getBaseRoute ());
4547
46- // set global router
48+ // Set global router
4749 $ router ->addRoutes ($ this ->getRoutes ());
4850
49- // set modules router
51+ // Set modules router
5052 $ module = new Module ();
5153 $ router ->addRoutes ($ module ->getModulesRoutes ());
5254
53- // match request
55+ // Match request
5456 $ this ->match = $ router ->match ();
5557 }
5658
5759 /**
58- * Dispatch request & provide response
60+ * Dispatch request & provide response.
5961 *
6062 * @access public
6163 * @param void
@@ -82,7 +84,7 @@ public function dispatch()
8284 }
8385
8486 /**
85- * If controller is a function
87+ * Whether controller is a function.
8688 *
8789 * @access private
8890 * @param void
@@ -97,7 +99,7 @@ private function isCallable() : bool
9799 }
98100
99101 /**
100- * If controller is a class
102+ * Whether controller is a class.
101103 *
102104 * @access private
103105 * @param void
@@ -112,7 +114,7 @@ private function isClassMethod() : bool
112114 }
113115
114116 /**
115- * Execute callable
117+ * Execute callable.
116118 *
117119 * @access private
118120 * @param void
@@ -486,7 +488,7 @@ private function parsePermissions()
486488 }
487489
488490 /**
489- * Parse request var
491+ * Parse request var.
490492 *
491493 * @access private
492494 * @param void
0 commit comments