Passed
Push — master ( 752bd4...a4e603 )
by Php Easy Api
03:43
created
src/resta/Foundation/ApplicationBaseRegister.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
         $this->isAvailableStore();
63 63
 
64 64
         //global accessor handling
65
-       $this->setGlobalAccessor();
65
+        $this->setGlobalAccessor();
66 66
 
67 67
         // sets a user-defined error handler function
68 68
         // this function can be used for defining your own way of handling errors during runtime,
@@ -148,12 +148,12 @@  discard block
 block discarded – undo
148 148
         if(Utils::isNamespaceExists($requestService)){
149 149
 
150 150
             Request::setFactory(function(array $query = array(),
151
-                                         array $request = array(),
152
-                                         array $attributes = array(),
153
-                                         array $cookies = array(),
154
-                                         array $files = array(),
155
-                                         array $server = array(),
156
-                                         $content = null) use ($requestService)
151
+                                            array $request = array(),
152
+                                            array $attributes = array(),
153
+                                            array $cookies = array(),
154
+                                            array $files = array(),
155
+                                            array $server = array(),
156
+                                            $content = null) use ($requestService)
157 157
             {
158 158
                 return new $requestService($query,
159 159
                     $request,
Please login to merge, or discard this patch.
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -29,11 +29,11 @@  discard block
 block discarded – undo
29 29
         // if the store directory is available,
30 30
         // then the application process continues.
31 31
         // if not available, only the core is executed.
32
-        if(file_exists(app()->path()->storeDir())){
33
-            $this->app->register('isAvailableStore',true);
32
+        if (file_exists(app()->path()->storeDir())) {
33
+            $this->app->register('isAvailableStore', true);
34 34
         }
35
-        else{
36
-            $this->app->register('isAvailableStore',false);
35
+        else {
36
+            $this->app->register('isAvailableStore', false);
37 37
         }
38 38
     }
39 39
 
@@ -47,13 +47,13 @@  discard block
 block discarded – undo
47 47
     {
48 48
         //we can use this method to move an instance of the application class with the kernel object
49 49
         //and easily resolve an encrypted instance of all the kernel variables in our helper class.
50
-        ClassAliasGroup::setAlias(App::class,'application');
50
+        ClassAliasGroup::setAlias(App::class, 'application');
51 51
 
52 52
         //set base instances
53 53
         $this->setBaseInstances();
54 54
 
55 55
         //we define the general application instance object.
56
-        define('appInstance',(base64_encode(serialize($this))));
56
+        define('appInstance', (base64_encode(serialize($this))));
57 57
 
58 58
         //main loader for application
59 59
         $this->mainLoader();
@@ -68,8 +68,8 @@  discard block
 block discarded – undo
68 68
         // this function can be used for defining your own way of handling errors during runtime,
69 69
         // for example in applications in which you need to do cleanup of data/files when a critical error happens,
70 70
         // or when you need to trigger an error under certain conditions (using trigger_error()).
71
-        if($this->app['isAvailableStore']){
72
-            $this->app->make('exception',function(){
71
+        if ($this->app['isAvailableStore']) {
72
+            $this->app->make('exception', function() {
73 73
                 return ErrorProvider::class;
74 74
             });
75 75
         }
@@ -84,30 +84,30 @@  discard block
 block discarded – undo
84 84
     {
85 85
         // for revision records,
86 86
         // the master key is assigned as revision.
87
-        $this->app->register('revision',[]);
87
+        $this->app->register('revision', []);
88 88
 
89 89
         //we're saving the directory where kernel files are running to the kernel object.
90
-        $this->app->register('corePath',str_replace('Foundation','',__DIR__.''));
90
+        $this->app->register('corePath', str_replace('Foundation', '', __DIR__.''));
91 91
 
92 92
         //For the application, we create the object that the register method,
93 93
         // which is the container center, is connected to by the kernel object register method.
94
-        $this->app->register('container',$this->app);
94
+        $this->app->register('container', $this->app);
95 95
 
96 96
         // We are saving the application class to
97 97
         // the container object for the appClass value.
98
-        $this->app->register('appClass',new App());
98
+        $this->app->register('appClass', new App());
99 99
 
100 100
         //set closure bind instance for application
101
-        $this->app->register('appClosureInstance',ClosureDispatcher::bind(app()));
101
+        $this->app->register('appClosureInstance', ClosureDispatcher::bind(app()));
102 102
 
103 103
         //set closure bind instance for bootLoader class
104
-        $this->app->register('closureBootLoader',ClosureDispatcher::bind($this->app['bootLoader']));
104
+        $this->app->register('closureBootLoader', ClosureDispatcher::bind($this->app['bootLoader']));
105 105
 
106 106
         //set register for macro
107
-        $this->app->register('macro',$this->app->resolve(Macro::class));
107
+        $this->app->register('macro', $this->app->resolve(Macro::class));
108 108
 
109 109
         //set register for macro
110
-        $this->app->register('pipeline',new Pipeline());
110
+        $this->app->register('pipeline', new Pipeline());
111 111
 
112 112
     }
113 113
 
@@ -121,10 +121,10 @@  discard block
 block discarded – undo
121 121
         //register as instance application object
122 122
         // and container instance resolve
123 123
         //set core instance value
124
-        $this->app->instance('container',$this->app->singleton());
125
-        $this->app->instance('bootLoader',$this->app->resolve(BootLoader::class));
126
-        $this->app->instance('containerInstanceResolve',ContainerInstanceResolver::class);
127
-        $this->app->instance('reflection',ReflectionProcess::class);
124
+        $this->app->instance('container', $this->app->singleton());
125
+        $this->app->instance('bootLoader', $this->app->resolve(BootLoader::class));
126
+        $this->app->instance('containerInstanceResolve', ContainerInstanceResolver::class);
127
+        $this->app->instance('reflection', ReflectionProcess::class);
128 128
     }
129 129
 
130 130
     /**
@@ -133,19 +133,19 @@  discard block
 block discarded – undo
133 133
     private function setGlobalAccessor()
134 134
     {
135 135
         //get response success and status
136
-        $this->app->register('instanceController',null);
137
-        $this->app->register('responseSuccess',true);
138
-        $this->app->register('responseStatus',200);
139
-        $this->app->register('responseType','json');
136
+        $this->app->register('instanceController', null);
137
+        $this->app->register('responseSuccess', true);
138
+        $this->app->register('responseStatus', 200);
139
+        $this->app->register('responseType', 'json');
140 140
 
141 141
         //we first load the response class as a singleton object to allow you to send output anywhere
142
-        $this->app->register('out',$this->app->resolve(ResponseProvider::class));
142
+        $this->app->register('out', $this->app->resolve(ResponseProvider::class));
143 143
 
144 144
         $requestService = "Store\Services\RequestService";
145 145
 
146 146
         //The HttpFoundation component defines an object-oriented layer for the HTTP specification.
147 147
         //The HttpFoundation component replaces these default PHP global variables and functions by an object-oriented layer
148
-        if(Utils::isNamespaceExists($requestService)){
148
+        if (Utils::isNamespaceExists($requestService)) {
149 149
 
150 150
             Request::setFactory(function(array $query = array(),
151 151
                                          array $request = array(),
@@ -167,16 +167,16 @@  discard block
 block discarded – undo
167 167
 
168 168
 
169 169
         //After registering the symfony request method, we also save the get and post methods for user convenience.
170
-        $this->app->register('request',Request::createFromGlobals());
171
-        $this->app->register('get',core()->request->query->all());
172
-        $this->app->register('post',core()->request->request->all());
170
+        $this->app->register('request', Request::createFromGlobals());
171
+        $this->app->register('get', core()->request->query->all());
172
+        $this->app->register('post', core()->request->request->all());
173 173
 
174 174
         //We determine with the kernel object which HTTP method the requested from the client
175
-        $this->app->register('httpMethod',ucfirst(strtolower(core()->request->getRealMethod())));
175
+        $this->app->register('httpMethod', ucfirst(strtolower(core()->request->getRealMethod())));
176 176
 
177
-        define('httpMethod',strtoupper(core()->httpMethod));
177
+        define('httpMethod', strtoupper(core()->httpMethod));
178 178
 
179
-        $this->app->register('fileSystem',new FileProcess());
179
+        $this->app->register('fileSystem', new FileProcess());
180 180
     }
181 181
 
182 182
 }
183 183
\ No newline at end of file
Please login to merge, or discard this patch.