Passed
Push — master ( 3c0703...74effc )
by Php Easy Api
03:41
created
src/resta/Config/ConfigProcess.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -33,13 +33,13 @@  discard block
 block discarded – undo
33 33
         $kernelConfig = [];
34 34
 
35 35
         //we are getting the config data from the kernel object..
36
-        if(isset(core()->appConfig)){
36
+        if (isset(core()->appConfig)) {
37 37
             $kernelConfig = core()->appConfig;
38 38
         }
39 39
 
40 40
         // if the config variable is not sent,
41 41
         // we print the kernel config data directly.
42
-        if(null===$this->config) {
42
+        if (null===$this->config) {
43 43
             return (count($kernelConfig)) ? $kernelConfig : null;
44 44
         }
45 45
 
@@ -48,11 +48,11 @@  discard block
 block discarded – undo
48 48
         $this->configList = Str::stringToArray($this->config);
49 49
 
50 50
         //if the config object exists in the kernel, start the process.
51
-        if(isset($kernelConfig[$config = current($this->configList)])){
51
+        if (isset($kernelConfig[$config = current($this->configList)])) {
52 52
 
53 53
             // get config data
54 54
             // we process and rotate on point basis.
55
-            $configData = $this->getConfigData($kernelConfig,$config);
55
+            $configData = $this->getConfigData($kernelConfig, $config);
56 56
             return $this->configProcessResult($configData);
57 57
         }
58 58
 
@@ -66,14 +66,14 @@  discard block
 block discarded – undo
66 66
     private function configProcessResult($config)
67 67
     {
68 68
         //config data if dotted.
69
-        if(count($this->configList)){
69
+        if (count($this->configList)) {
70 70
 
71 71
             array_shift($this->configList);
72 72
             $configdotted = $config;
73 73
 
74 74
             //we apply the dotted-knit config dataset as nested.
75
-            foreach ($this->configList as $key=>$value){
76
-                $configdotted = Arr::isset($configdotted,$value);
75
+            foreach ($this->configList as $key=>$value) {
76
+                $configdotted = Arr::isset($configdotted, $value);
77 77
             }
78 78
         }
79 79
 
@@ -90,28 +90,28 @@  discard block
 block discarded – undo
90 90
      * @throws \DI\DependencyException
91 91
      * @throws \DI\NotFoundException
92 92
      */
93
-    private function getConfigData($kernelConfig,$config)
93
+    private function getConfigData($kernelConfig, $config)
94 94
     {
95 95
         //if the config data is a class instance, we get it as an object.
96
-        if(Utils::isNamespaceExists($configFile = ($kernelConfig[$config]['namespace'] ?? ''))){
96
+        if (Utils::isNamespaceExists($configFile = ($kernelConfig[$config]['namespace'] ?? ''))) {
97 97
             $configData = app()->resolve($configFile)->handle();
98 98
         }
99 99
 
100 100
         $configFile = $kernelConfig[$config]['file'] ?? '';
101 101
 
102 102
         //if the config data is just an array.
103
-        if(
103
+        if (
104 104
             !isset($configData)
105
-            && substr($configFile,-4)=='.php'
105
+            && substr($configFile, -4)=='.php'
106 106
             && file_exists($configFile)
107
-        ){
107
+        ) {
108 108
             $configData = require($configFile);
109 109
         }
110 110
 
111 111
         // if there is data key in the kernelConfig array
112 112
         // this is not the file data,
113 113
         // a loading that contains a hand-written array.
114
-        if(isset($kernelConfig[$config]['data'])) {
114
+        if (isset($kernelConfig[$config]['data'])) {
115 115
             return $kernelConfig[$config]['data'];
116 116
         }
117 117
 
Please login to merge, or discard this patch.