File tree 8 files changed +18
-15
lines changed
8 files changed +18
-15
lines changed Original file line number Diff line number Diff line change 27
27
},
28
28
"autoload" : {
29
29
"psr-4" : {
30
- "Buki\\ " : " src"
30
+ "Buki\\ Router \\ " : " src"
31
31
}
32
32
},
33
33
"autoload-dev" : {
Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
- namespace Buki \Http ;
3
+ namespace Buki \Router \ Http ;
4
4
5
5
abstract class Controller extends Http
6
6
{
Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
- namespace Buki \Http ;
3
+ namespace Buki \Router \ Http ;
4
4
5
5
abstract class Http
6
6
{
Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
- namespace Buki \Http ;
3
+ namespace Buki \Router \ Http ;
4
4
5
5
abstract class Middleware extends Http
6
6
{
Original file line number Diff line number Diff line change 8
8
* @Licence: The MIT License (MIT) - Copyright (c) - http://opensource.org/licenses/MIT
9
9
*/
10
10
11
- namespace Buki ;
11
+ namespace Buki \ Router ;
12
12
13
13
use Buki \Router \RouterCommand ;
14
14
use Buki \Router \RouterException ;
@@ -43,7 +43,7 @@ class Router
43
43
/**
44
44
* Router Version
45
45
*/
46
- const VERSION = '2.0.1 ' ;
46
+ const VERSION = '2.1.0 ' ;
47
47
48
48
/**
49
49
* @var string $baseFolder Pattern definitions for parameters of Route
@@ -558,14 +558,15 @@ protected function response(): Response
558
558
/**
559
559
* Throw new Exception for Router Error
560
560
*
561
- * @param $message
561
+ * @param string $message
562
+ * @param int $statusCode
562
563
*
563
564
* @return RouterException
564
- * @throws
565
+ * @throws Exception
565
566
*/
566
- protected function exception ($ message = '' ): RouterException
567
+ protected function exception ($ message = '' , int $ statusCode = 500 ): RouterException
567
568
{
568
- return new RouterException ($ message );
569
+ return new RouterException ($ message, $ statusCode );
569
570
}
570
571
571
572
/**
Original file line number Diff line number Diff line change 3
3
namespace Buki \Router ;
4
4
5
5
use Closure ;
6
+ use Exception ;
6
7
use ReflectionException ;
7
8
use ReflectionFunction ;
8
9
use ReflectionMethod ;
13
14
class RouterCommand
14
15
{
15
16
/**
16
- * @var RouterCommand|null Class instance variable
17
+ * @var RouterCommand Class instance variable
17
18
*/
18
19
protected static $ instance = null ;
19
20
@@ -359,13 +360,14 @@ protected function sendResponse($response)
359
360
/**
360
361
* Throw new Exception for Router Error
361
362
*
362
- * @param $message
363
+ * @param string $message
364
+ * @param int $statusCode
363
365
*
364
366
* @return RouterException
365
- * @throws
367
+ * @throws Exception
366
368
*/
367
- protected function exception ($ message = '' )
369
+ protected function exception ($ message = '' , $ statusCode = 500 )
368
370
{
369
- return new RouterException ($ message );
371
+ return new RouterException ($ message, $ statusCode );
370
372
}
371
373
}
File renamed without changes.
File renamed without changes.
You can’t perform that action at this time.
0 commit comments