Passed
Branch v2-dev (abcc50)
by Henri
02:14
created
examples/Middleware/Lasted.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,8 +8,8 @@
 block discarded – undo
8 8
 use Psr\Http\Server\RequestHandlerInterface;
9 9
 
10 10
 /** 
11
-  * @property string $error
12
-  */ 
11
+ * @property string $error
12
+ */ 
13 13
 class Lasted extends Middleware{
14 14
 
15 15
     public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,11 +10,11 @@
 block discarded – undo
10 10
 /** 
11 11
   * @property string $error
12 12
   */ 
13
-class Lasted extends Middleware{
13
+class Lasted extends Middleware {
14 14
 
15 15
     public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
16 16
     {
17
-        if(!isset($this->error)){
17
+        if (!isset($this->error)) {
18 18
             throw new Exception("Access not belonged: {$this->error}");
19 19
         }
20 20
 
Please login to merge, or discard this patch.
examples/Middleware/Auth.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,8 +7,8 @@
 block discarded – undo
7 7
 use Psr\Http\Server\RequestHandlerInterface;
8 8
 
9 9
 /** 
10
-  * @property string $error
11
-  */ 
10
+ * @property string $error
11
+ */ 
12 12
 class Auth extends Middleware{
13 13
 
14 14
     public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,11 +9,11 @@
 block discarded – undo
9 9
 /** 
10 10
   * @property string $error
11 11
   */ 
12
-class Auth extends Middleware{
12
+class Auth extends Middleware {
13 13
 
14 14
     public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
15 15
     {
16
-        if(!array_key_exists('user',$_SESSION)){
16
+        if (!array_key_exists('user', $_SESSION)) {
17 17
             $this->error = 'The user must be logged in to the system';
18 18
         }
19 19
 
Please login to merge, or discard this patch.
examples/Routes/default.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -4,28 +4,28 @@  discard block
 block discarded – undo
4 4
 
5 5
 
6 6
 
7
-Router::beforeAll(function(){
7
+Router::beforeAll(function() {
8 8
     echo '<br><b>beforeAll</b><br>';
9 9
 },['testes']);
10 10
 
11
-Router::afterAll(function(){
11
+Router::afterAll(function() {
12 12
     echo '<br><b>afterAll</b><br>';
13 13
 },['testes']);
14 14
 
15 15
 
16
-Router::match('GET|POST|AJAX','/{1parameter}/{otherparameter}', function($parameter, $otherparameter){
16
+Router::match('GET|POST|AJAX', '/{1parameter}/{otherparameter}', function($parameter, $otherparameter) {
17 17
     echo "Parameter 1:{$parameter}, Parameter 2:{$otherparameter}.";
18 18
 });
19 19
 
20
-Router::get('/{2controller}/{method}','{controller}:{method}');
20
+Router::get('/{2controller}/{method}', '{controller}:{method}');
21 21
 
22
-Router::get('/3my-account','Controller\\User:my_account')->before(function(){
22
+Router::get('/3my-account', 'Controller\\User:my_account')->before(function() {
23 23
     echo '1';
24 24
 });
25 25
 
26
-Router::get('/4my-account/teste/teste','Controller\\User:my_account')->name('2');
26
+Router::get('/4my-account/teste/teste', 'Controller\\User:my_account')->name('2');
27 27
 
28
-Router::get('/5my-account/{:teste}/{teste2}',function($teste, $teste2){
28
+Router::get('/5my-account/{:teste}/{teste2}', function($teste, $teste2) {
29 29
     echo $teste.'-'.$teste2;
30 30
 })->where([
31 31
     'teste'=>'[a-zA-Z]{1,10}',
@@ -33,14 +33,14 @@  discard block
 block discarded – undo
33 33
 ]);
34 34
 
35 35
 
36
-Router::get('/6my-accounttttt/{param1}/{param2}','\Example\Controllers\User@requireLogin');
36
+Router::get('/6my-accounttttt/{param1}/{param2}', '\Example\Controllers\User@requireLogin');
37 37
 //->middleware(['\Example\Middleware\Auth::class','Lasted']);
38 38
 
39
-Router::get('/5my-account/{:teste}','Controller\\User:my_account')->where([
39
+Router::get('/5my-account/{:teste}', 'Controller\\User:my_account')->where([
40 40
     'teste'=>'[a-zA-Z]{1,10}'
41 41
 ]);
42 42
 
43 43
 
44
-Router::any('/8',function(){
44
+Router::any('/8', function() {
45 45
     //
46 46
 })->name('index');
Please login to merge, or discard this patch.