File tree 6 files changed +35
-5
lines changed
6 files changed +35
-5
lines changed Original file line number Diff line number Diff line change 20
20
},
21
21
"require-dev" : {
22
22
"squizlabs/php_codesniffer" : " ^3.4" ,
23
- "phpunit/phpunit" : " ^8"
23
+ "phpunit/phpunit" : " ^8" ,
24
+ "phpstan/phpstan" : " ^0.11.8"
24
25
},
25
26
26
27
"autoload" : {
41
42
],
42
43
"test" : [
43
44
" vendor/bin/phpunit --coverage-text --bootstrap ./tests/bootstrap.php --testdox --color -v tests/"
45
+ ],
46
+ "phpstan" : [
47
+ " phpstan analyse --error-format=table --no-progress -lmax -c phpstan.neon src/ tests/"
44
48
]
45
49
}
46
50
}
Original file line number Diff line number Diff line change
1
+ parameters :
2
+ # bootstrap: %currentWorkingDirectory%/../../../phpstan-bootstrap.php
3
+ ignoreErrors :
4
+ # Implementation feature
5
+ - '#Lipid\\BasePDO::__construct\ (\ ) does not call parent constructor from PDO #'
6
+
7
+ # https://github.com/phpstan/phpstan#ignore-error-messages-with-regular-expressions
8
+ -
9
+ message : ' #Access to an undefined property Lipid\\Response::\$headers#'
10
+ path : %currentWorkingDirectory%/tests/ActRedirectTest.php
11
+ -
12
+ message : " #Offset 'path' does not exist on array()#"
13
+ path : %currentWorkingDirectory%/src/Action/ActRouted.php
14
+
15
+
16
+ autoload_files :
17
+ - %currentWorkingDirectory%/vendor/autoload.php
18
+ autoload_directories :
19
+ - %currentWorkingDirectory%/src
20
+ - %currentWorkingDirectory%/tests
Original file line number Diff line number Diff line change 6
6
use Lipid \Response ;
7
7
use Lipid \Request ;
8
8
use Lipid \NotFoundException ;
9
+ use Lipid \Request \RqSERVER ;
9
10
use Exception ;
10
11
11
12
/**
@@ -54,6 +55,11 @@ public function handle(Response $resp): Response
54
55
}
55
56
56
57
$ path = parse_url ($ requestUri )['path ' ];
58
+ if (! (is_string ($ path ) && strlen ($ path ) > 0 ) ) {
59
+ throw new Exception ("Unrecognized path in REQUEST_URI " );
60
+ }
61
+
62
+
57
63
$ path = '/ ' . rtrim (substr ($ path , 1 ), '/ ' );
58
64
59
65
if (! array_key_exists ($ path , $ this ->actionMap )) {
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ final class ApplicationStd implements App
23
23
*
24
24
* @param Action|array $action action to start (see ActRouted)
25
25
* @param Response $response HTTP Response
26
- * @param Request $request HTTP Request
26
+ * @param Request $SERVER \$_SERVER (RqSERVER)
27
27
*/
28
28
public function __construct ($ action , Response $ response = null , Request $ SERVER = null )
29
29
{
Original file line number Diff line number Diff line change @@ -39,8 +39,8 @@ final class Cfg implements Config
39
39
/**
40
40
* By default we get config from current work directory
41
41
*
42
- * @param string $cfgPath path to config php file
43
- * @param Config $cfg
42
+ * @param Config $creds creds. php
43
+ * @param Config $config config.php file
44
44
*/
45
45
public function __construct (Config $ creds = null , Config $ config = null )
46
46
{
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ final class Twig implements Tpl
14
14
* Constructor.
15
15
*
16
16
* @param string $tplName template file name
17
- * @param string|\Twig\Tenvironment $tplPath directory with templates
17
+ * @param string|\Twig\Environment $tplPath directory with templates
18
18
*/
19
19
public function __construct (string $ tplName , $ tplPath )
20
20
{
You can’t perform that action at this time.
0 commit comments