Passed
Push — main ( 9ea2b8...dcf509 )
by Sammy
07:07
created
src/Factory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@
 block discarded – undo
89 89
             // Get parameter type, if exists
90 90
             $id = $param->getType()
91 91
                 ? $param->getType()->getName()
92
-                : 'settings.Constructor.' . $constructor->class . '.' . $param->getName();
92
+                : 'settings.Constructor.'.$constructor->class.'.'.$param->getName();
93 93
             
94 94
             // Get resource with Id and append to return array
95 95
             $ret [] = $this->container->get($id);
Please login to merge, or discard this patch.
src/Solver.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -28,10 +28,10 @@  discard block
 block discarded – undo
28 28
 
29 29
     public function solve(string $lamentation)
30 30
     {
31
-        return $this->probeSettings ($lamentation)
32
-            ?? $this->probeClasses  ($lamentation)
31
+        return $this->probeSettings($lamentation)
32
+            ?? $this->probeClasses($lamentation)
33 33
             ?? $this->probeInterface($lamentation)
34
-            ?? $this->probeCascade  ($lamentation);
34
+            ?? $this->probeCascade($lamentation);
35 35
     }
36 36
 
37 37
     //dot based hierarchy, parse and climb
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
         $walked = [];
49 49
         foreach ($path as $k) {
50 50
             
51
-            $walked []= $k;
51
+            $walked [] = $k;
52 52
             
53 53
             if (isset($settings[$k])) {
54 54
                 $settings = $settings[$k];
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
             }
57 57
 
58 58
             // we didn't continue; we failed
59
-            $walked = 'settings.' . implode('.', $walked);
59
+            $walked = 'settings.'.implode('.', $walked);
60 60
             throw new NotFoundException(__FUNCTION__."($lamentation) failed at $walked");
61 61
         }
62 62
 
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 
66 66
     public function probeClasses(string $className, array $construction_args = []): ?object
67 67
     {
68
-        if(class_exists($className))
68
+        if (class_exists($className))
69 69
             return $this->factory->serve($className, $construction_args);
70 70
 
71 71
         return null;
@@ -106,11 +106,11 @@  discard block
 block discarded – undo
106 106
             return null;
107 107
         }
108 108
         
109
-        $class_name = $m[1] . '\\' . $m[2];
109
+        $class_name = $m[1].'\\'.$m[2];
110 110
 
111 111
         $class_name = $this->cascadeNamespace($class_name);
112 112
 
113
-        if(is_null($class_name))
113
+        if (is_null($class_name))
114 114
             $ret = null;
115 115
         elseif (self::hasClassNameModifier($lamentation)) {
116 116
             $ret = $class_name;
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 
136 136
         foreach ($cascade as $namespace) {
137 137
 
138
-            $fully_namespaced = $namespace . $class_name;
138
+            $fully_namespaced = $namespace.$class_name;
139 139
             
140 140
             if (class_exists($fully_namespaced)) {
141 141
 
Please login to merge, or discard this patch.
Braces   +9 added lines, -7 removed lines patch added patch discarded remove patch
@@ -65,8 +65,9 @@  discard block
 block discarded – undo
65 65
 
66 66
     public function probeClasses(string $className, array $construction_args = []): ?object
67 67
     {
68
-        if(class_exists($className))
69
-            return $this->factory->serve($className, $construction_args);
68
+        if(class_exists($className)) {
69
+                    return $this->factory->serve($className, $construction_args);
70
+        }
70 71
 
71 72
         return null;
72 73
     }
@@ -79,8 +80,9 @@  discard block
 block discarded – undo
79 80
 
80 81
         $wires = $this->container->get('wiring') ?? [];
81 82
 
82
-        if (!isset($wires[$lamentation]))
83
-            throw new NotFoundException(__FUNCTION__."($lamentation) is not wired to a class");
83
+        if (!isset($wires[$lamentation])) {
84
+                    throw new NotFoundException(__FUNCTION__."($lamentation) is not wired to a class");
85
+        }
84 86
 
85 87
         $wire = $wires[$lamentation];
86 88
 
@@ -110,9 +112,9 @@  discard block
 block discarded – undo
110 112
 
111 113
         $class_name = $this->cascadeNamespace($class_name);
112 114
 
113
-        if(is_null($class_name))
114
-            $ret = null;
115
-        elseif (self::hasClassNameModifier($lamentation)) {
115
+        if(is_null($class_name)) {
116
+                    $ret = null;
117
+        } elseif (self::hasClassNameModifier($lamentation)) {
116 118
             $ret = $class_name;
117 119
         } elseif (self::hasNewInstanceModifier($lamentation)) {
118 120
             $ret = $this->factory->build($class_name, []);
Please login to merge, or discard this patch.
src/LeMarchand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
57 57
 
58 58
         foreach ($dbg['configurations']['wiring'] as $interface => $wire) {
59 59
             if (is_array($wire)) {
60
-                $wire = array_shift($wire) . ' --array #' . count($wire);
60
+                $wire = array_shift($wire).' --array #'.count($wire);
61 61
             }
62 62
             $dbg['configurations']['wiring'] = $wire;
63 63
         }
Please login to merge, or discard this patch.
tests/LeMarchandTest.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,13 +10,13 @@
 block discarded – undo
10 10
 
11 11
 class LeMarchandTest extends TestCase
12 12
 {
13
-   public function testEmptyConstructor()
14
-   {
13
+    public function testEmptyConstructor()
14
+    {
15 15
         $res = new LeMarchand([]);
16 16
         $this->assertInstanceOf(LeMarchand::class, $res);
17 17
         $this->assertInstanceOf(ContainerInterface::class, $res);
18 18
 
19 19
         $this->assertFalse($res->has('test'));
20
-   }
20
+    }
21 21
 
22 22
 }
23 23
\ No newline at end of file
Please login to merge, or discard this patch.
tests/data_settings.php 2 patches
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -6,8 +6,8 @@  discard block
 block discarded – undo
6 6
 
7 7
 $settings = array(
8 8
   'app' => [
9
-		'name' => 'Cinergie',
10
-		'production_host' => 'cinergie.be',
9
+    'name' => 'Cinergie',
10
+    'production_host' => 'cinergie.be',
11 11
     'session_start_options' => ['session_name' => 'krafto-cinergie'],
12 12
     'CSP_nonce' => $nonce,
13 13
     'headers' => [
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
         "font-src 'self' 'nonce-{$nonce}' data: https://cdn.jsdelivr.net;",
23 23
       ]
24 24
     ]
25
-	],
25
+  ],
26 26
 
27 27
   'locale' => [
28 28
     'json_path' => DOCUMENT_ROOT.'/cache/locale/user_interface_{LANGUAGE}.json',
@@ -30,19 +30,19 @@  discard block
 block discarded – undo
30 30
     'fallback_lang' => 'fra'
31 31
   ],
32 32
 
33
-	'default' => array(
34
-		'language' => 'fra', // can't be iso 693-3 because of common.inc putenv('LANG='.$settings['default']['language']); & setlocale(LC_ALL, $settings['default']['language']);
35
-		'timezone' => 'Europe/Brussels',
36
-		'charset' => 'UTF-8',
37
-		'max_idle_time' => 24*3600, // handles session expiration after some idle time (in seconds)
38
-	),
39
-	'filter' => array(
40
-		// 'search_term' => '',
41
-		// 'page' => 1,
42
-		// 'time_window_start' => '-1 months',
43
-		// 'time_window_stop' => '+1 month',
44
-		// 'results_per_page' => '16',
45
-	),
33
+  'default' => array(
34
+    'language' => 'fra', // can't be iso 693-3 because of common.inc putenv('LANG='.$settings['default']['language']); & setlocale(LC_ALL, $settings['default']['language']);
35
+    'timezone' => 'Europe/Brussels',
36
+    'charset' => 'UTF-8',
37
+    'max_idle_time' => 24*3600, // handles session expiration after some idle time (in seconds)
38
+  ),
39
+  'filter' => array(
40
+    // 'search_term' => '',
41
+    // 'page' => 1,
42
+    // 'time_window_start' => '-1 months',
43
+    // 'time_window_stop' => '+1 month',
44
+    // 'results_per_page' => '16',
45
+  ),
46 46
 
47 47
   // 'env' => require_once('env.php'),
48 48
   // 'api' => require_once('api.php')
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
 		'language' => 'fra', // can't be iso 693-3 because of common.inc putenv('LANG='.$settings['default']['language']); & setlocale(LC_ALL, $settings['default']['language']);
35 35
 		'timezone' => 'Europe/Brussels',
36 36
 		'charset' => 'UTF-8',
37
-		'max_idle_time' => 24*3600, // handles session expiration after some idle time (in seconds)
37
+		'max_idle_time' => 24 * 3600, // handles session expiration after some idle time (in seconds)
38 38
 	),
39 39
 	'filter' => array(
40 40
 		// 'search_term' => '',
Please login to merge, or discard this patch.
tests/SettingsAccessTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@
 block discarded – undo
107 107
             ]
108 108
         );
109 109
 
110
-        foreach(['settings.0', 'settings.key', 'settings.level.0', 'settings.level.1.key.1'] as $lament){
110
+        foreach (['settings.0', 'settings.key', 'settings.level.0', 'settings.level.1.key.1'] as $lament) {
111 111
             $this->expectException(NotFoundExceptionInterface::class);
112 112
             $res->get($lament);
113 113
             $this->assertFalse($res->has($lament));
Please login to merge, or discard this patch.