Passed
Push — master ( 2e95e2...8fb72e )
by Php Easy Api
05:42 queued 02:06
created
src/resta/Foundation/Bootstrapper/CustomBooter.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -50,20 +50,20 @@  discard block
 block discarded – undo
50 50
 
51 51
         //Now, let's get our custom boot list.
52 52
         //Let's assign the final state to our booterList list along with our custom boot list.
53
-        foreach (array_keys($this->getBootDirectory()) as $customBoots){
53
+        foreach (array_keys($this->getBootDirectory()) as $customBoots) {
54 54
 
55 55
             //We assign the namespace data of the bootable class to the bootNamespace property.
56
-            $this->bootNamespace=''.StaticPathList::$boot.'\\'.$customBoots;
56
+            $this->bootNamespace = ''.StaticPathList::$boot.'\\'.$customBoots;
57 57
 
58 58
             //Your custom boot objects in
59 59
             //the boot directory should not be in the middlewaregroups list.
60
-            if(false===pos($booter)->console() && !in_array($this->bootNamespace,$booterList)){
60
+            if (false===pos($booter)->console() && !in_array($this->bootNamespace, $booterList)) {
61 61
                 $this->booterManifest($booter);
62 62
             }
63 63
         }
64 64
 
65 65
         //The booterList property combines booterList variables.
66
-        return array_merge($booterList,$this->booterList);
66
+        return array_merge($booterList, $this->booterList);
67 67
     }
68 68
 
69 69
     /**
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
     {
75 75
         //if the boot list belongs to the custom booter,
76 76
         //then we can boot our custom boot objects by adding them at the end of this class.
77
-        if(array_pop($booter)==$this->customBooter){
77
+        if (array_pop($booter)==$this->customBooter) {
78 78
             return $this->addCustomBooter($booter);
79 79
         }
80 80
 
Please login to merge, or discard this patch.
src/resta/Foundation/Bootstrapper/KernelManifestManager.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
     /**
18 18
      * @var array $makerList
19 19
      */
20
-    protected $makerList=[];
20
+    protected $makerList = [];
21 21
 
22 22
     /**
23 23
      * @var $manifest
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 
36 36
         // if there is manifest propery in the resta
37 37
         // in this case,manifest property is manifest class
38
-        if($app['isAvailableStore']){
38
+        if ($app['isAvailableStore']) {
39 39
             $this->manifest = $this->manifest->resolve(Manifest::class);
40 40
         }
41 41
 
@@ -62,11 +62,11 @@  discard block
 block discarded – undo
62 62
     {
63 63
         $app = clone $this;
64 64
 
65
-        return $this->manifest->call(function() use ($maker,$app){
65
+        return $this->manifest->call(function() use ($maker, $app){
66 66
 
67 67
             // As a parameter, the maker variable comes as
68 68
             // the name of the list to be booted.
69
-            if(isset($this->{$maker})){
69
+            if (isset($this->{$maker})) {
70 70
 
71 71
                 //get default maker list
72 72
                 $app->setMakerList($this->{$maker});
@@ -74,13 +74,13 @@  discard block
 block discarded – undo
74 74
                 // we set this condition for users to boot the classes they want in the kernel groups.
75 75
                 // in the manifesto, if the kernel groups method returns an class of arrays
76 76
                 // then these classes will automatically join the kernel groups installation.
77
-                if(isset($this->run) && isset($this->run[$maker]) && is_array($this->run[$maker])){
77
+                if (isset($this->run) && isset($this->run[$maker]) && is_array($this->run[$maker])) {
78 78
 
79 79
                     $appMaker = $this->run[$maker];
80 80
 
81 81
                     // if the makerExtend value in the manifest is a method,
82 82
                     // in this case, the method is executed instead of the object
83
-                    if(method_exists($this,$maker)){
83
+                    if (method_exists($this, $maker)) {
84 84
                         $this->{$maker}(app());
85 85
                     }
86 86
 
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
                     // if the maker is present on a method basis, then the maker list values ​​must be true or false.
92 92
                     // if one of the maker classes is false will not load this maker class.
93 93
                     foreach ($kernelMakers as $kernelMakerAbstract=>$kernelMaker) {
94
-                        if($kernelMaker){
94
+                        if ($kernelMaker) {
95 95
                             $kernelMakers[$kernelMakerAbstract] = $appMaker[$kernelMakerAbstract];
96 96
                         }
97 97
                     }
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 
104 104
             // revision maker
105 105
             // group name to boot
106
-            if(isset($this->revision)){
106
+            if (isset($this->revision)) {
107 107
                 $app->revisionMaker($this->revision);
108 108
             }
109 109
 
@@ -119,19 +119,19 @@  discard block
 block discarded – undo
119 119
      */
120 120
     public function revisionMaker($revision)
121 121
     {
122
-        if(is_array($revision) && count($this->makerList)){
122
+        if (is_array($revision) && count($this->makerList)) {
123 123
 
124 124
             //We return to the boot list and perform a revision check.
125
-            foreach ($this->makerList as $makerKey=>$makerValue){
125
+            foreach ($this->makerList as $makerKey=>$makerValue) {
126 126
 
127 127
                 // the revision list is presented as a helper method to prevent
128 128
                 // the listener application being booted from taking the entire listener individually.
129
-                if(count($revision) && isset($revision[$makerKey]) && Utils::isNamespaceExists($revision[$makerKey])){
129
+                if (count($revision) && isset($revision[$makerKey]) && Utils::isNamespaceExists($revision[$makerKey])) {
130 130
                     $this->makerList[$makerKey] = $revision[$makerKey];
131 131
 
132 132
                     // if a kernel group key that is changed to revision is an actual class,
133 133
                     // we will save this class to the container object.
134
-                    $this->app->register('revision',$makerValue,$revision[$makerKey]);
134
+                    $this->app->register('revision', $makerValue, $revision[$makerKey]);
135 135
                 }
136 136
             }
137 137
         }
Please login to merge, or discard this patch.
src/resta/Foundation/Bootstrapper/BootLoader.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -241,11 +241,11 @@
 block discarded – undo
241 241
     {
242 242
         // we use the methodological context
243 243
         // for kernel group values that are replaced with revision.
244
-       $revisionBoot = array_search($name,app()['revision']);
245
-       if(method_exists($this,$revisionBoot)){
246
-           return $this->{$revisionBoot}();
247
-       }
244
+        $revisionBoot = array_search($name,app()['revision']);
245
+        if(method_exists($this,$revisionBoot)){
246
+            return $this->{$revisionBoot}();
247
+        }
248 248
 
249
-       exception()->badFunctionCall('There is no boot method named '.$name);
249
+        exception()->badFunctionCall('There is no boot method named '.$name);
250 250
     }
251 251
 }
252 252
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -34,12 +34,12 @@  discard block
 block discarded – undo
34 34
     {
35 35
         //if the console is true
36 36
         //console app runner
37
-        if($this->app->runningInConsole()
38
-            && $this->app['isAvailableStore'] && $this->app->checkBindings('appConsole')===false){
37
+        if ($this->app->runningInConsole()
38
+            && $this->app['isAvailableStore'] && $this->app->checkBindings('appConsole')===false) {
39 39
 
40 40
             //If the second parameter is sent true to the application builder,
41 41
             //all operations are performed by the console and the custom booting are executed
42
-            $this->app->share('appConsole',ConsoleProvider::class);
42
+            $this->app->share('appConsole', ConsoleProvider::class);
43 43
         }
44 44
     }
45 45
 
@@ -62,8 +62,8 @@  discard block
 block discarded – undo
62 62
     {
63 63
         // this is your application's config installer.
64 64
         // you can easily access the config variables with the config installer.
65
-        if($this->app->checkBindings('config')===false){
66
-            $this->app->share('config',function($app){
65
+        if ($this->app->checkBindings('config')===false) {
66
+            $this->app->share('config', function($app) {
67 67
                 return $app['revision']['config'] ?? ConfigProvider::class;
68 68
             });
69 69
         }
@@ -78,8 +78,8 @@  discard block
 block discarded – undo
78 78
     {
79 79
         // the rest system will assign a random key to your application for you.
80 80
         // this application will single the advantages of using the rest system for your application in particular.
81
-        if(core()->isAvailableStore && $this->app->checkBindings('encrypter')===false){
82
-            $this->app->make('encrypter',function($app){
81
+        if (core()->isAvailableStore && $this->app->checkBindings('encrypter')===false) {
82
+            $this->app->make('encrypter', function($app) {
83 83
                 return $app['revision']['encrypter'] ?? EncrypterProvider::class;
84 84
             });
85 85
         }
@@ -95,8 +95,8 @@  discard block
 block discarded – undo
95 95
         // it is often helpful to have different configuration values based onUrlParseApplication
96 96
         // the environment where the application is running.for example,
97 97
         // you may wish to use a different cache driver locally than you do on your production server.
98
-        if($this->app->checkBindings('environment')===false){
99
-            $this->app->share('environment',function($app){
98
+        if ($this->app->checkBindings('environment')===false) {
99
+            $this->app->share('environment', function($app) {
100 100
                 return $app['revision']['environment'] ?? EnvironmentProvider::class;
101 101
             });
102 102
         }
@@ -112,9 +112,9 @@  discard block
 block discarded – undo
112 112
         // the eventDispatcher component provides tools
113 113
         // that allow your application components to communicate
114 114
         // with each other by dispatching events and listening to them.
115
-        if($this->app->checkBindings('eventDispatcher')===false){
116
-            $this->app->share('eventDispatcher',function($app){
117
-                if(Utils::isNamespaceExists(app()->namespace()->serviceEventDispatcher())){
115
+        if ($this->app->checkBindings('eventDispatcher')===false) {
116
+            $this->app->share('eventDispatcher', function($app) {
117
+                if (Utils::isNamespaceExists(app()->namespace()->serviceEventDispatcher())) {
118 118
                     return $app['revision']['eventDispatcher'] ?? app()->namespace()->serviceEventDispatcher();
119 119
                 }
120 120
             });
@@ -132,8 +132,8 @@  discard block
 block discarded – undo
132 132
         // to help you learn more about what's happening within your application,
133 133
         // rest system provides robust logging services that allow you to log messages to files,
134 134
         // the system error log, and even to Slack to notify your entire team.
135
-        if($this->app->checkBindings('logger')===false){
136
-            $this->app->share('logger',function($app){
135
+        if ($this->app->checkBindings('logger')===false) {
136
+            $this->app->share('logger', function($app) {
137 137
                 return $app['revision']['logger'] ?? LoggerProvider::class;
138 138
             });
139 139
         }
@@ -150,8 +150,8 @@  discard block
 block discarded – undo
150 150
         // when your application is requested, the middleware classes are running before all bootstrapper executables.
151 151
         // thus, if you make http request your application, you can verify with an intermediate middleware layer
152 152
         // and throw an exception.
153
-        if($this->app->checkBindings('middleware')===false){
154
-            $this->app->make('middleware',function($app){
153
+        if ($this->app->checkBindings('middleware')===false) {
154
+            $this->app->make('middleware', function($app) {
155 155
                 return $app['revision']['middleware'] ?? MiddlewareProvider::class;
156 156
             });
157 157
         }
@@ -166,8 +166,8 @@  discard block
 block discarded – undo
166 166
     {
167 167
         // we determine kind of output with the response manager
168 168
         // json as default or [xml,wsdl]
169
-        if($this->app->checkBindings('response')===false){
170
-            $this->app->make('response',function($app){
169
+        if ($this->app->checkBindings('response')===false) {
170
+            $this->app->make('response', function($app) {
171 171
                 return $app['revision']['response'] ?? ResponseProvider::class;
172 172
             });
173 173
         }
@@ -183,8 +183,8 @@  discard block
 block discarded – undo
183 183
         // route operations are the last part of the system run. In this section,
184 184
         // a route operation is passed through the url process and output is sent to the screen according to
185 185
         // the method file to be called by the application
186
-        if(core()->isAvailableStore && $this->app->checkBindings('router')===false){
187
-            $this->app->make('router',function($app){
186
+        if (core()->isAvailableStore && $this->app->checkBindings('router')===false) {
187
+            $this->app->make('router', function($app) {
188 188
                 return $app['revision']['router'] ?? RouteProvider::class;
189 189
             });
190 190
         }
@@ -197,8 +197,8 @@  discard block
 block discarded – undo
197 197
      */
198 198
     private function serviceProvider()
199 199
     {
200
-        if($this->app->checkBindings('serviceProvider')===false){
201
-            $this->app->share('serviceProvider',function($app){
200
+        if ($this->app->checkBindings('serviceProvider')===false) {
201
+            $this->app->share('serviceProvider', function($app) {
202 202
                 return $app['revision']['serviceProvider'] ?? ServiceProvider::class;
203 203
             });
204 204
         }
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
      *
210 210
      * @param null $bootstrapper
211 211
      */
212
-    public function setBootstrapper($bootstrapper=null)
212
+    public function setBootstrapper($bootstrapper = null)
213 213
     {
214 214
         $this->bootstrapper = $bootstrapper;
215 215
     }
@@ -223,9 +223,9 @@  discard block
 block discarded – undo
223 223
     {
224 224
         // with url parsing,the application route for
225 225
         // the rest project is determined after the route variables from the URL are assigned to the kernel url object.
226
-        if(count(array_filter(Utils::getRequestPathInfo(),'strlen'))
227
-            && $this->app->checkBindings('url')===false){
228
-            $this->app->make('url',function($app){
226
+        if (count(array_filter(Utils::getRequestPathInfo(), 'strlen'))
227
+            && $this->app->checkBindings('url')===false) {
228
+            $this->app->make('url', function($app) {
229 229
                 return $app['revision']['url'] ?? UrlProvider::class;
230 230
             });
231 231
         }
@@ -237,12 +237,12 @@  discard block
 block discarded – undo
237 237
      * @param $name
238 238
      * @param $arguments
239 239
      */
240
-    public function __call($name,$arguments)
240
+    public function __call($name, $arguments)
241 241
     {
242 242
         // we use the methodological context
243 243
         // for kernel group values that are replaced with revision.
244
-       $revisionBoot = array_search($name,app()['revision']);
245
-       if(method_exists($this,$revisionBoot)){
244
+       $revisionBoot = array_search($name, app()['revision']);
245
+       if (method_exists($this, $revisionBoot)) {
246 246
            return $this->{$revisionBoot}();
247 247
        }
248 248
 
Please login to merge, or discard this patch.
src/resta/Foundation/Bootstrapper/BootFireCallback.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -18,12 +18,12 @@  discard block
 block discarded – undo
18 18
         // We get instance for customBooter class
19 19
         // we get our object-protected boot lists
20 20
         // directly in the application class with the help of public access method.
21
-        $customBooter   = $app->resolve(CustomBooter::class,['boot'=>end($booter)]);
21
+        $customBooter   = $app->resolve(CustomBooter::class, ['boot'=>end($booter)]);
22 22
         $boot           = ($customBooter)->customBootstrappers($booter);
23 23
 
24 24
         // and as a result we now use
25 25
         //the instance properties of our boot lists to include our implementation.
26
-        $app->resolve(FinalBooting::class,['boot'=>$boot]);
26
+        $app->resolve(FinalBooting::class, ['boot'=>$boot]);
27 27
     }
28 28
 
29 29
     /**
@@ -31,11 +31,11 @@  discard block
 block discarded – undo
31 31
      * @param callable $callback
32 32
      * @return mixed
33 33
      */
34
-    public static function setBootFire($kernel=array(),callable $callback)
34
+    public static function setBootFire($kernel = array(), callable $callback)
35 35
     {
36 36
         //The boot method to be executed can be specified by the user.
37 37
         //We use this method to know how to customize it.
38
-        return call_user_func_array($callback,[self::setParametersForKernelCallback($kernel)]);
38
+        return call_user_func_array($callback, [self::setParametersForKernelCallback($kernel)]);
39 39
     }
40 40
 
41 41
     /**
Please login to merge, or discard this patch.
src/resta/Foundation/Bootstrapper/Bootstrappers.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
         (new BaseRegister($this->app))->handle();
43 43
 
44 44
         //we save the bootstrapper class in container.
45
-        $this->app->register('bootstrapper',$this);
45
+        $this->app->register('bootstrapper', $this);
46 46
 
47 47
         //call bootstrapper process
48 48
         $this->callBootstrapperProcess();
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
     {
62 62
         //The boot method to be executed can be specified by the user.
63 63
         //We use this method to know how to customize it.
64
-        BootFireCallback::setBootFire([$this->app,$bootstrapper],function($boot){
64
+        BootFireCallback::setBootFire([$this->app, $bootstrapper], function($boot) {
65 65
 
66 66
             //kernel boots run and service container
67 67
             //makeBuild for service Container
@@ -76,11 +76,11 @@  discard block
 block discarded – undo
76 76
      * @param null $maker
77 77
      * @return mixed
78 78
      */
79
-    public function bootFire($boot=null,$maker=null)
79
+    public function bootFire($boot = null, $maker = null)
80 80
     {
81 81
         // we can refer to this method
82 82
         // because we can boot classes in the middleware or bootstrapper array.
83
-        if(is_null($boot) && !is_null($maker)){
83
+        if (is_null($boot) && !is_null($maker)) {
84 84
 
85 85
             // we create kernel bootstrapping objects
86 86
             // that can be changed by you with the closure dispatcher method.
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 
93 93
         // the boot method to be executed can be specified by the user.
94 94
         // we use this method to know how to customize it.
95
-        return forward_static_call_array([array_pop($boot),self::LOADBOOTSTRAPPERS],[$boot]);
95
+        return forward_static_call_array([array_pop($boot), self::LOADBOOTSTRAPPERS], [$boot]);
96 96
     }
97 97
 
98 98
     /**
@@ -103,14 +103,14 @@  discard block
 block discarded – undo
103 103
      */
104 104
     private function bootstrapper(...$params)
105 105
     {
106
-        [$group,$booting,$onion] = $params;
106
+        [$group, $booting, $onion] = $params;
107 107
 
108
-        if($onion){
108
+        if ($onion) {
109 109
 
110 110
             // we will implement a special onion method here and
111 111
             // pass our bootstraper classes through this method.
112 112
             // Our goal here is to implement the middleware layer correctly.
113
-            $this->app->resolve(MiddlewareKernelProvider::class)->onionBoot([$group,$booting],function() use($group){
113
+            $this->app->resolve(MiddlewareKernelProvider::class)->onionBoot([$group, $booting], function() use($group){
114 114
                 $this->boot($group);
115 115
             });
116 116
 
@@ -127,18 +127,18 @@  discard block
 block discarded – undo
127 127
      *
128 128
      * @param array $customBootstrapers
129 129
      */
130
-    public function callBootstrapperProcess($customBootstrapers=[])
130
+    public function callBootstrapperProcess($customBootstrapers = [])
131 131
     {
132 132
         // here we check that a special bootstrappers list will work and we identify the onion identifier.
133 133
         // we are peeling onion class by classifying onion class.
134 134
         $this->getBootstrappersStack($customBootstrapers);
135 135
 
136 136
         //We run the bootstrap list by callback with the object specified for the content respectively.
137
-        foreach($this->stack['getBootstrappers'] as $bootstrapper){
137
+        foreach ($this->stack['getBootstrappers'] as $bootstrapper) {
138 138
 
139 139
             // if the callback data is different from the application kernel,
140 140
             // we will pass it to the pusher control for a special use.
141
-            call_user_func_array([$this,'bootstrapper'],[$bootstrapper,$this,$this->stack['onionIdentifier']]);
141
+            call_user_func_array([$this, 'bootstrapper'], [$bootstrapper, $this, $this->stack['onionIdentifier']]);
142 142
         }
143 143
     }
144 144
 
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
     private function peelings()
165 165
     {
166 166
         //if there are peelings
167
-        if(isset($this->app['peelings'])){
167
+        if (isset($this->app['peelings'])) {
168 168
 
169 169
             // We send the peelings property to
170 170
             // the bootstrapperPeelOnion class.
Please login to merge, or discard this patch.
src/resta/Foundation/Bootstrapper/FinalBooting.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
      * @param $app
21 21
      * @param array $boot
22 22
      */
23
-    public function __construct($app,$boot=array())
23
+    public function __construct($app, $boot = array())
24 24
     {
25 25
         parent::__construct($app);
26 26
 
@@ -35,21 +35,21 @@  discard block
 block discarded – undo
35 35
      * @param array $boots
36 36
      * @param bool $defaultBoot
37 37
      */
38
-    private function bootstrapper($boots=array(),$defaultBoot=true)
38
+    private function bootstrapper($boots = array(), $defaultBoot = true)
39 39
     {
40 40
         //boot loop make bind calling
41
-        foreach ($boots as $bootstrapper){
41
+        foreach ($boots as $bootstrapper) {
42 42
 
43 43
             // for the default boot, we overwrite the bootstrapper class's bootstrapper property
44 44
             // and load it with the boot method.
45
-            if($defaultBoot){
45
+            if ($defaultBoot) {
46 46
                 $this->app->loadIfNotExistBoot([$bootstrapper]);
47 47
             }
48 48
             // we will use the classical method for classes
49 49
             // that will not boot from the kernel.
50
-            else{
51
-                if(Utils::isNamespaceExists($bootstrapper)
52
-                    && false===isset($this->app['resolve'][$bootstrapper])){
50
+            else {
51
+                if (Utils::isNamespaceExists($bootstrapper)
52
+                    && false===isset($this->app['resolve'][$bootstrapper])) {
53 53
                     $this->app->resolve($bootstrapper)->boot();
54 54
                 }
55 55
             }
@@ -65,8 +65,8 @@  discard block
 block discarded – undo
65 65
     private function customBootManifest(callable $callback)
66 66
     {
67 67
         //we make custom boot
68
-        if(isset($this->boot['custom'])){
69
-            return call_user_func_array($callback,[$this->boot['custom']]);
68
+        if (isset($this->boot['custom'])) {
69
+            return call_user_func_array($callback, [$this->boot['custom']]);
70 70
         }
71 71
     }
72 72
 
@@ -83,8 +83,8 @@  discard block
 block discarded – undo
83 83
         $defaultBoot = Collection::make($this->boot)->except('custom')->all();
84 84
 
85 85
         //custom boot according to manifest bootManager
86
-        $this->customBootManifest(function($boot){
87
-            $this->bootstrapper((array)$boot,false);
86
+        $this->customBootManifest(function($boot) {
87
+            $this->bootstrapper((array)$boot, false);
88 88
         });
89 89
 
90 90
         // and as a result we now use
Please login to merge, or discard this patch.
src/resta/Foundation/ApplicationBaseRegister.php 3 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
         $this->isAvailableStore();
65 65
 
66 66
         //global accessor handling
67
-       $this->setGlobalAccessor();
67
+        $this->setGlobalAccessor();
68 68
 
69 69
         // sets a user-defined error handler function
70 70
         // this function can be used for defining your own way of handling errors during runtime,
@@ -151,12 +151,12 @@  discard block
 block discarded – undo
151 151
         if(Utils::isNamespaceExists(RequestService::class)){
152 152
 
153 153
             Request::setFactory(function(array $query = array(),
154
-                                         array $request = array(),
155
-                                         array $attributes = array(),
156
-                                         array $cookies = array(),
157
-                                         array $files = array(),
158
-                                         array $server = array(),
159
-                                         $content = null)
154
+                                            array $request = array(),
155
+                                            array $attributes = array(),
156
+                                            array $cookies = array(),
157
+                                            array $files = array(),
158
+                                            array $server = array(),
159
+                                            $content = null)
160 160
             {
161 161
                 return new RequestService($query,
162 162
                     $request,
Please login to merge, or discard this patch.
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -32,11 +32,11 @@  discard block
 block discarded – undo
32 32
         // if the store directory is available,
33 33
         // then the application process continues.
34 34
         // if not available, only the core is executed.
35
-        if(file_exists(app()->path()->storeDir())){
36
-            $this->app->register('isAvailableStore',true);
35
+        if (file_exists(app()->path()->storeDir())) {
36
+            $this->app->register('isAvailableStore', true);
37 37
         }
38
-        else{
39
-            $this->app->register('isAvailableStore',false);
38
+        else {
39
+            $this->app->register('isAvailableStore', false);
40 40
         }
41 41
     }
42 42
 
@@ -49,13 +49,13 @@  discard block
 block discarded – undo
49 49
     {
50 50
         //we can use this method to move an instance of the application class with the kernel object
51 51
         //and easily resolve an encrypted instance of all the kernel variables in our helper class.
52
-        ClassAliasGroup::setAlias(App::class,'application');
52
+        ClassAliasGroup::setAlias(App::class, 'application');
53 53
 
54 54
         //set base instances
55 55
         $this->setBaseInstances();
56 56
 
57 57
         //we define the general application instance object.
58
-        define('appInstance',(base64_encode(serialize($this))));
58
+        define('appInstance', (base64_encode(serialize($this))));
59 59
 
60 60
         //main loader for application
61 61
         $this->mainLoader();
@@ -70,8 +70,8 @@  discard block
 block discarded – undo
70 70
         // this function can be used for defining your own way of handling errors during runtime,
71 71
         // for example in applications in which you need to do cleanup of data/files when a critical error happens,
72 72
         // or when you need to trigger an error under certain conditions (using trigger_error()).
73
-        if($this->app['isAvailableStore']){
74
-            $this->app->make('exception',function(){
73
+        if ($this->app['isAvailableStore']) {
74
+            $this->app->make('exception', function() {
75 75
                 return ErrorProvider::class;
76 76
             });
77 77
         }
@@ -86,30 +86,30 @@  discard block
 block discarded – undo
86 86
     {
87 87
         // for revision records,
88 88
         // the master key is assigned as revision.
89
-        $this->app->register('revision',[]);
89
+        $this->app->register('revision', []);
90 90
 
91 91
         //we're saving the directory where kernel files are running to the kernel object.
92
-        $this->app->register('corePath',str_replace('Foundation','',__DIR__.''));
92
+        $this->app->register('corePath', str_replace('Foundation', '', __DIR__.''));
93 93
 
94 94
         //For the application, we create the object that the register method,
95 95
         // which is the container center, is connected to by the kernel object register method.
96
-        $this->app->register('container',$this->app);
96
+        $this->app->register('container', $this->app);
97 97
 
98 98
         // We are saving the application class to
99 99
         // the container object for the appClass value.
100
-        $this->app->register('appClass',new \application());
100
+        $this->app->register('appClass', new \application());
101 101
 
102 102
         //set closure bind instance for application
103
-        $this->app->register('appClosureInstance',ClosureDispatcher::bind(app()));
103
+        $this->app->register('appClosureInstance', ClosureDispatcher::bind(app()));
104 104
 
105 105
         //set closure bind instance for bootLoader class
106
-        $this->app->register('closureBootLoader',ClosureDispatcher::bind($this->app['bootLoader']));
106
+        $this->app->register('closureBootLoader', ClosureDispatcher::bind($this->app['bootLoader']));
107 107
 
108 108
         //set register for macro
109
-        $this->app->register('macro',$this->app->resolve(Macro::class));
109
+        $this->app->register('macro', $this->app->resolve(Macro::class));
110 110
 
111 111
         //set register for macro
112
-        $this->app->register('pipeline',new Pipeline());
112
+        $this->app->register('pipeline', new Pipeline());
113 113
 
114 114
     }
115 115
 
@@ -123,10 +123,10 @@  discard block
 block discarded – undo
123 123
         //register as instance application object
124 124
         // and container instance resolve
125 125
         //set core instance value
126
-        $this->app->instance('container',$this->app->singleton());
127
-        $this->app->instance('bootLoader',$this->app->resolve(BootLoader::class));
128
-        $this->app->instance('containerInstanceResolve',ContainerInstanceResolver::class);
129
-        $this->app->instance('reflection',ReflectionProcess::class);
126
+        $this->app->instance('container', $this->app->singleton());
127
+        $this->app->instance('bootLoader', $this->app->resolve(BootLoader::class));
128
+        $this->app->instance('containerInstanceResolve', ContainerInstanceResolver::class);
129
+        $this->app->instance('reflection', ReflectionProcess::class);
130 130
     }
131 131
 
132 132
     /**
@@ -138,17 +138,17 @@  discard block
 block discarded – undo
138 138
     private function setGlobalAccessor()
139 139
     {
140 140
         //get response success and status
141
-        $this->app->register('instanceController',null);
142
-        $this->app->register('responseSuccess',true);
143
-        $this->app->register('responseStatus',200);
144
-        $this->app->register('responseType','json');
141
+        $this->app->register('instanceController', null);
142
+        $this->app->register('responseSuccess', true);
143
+        $this->app->register('responseStatus', 200);
144
+        $this->app->register('responseType', 'json');
145 145
 
146 146
         //we first load the response class as a singleton object to allow you to send output anywhere
147
-        $this->app->register('out',$this->app->resolve(ResponseProvider::class));
147
+        $this->app->register('out', $this->app->resolve(ResponseProvider::class));
148 148
 
149 149
         //The HttpFoundation component defines an object-oriented layer for the HTTP specification.
150 150
         //The HttpFoundation component replaces these default PHP global variables and functions by an object-oriented layer
151
-        if(Utils::isNamespaceExists(RequestService::class)){
151
+        if (Utils::isNamespaceExists(RequestService::class)) {
152 152
 
153 153
             Request::setFactory(function(array $query = array(),
154 154
                                          array $request = array(),
@@ -170,16 +170,16 @@  discard block
 block discarded – undo
170 170
 
171 171
 
172 172
         //After registering the symfony request method, we also save the get and post methods for user convenience.
173
-        $this->app->register('request',Request::createFromGlobals());
174
-        $this->app->register('get',core()->request->query->all());
175
-        $this->app->register('post',core()->request->request->all());
173
+        $this->app->register('request', Request::createFromGlobals());
174
+        $this->app->register('get', core()->request->query->all());
175
+        $this->app->register('post', core()->request->request->all());
176 176
 
177 177
         //We determine with the kernel object which HTTP method the requested from the client
178
-        $this->app->register('httpMethod',ucfirst(strtolower(core()->request->getRealMethod())));
178
+        $this->app->register('httpMethod', ucfirst(strtolower(core()->request->getRealMethod())));
179 179
 
180
-        define('httpMethod',strtoupper(core()->httpMethod));
180
+        define('httpMethod', strtoupper(core()->httpMethod));
181 181
 
182
-        $this->app->register('fileSystem',new FileProcess());
182
+        $this->app->register('fileSystem', new FileProcess());
183 183
     }
184 184
 
185 185
 }
186 186
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,8 +34,7 @@
 block discarded – undo
34 34
         // if not available, only the core is executed.
35 35
         if(file_exists(app()->path()->storeDir())){
36 36
             $this->app->register('isAvailableStore',true);
37
-        }
38
-        else{
37
+        } else{
39 38
             $this->app->register('isAvailableStore',false);
40 39
         }
41 40
     }
Please login to merge, or discard this patch.
src/resta/Container/ContainerKernelAssigner.php 2 patches
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -12,12 +12,12 @@  discard block
 block discarded – undo
12 12
      * @param $callback
13 13
      * @return void
14 14
      */
15
-    public function consoleShared($object,$callback)
15
+    public function consoleShared($object, $callback)
16 16
     {
17 17
         //The console share is evaluated as a true variable to be assigned as the 3rd parameter in the classes to be bound.
18 18
         //The work to be done here is to bind the classes to be included in the console share privately.
19
-        if($this->app->console()){
20
-            $this->app->register('consoleShared',$object,$this->getConcrete($callback));
19
+        if ($this->app->console()) {
20
+            $this->app->register('consoleShared', $object, $this->getConcrete($callback));
21 21
         }
22 22
     }
23 23
 
@@ -27,8 +27,8 @@  discard block
 block discarded – undo
27 27
     public function container()
28 28
     {
29 29
         //We are initializing the array property for the service container object.
30
-        if(!isset($this->app['serviceContainer'])){
31
-            $this->app->register('serviceContainer',[]);
30
+        if (!isset($this->app['serviceContainer'])) {
31
+            $this->app->register('serviceContainer', []);
32 32
         }
33 33
     }
34 34
 
@@ -48,22 +48,22 @@  discard block
 block discarded – undo
48 48
      * @param $concrete
49 49
      * @return void
50 50
      */
51
-    private function setKernel($object,$concrete)
51
+    private function setKernel($object, $concrete)
52 52
     {
53 53
         //We check that the concrete object
54 54
         //is an object that can be retrieved.
55
-        if(!isset($this->app[$object]) && class_exists($concrete)){
55
+        if (!isset($this->app[$object]) && class_exists($concrete)) {
56 56
 
57 57
             //get concrete instance
58 58
             $concreteInstance = $this->app->resolve($concrete);
59 59
 
60 60
             //the value corresponding to the bind value for the global object is assigned and
61 61
             //the resolve method is called for the dependency injection.
62
-            $this->app->register($object,$concreteInstance);
62
+            $this->app->register($object, $concreteInstance);
63 63
 
64 64
             // this method is executed if the concrete instance contains the handle method.
65 65
             // if no handle method is included, the concrete instance is returned directly.
66
-            $registerObjectInstance = (method_exists($concreteInstance,'handle'))
66
+            $registerObjectInstance = (method_exists($concreteInstance, 'handle'))
67 67
                 ? $concreteInstance->handle()
68 68
                 : $concreteInstance;
69 69
 
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
      * @param null $value
77 77
      * @return void
78 78
      */
79
-    public function setKernelObject($object,$concrete,$value=null)
79
+    public function setKernelObject($object, $concrete, $value = null)
80 80
     {
81 81
         //if a pre loader class wants to have before kernel values,
82 82
         //it must return a callback to the bind method
@@ -84,22 +84,22 @@  discard block
 block discarded – undo
84 84
 
85 85
         //the value is directly assigned to the kernel object.
86 86
         //The value is moved throughout the application in the kernel of the application object.
87
-        if($value===null){
88
-            $this->setKernel($object,$concrete);
87
+        if ($value===null) {
88
+            $this->setKernel($object, $concrete);
89 89
         }
90 90
 
91 91
         //The service container value is moved differently from the value directly assigned to the kernel object.
92 92
         //The application container is booted directly with the service container custom class
93 93
         //in the version section of the your application.
94
-        if($value==="serviceContainer"){
95
-            $this->setServiceContainer($object,$concrete);
94
+        if ($value==="serviceContainer") {
95
+            $this->setServiceContainer($object, $concrete);
96 96
         }
97 97
 
98 98
         // we will resolve the value of concrete according to whether it is an object.
99 99
         $detectorBindings = (is_object($concrete)) ? $concrete : Utils::resolverClass($concrete);
100 100
 
101 101
         //we register the bound object to the kernel bindings property.
102
-        $this->app->register('bindings',$object,$detectorBindings);
102
+        $this->app->register('bindings', $object, $detectorBindings);
103 103
 
104 104
     }
105 105
 
@@ -108,17 +108,17 @@  discard block
 block discarded – undo
108 108
      * @param $concrete
109 109
      * @return void
110 110
      */
111
-    private function setServiceContainer($object,$concrete)
111
+    private function setServiceContainer($object, $concrete)
112 112
     {
113 113
         //We check that the concrete object
114 114
         //is an object that can be retrieved.
115
-        if(isset($this->app['serviceContainer']) && !isset($this->app['serviceContainer'][$object])){
115
+        if (isset($this->app['serviceContainer']) && !isset($this->app['serviceContainer'][$object])) {
116 116
 
117 117
             //the value corresponding to the bind value for the global object is assigned and
118 118
             //the resolve method is called for the dependency method.
119
-            $this->app->register('serviceContainer',$object,$concrete);
119
+            $this->app->register('serviceContainer', $object, $concrete);
120 120
         }
121
-        else{
121
+        else {
122 122
 
123 123
             // the service container objects are saved only once.
124 124
             // Overflow exception is thrown on multiple records.
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -117,8 +117,7 @@
 block discarded – undo
117 117
             //the value corresponding to the bind value for the global object is assigned and
118 118
             //the resolve method is called for the dependency method.
119 119
             $this->app->register('serviceContainer',$object,$concrete);
120
-        }
121
-        else{
120
+        } else{
122 121
 
123 122
             // the service container objects are saved only once.
124 123
             // Overflow exception is thrown on multiple records.
Please login to merge, or discard this patch.
src/resta/Container/ContainerResolve.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -18,21 +18,21 @@  discard block
 block discarded – undo
18 18
      *
19 19
      * @throws \ReflectionException
20 20
      */
21
-    public function call($class,$param,callable $callback)
21
+    public function call($class, $param, callable $callback)
22 22
     {
23 23
         // We use the reflection class to solve
24 24
         // the parameters of the class's methods.
25
-        $param = $this->reflectionMethodParameters($class,$param);
25
+        $param = $this->reflectionMethodParameters($class, $param);
26 26
 
27 27
         // the results of a number of processes will be given
28 28
         // before the container pipeline method is given.
29 29
         return $this->app->resolve(ContainerPipelineResolve::class)->handle(
30
-            function() use($class,$param,$callback)
30
+            function() use($class, $param, $callback)
31 31
             {
32 32
                 // as a result
33 33
                 // we return the resolved class to the callback class
34
-                $params = (object)['class'=>$class,'param'=>$param];
35
-                return call_user_func_array($callback,[$params]);
34
+                $params = (object)['class'=>$class, 'param'=>$param];
35
+                return call_user_func_array($callback, [$params]);
36 36
             });
37 37
 
38 38
     }
@@ -44,12 +44,12 @@  discard block
 block discarded – undo
44 44
      * @param $parameter
45 45
      * @return array
46 46
      */
47
-    private function checkParameterForContainer($containers,$parameter)
47
+    private function checkParameterForContainer($containers, $parameter)
48 48
     {
49 49
         // if the parameter is an object and
50 50
         // this object is a service container object
51 51
         // then the parameter will bind.
52
-        if($parameter->getType()!==null && isset($containers[$parameter->getType()->getName()])){
52
+        if ($parameter->getType()!==null && isset($containers[$parameter->getType()->getName()])) {
53 53
 
54 54
             // Unpack the container object and
55 55
             // bind it to the param variable.
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
             return [$parameterName=>$parameterResolve];
69 69
         }
70 70
 
71
-        if($parameter->getType()!== NULL && Utils::isNamespaceExists($parameter->getType()->getName())){
71
+        if ($parameter->getType()!==NULL && Utils::isNamespaceExists($parameter->getType()->getName())) {
72 72
 
73 73
             // Unpack the container object and
74 74
             // bind it to the param variable.
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
      */
92 92
     private function getReflectionMethod($class)
93 93
     {
94
-        [$class,$method] = [$class[0],$class[1]];
94
+        [$class, $method] = [$class[0], $class[1]];
95 95
 
96 96
         return $this->app['reflection']($class)->reflectionMethodParams($method);
97 97
     }
@@ -105,12 +105,12 @@  discard block
 block discarded – undo
105 105
      *
106 106
      * @throws \ReflectionException
107 107
      */
108
-    private function reflectionMethodParameters($class,$param)
108
+    private function reflectionMethodParameters($class, $param)
109 109
     {
110 110
         $containers = [];
111 111
 
112 112
         //get service container objects.
113
-        if(isset($this->app['serviceContainer'])){
113
+        if (isset($this->app['serviceContainer'])) {
114 114
             $containers = $this->app['serviceContainer'];
115 115
         }
116 116
 
@@ -122,22 +122,22 @@  discard block
 block discarded – undo
122 122
         // we provide the user with the container method document and take action.
123 123
         // thus, we help the methods to have a cleaner code structure.
124 124
         $this->app->resolve(ContainerMethodDocumentResolver::class,
125
-            ['document'=>$reflection->document,'class'=>$class]);
125
+            ['document'=>$reflection->document, 'class'=>$class]);
126 126
 
127 127
         // we group the parameters into type and
128 128
         // name and bind them with the necessary logic.
129
-        foreach ($parameters as $parameter){
129
+        foreach ($parameters as $parameter) {
130 130
 
131 131
             // if the parameter is an object and
132 132
             // this object is a service container object
133 133
             // then the parameter will bind.
134
-            $checkParameterForContainer = $this->checkParameterForContainer($containers,$parameter);
135
-            $paramMerge = array_merge($param,$checkParameterForContainer);
134
+            $checkParameterForContainer = $this->checkParameterForContainer($containers, $parameter);
135
+            $paramMerge = array_merge($param, $checkParameterForContainer);
136 136
 
137 137
             // we do some useful logic bind for user benefit.
138
-            $param = app()->resolve(GraceContainer::class,[
138
+            $param = app()->resolve(GraceContainer::class, [
139 139
                 'reflection' => $reflection->reflection
140
-            ])->graceContainerBuilder($parameter,$paramMerge);
140
+            ])->graceContainerBuilder($parameter, $paramMerge);
141 141
 
142 142
         }
143 143
 
Please login to merge, or discard this patch.