Test Setup Failed
Push — master ( 373408...f0f097 )
by Php Easy Api
03:20
created
src/resta/Database/Migration/Src/Resource/PushManager/PushingProcess.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -11,19 +11,19 @@  discard block
 block discarded – undo
11 11
      */
12 12
     public function processHandler()
13 13
     {
14
-        return $this->errorHandler(function(){
14
+        return $this->errorHandler(function() {
15 15
             
16
-            foreach ($this->list as $table =>$datas){
16
+            foreach ($this->list as $table =>$datas) {
17 17
 
18
-                foreach ($datas as $data){
18
+                foreach ($datas as $data) {
19 19
 
20
-                    $query = $this->queryBuilder($table,$data);
20
+                    $query = $this->queryBuilder($table, $data);
21 21
 
22 22
                     $query = $query->handle();
23 23
 
24
-                    $status =($query['result']!==false) ? true : false;
24
+                    $status = ($query['result']!==false) ? true : false;
25 25
 
26
-                    $results[]= [
26
+                    $results[] = [
27 27
                         'success'=>$status,
28 28
                         'file'=>$data->getFile(),
29 29
                         'table'=>$table,
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
         {
51 51
             foreach ($objects as $object)
52 52
             {
53
-                if(count($object->getError())){
53
+                if (count($object->getError())) {
54 54
                     return 'error : '.$object->getFile().' -> '.$object->getError()[0].'';
55 55
                 }
56 56
             }
Please login to merge, or discard this patch.
src/resta/Authenticate/Resource/AuthLoginCredentialsManager.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
      * @param $credentials
32 32
      * @param null|AuthLoginManager $manager
33 33
      */
34
-    public function __construct($credentials,$manager)
34
+    public function __construct($credentials, $manager)
35 35
     {
36 36
         //get credentials as default
37 37
         $this->credentials = $credentials;
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
         //get credential hash
43 43
         $this->setCredentialHash();
44 44
 
45
-        if($this->manager->getUsing()===false){
45
+        if ($this->manager->getUsing()===false) {
46 46
 
47 47
             // the request object will help you process
48 48
             // the credentials and get them correctly.
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
     {
95 95
         $request = $this->manager->getAuth()->getRequest();
96 96
 
97
-        if($request=='Default'){
97
+        if ($request=='Default') {
98 98
             return new AuthenticateRequest($this);
99 99
         }
100 100
 
@@ -122,8 +122,8 @@  discard block
 block discarded – undo
122 122
     private function setCredentialHash()
123 123
     {
124 124
         //set credential hash
125
-        if(count($this->credentials)){
126
-            $this->credentialHash = md5(sha1(implode("|",$this->credentials)));
125
+        if (count($this->credentials)) {
126
+            $this->credentialHash = md5(sha1(implode("|", $this->credentials)));
127 127
         }
128 128
     }
129 129
 }
130 130
\ No newline at end of file
Please login to merge, or discard this patch.
src/resta/Authenticate/Resource/ResourceManager.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
     {
26 26
         // if the auth value does not carry
27 27
         // the authenticateProvider instance value, an exception is thrown.
28
-        if(!$auth instanceof AuthenticateProvider){
28
+        if (!$auth instanceof AuthenticateProvider) {
29 29
             exception()->runtime('AuthenticateProvider instance is not valid');
30 30
         }
31 31
 
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
         // the imported builder object.
41 41
         $this->driverBuilderInstance = new $driverBuilder($auth);
42 42
 
43
-        if(!$this->driverBuilderInstance instanceof BuilderContract){
43
+        if (!$this->driverBuilderInstance instanceof BuilderContract) {
44 44
             exception()->runtime($driverBuilder.' is not instance of '.BuilderContract::class);
45 45
         }
46 46
     }
Please login to merge, or discard this patch.
src/resta/Authenticate/Driver/BuilderParamGenerator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
      */
13 13
     protected function paramValues(...$params)
14 14
     {
15
-        [$type,$query] = $params;
15
+        [$type, $query] = $params;
16 16
 
17 17
         // with query we bind the returned values to the params property of the auth object.
18 18
         // and so the auth object will make a final return with these values.
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 
23 23
         // if status is true,
24 24
         // we add values ​​for some user benefits to params global access.
25
-        if($this->auth->params['status']){
25
+        if ($this->auth->params['status']) {
26 26
 
27 27
             $this->auth->params['auth']        = $query->get();
28 28
             $this->auth->params['data']        = $query->first();
Please login to merge, or discard this patch.
src/resta/Authenticate/ConfigProvider.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
     {
39 39
         $this->config();
40 40
 
41
-        if($this->guard=="default"){
41
+        if ($this->guard=="default") {
42 42
             $this->setAuthenticateNeeds();
43 43
         }
44 44
     }
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
      */
63 63
     public function getAddToWhere()
64 64
     {
65
-        if(isset($this->config['guard'][$this->guard]['addToWhere'])){
65
+        if (isset($this->config['guard'][$this->guard]['addToWhere'])) {
66 66
             return $this->config['guard'][$this->guard]['addToWhere'];
67 67
         }
68 68
         return null;
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
      */
76 76
     public function getConfigToken()
77 77
     {
78
-        if(isset($this->config['guard'][$this->guard]['token'])){
78
+        if (isset($this->config['guard'][$this->guard]['token'])) {
79 79
             return $this->config['guard'][$this->guard]['token'];
80 80
         }
81 81
         return null;
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
     {
101 101
         $this->getModel();
102 102
 
103
-        if($this->model=="Default"){
103
+        if ($this->model=="Default") {
104 104
 
105 105
             return $this->driverDefaultNamespace.'\\'.$this->getDriver().'\\UserBuilder';
106 106
         }
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
     {
128 128
         $this->getModel();
129 129
 
130
-        if($this->model=="Default"){
130
+        if ($this->model=="Default") {
131 131
 
132 132
             return $this->driverDefaultNamespace.'\\'.$this->getDriver().'\\User';
133 133
         }
Please login to merge, or discard this patch.
src/resta/Authenticate/Resource/AuthLoginManager.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -19,16 +19,16 @@  discard block
 block discarded – undo
19 19
      * @param $credentials
20 20
      * @param $auth
21 21
      */
22
-    public function __construct($credentials,$auth)
22
+    public function __construct($credentials, $auth)
23 23
     {
24 24
         parent::__construct($auth);
25 25
 
26 26
         // where the control mechanism of the credentials
27 27
         // values received from the user-defined yada config setting is made.
28
-        $this->credentials = new AuthLoginCredentialsManager($this->getCredentials($credentials),$this);
28
+        $this->credentials = new AuthLoginCredentialsManager($this->getCredentials($credentials), $this);
29 29
 
30 30
         //query login
31
-        if($this->auth->getModel()=="Default"){
31
+        if ($this->auth->getModel()=="Default") {
32 32
             $this->loginProcess();
33 33
         }
34 34
     }
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
         // if the user is not going to use the config setting,
44 44
         // then in this case it can attempt to login by sending parameters
45 45
         // as an array to the login method.
46
-        if(is_array($credentials) && count($credentials)){
46
+        if (is_array($credentials) && count($credentials)) {
47 47
 
48 48
             $this->using = true;
49 49
             return $credentials;
Please login to merge, or discard this patch.
src/resta/Authenticate/AuthenticateRequest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
         $this->credentials = $credentials;
45 45
 
46 46
         //credentials loop for expected property
47
-        foreach ($this->credentials->get() as $credential){
47
+        foreach ($this->credentials->get() as $credential) {
48 48
             $this->expected[] = $credential;
49 49
         }
50 50
 
Please login to merge, or discard this patch.
src/resta/Authenticate/Driver/Eloquent/UserBuilderHelper.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -197,8 +197,7 @@
 block discarded – undo
197 197
                     'device_agent_integer' => crc32(md5($_SERVER['HTTP_USER_AGENT'])),
198 198
                     'expire' => 0
199 199
                 ]);
200
-            }
201
-            else{
200
+            } else{
202 201
 
203 202
                 return DeviceToken::where('user_id',$this->auth->params['authId'])
204 203
                     ->where('device_agent_integer',crc32(md5($_SERVER['HTTP_USER_AGENT'])))
Please login to merge, or discard this patch.
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
      */
31 31
     protected function callbackQueryWithoutCredentials($driver)
32 32
     {
33
-        if($this->isCallableAddToWhere()){
33
+        if ($this->isCallableAddToWhere()) {
34 34
 
35 35
             return $driver::where(function($query) {
36 36
 
@@ -52,8 +52,8 @@  discard block
 block discarded – undo
52 52
         return DeviceToken::where(function($query) use($token) {
53 53
 
54 54
             //where query for token
55
-            $query->where('token_integer',crc32(md5($token)));
56
-            $query->where('device_agent_integer',crc32(md5($_SERVER['HTTP_USER_AGENT'])));
55
+            $query->where('token_integer', crc32(md5($token)));
56
+            $query->where('device_agent_integer', crc32(md5($_SERVER['HTTP_USER_AGENT'])));
57 57
 
58 58
             // if the addToWhereClosure value is a closure,
59 59
             // then in this case we actually run
@@ -82,8 +82,8 @@  discard block
 block discarded – undo
82 82
         return DeviceToken::where(function($query) use($token) {
83 83
 
84 84
             //where query for token
85
-            $query->where('token_integer',crc32(md5($token)));
86
-            $query->where('device_agent_integer',crc32(md5($_SERVER['HTTP_USER_AGENT'])));
85
+            $query->where('token_integer', crc32(md5($token)));
86
+            $query->where('device_agent_integer', crc32(md5($_SERVER['HTTP_USER_AGENT'])));
87 87
 
88 88
             // if the addToWhereClosure value is a closure,
89 89
             // then in this case we actually run
@@ -100,13 +100,13 @@  discard block
 block discarded – undo
100 100
      * @param array $credentials
101 101
      * @return mixed
102 102
      */
103
-    protected function queryAddToWhere($query,$credentials=array())
103
+    protected function queryAddToWhere($query, $credentials = array())
104 104
     {
105 105
         // if the addToWhereClosure value is a closure,
106 106
         // then in this case we actually run
107 107
         // the closure object and add it to the query value.
108
-        if($this->isCallableAddToWhere()){
109
-            return $this->query['addToWhere']($query,$credentials);
108
+        if ($this->isCallableAddToWhere()) {
109
+            return $this->query['addToWhere']($query, $credentials);
110 110
         }
111 111
     }
112 112
 
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
         //we get the model specified for the builder.
122 122
         $driver = $this->query['driver'];
123 123
 
124
-        if(count($credentials->get())==0){
124
+        if (count($credentials->get())==0) {
125 125
 
126 126
             // if the credential array is empty in the config section,
127 127
             // then you must run the query with a callable value of addToWhere value.
@@ -129,8 +129,8 @@  discard block
 block discarded – undo
129 129
         }
130 130
 
131 131
         //
132
-        if($this->isCallableAddToWhere()){
133
-            return $this->queryAddToWhere($driver,$credentials->get());
132
+        if ($this->isCallableAddToWhere()) {
133
+            return $this->queryAddToWhere($driver, $credentials->get());
134 134
         }
135 135
 
136 136
         // using the driver object we write the query builder statement.
@@ -139,24 +139,24 @@  discard block
 block discarded – undo
139 139
 
140 140
             // with the callback method (eloquent model)
141 141
             // we write the where clause.
142
-            foreach ($credentials->get() as $credential=>$credentialValue){
143
-                $query->where($credential,$credentialValue);
142
+            foreach ($credentials->get() as $credential=>$credentialValue) {
143
+                $query->where($credential, $credentialValue);
144 144
             }
145 145
 
146 146
             // if the addToWhereClosure value is a closure,
147 147
             // then in this case we actually run
148 148
             // the closure object and add it to the query value.
149
-            $this->queryAddToWhere($query,$credentials->get(),$credentials->get());
149
+            $this->queryAddToWhere($query, $credentials->get(), $credentials->get());
150 150
         });
151 151
     }
152 152
 
153 153
     /**
154 154
      * @return void|mixed
155 155
      */
156
-    protected function updateToken($token=null)
156
+    protected function updateToken($token = null)
157 157
     {
158 158
         //if query status value is true
159
-        if($this->auth->params['status']){
159
+        if ($this->auth->params['status']) {
160 160
 
161 161
             // we go to the method that produces
162 162
             // the classical token value and get the token value.
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
             // if there is no update, we reset the status value to 0.
167 167
             $update = $this->auth->params['builder']->update(['token'=>$this->auth->params['token']]);
168 168
 
169
-            if(!$update){
169
+            if (!$update) {
170 170
                 $this->auth->params['status'] = 0;
171 171
                 $this->auth->params['exception'] = 'update';
172 172
             }
@@ -182,10 +182,10 @@  discard block
 block discarded – undo
182 182
     {
183 183
         $token_integer = crc32(md5($this->auth->params['token']));
184 184
 
185
-        if(!is_null($token_integer)){
185
+        if (!is_null($token_integer)) {
186 186
 
187
-            if(DeviceToken::where('user_id',$this->auth->params['authId'])
188
-                ->where('device_agent_integer',crc32(md5($_SERVER['HTTP_USER_AGENT'])))->count()==0){
187
+            if (DeviceToken::where('user_id', $this->auth->params['authId'])
188
+                ->where('device_agent_integer', crc32(md5($_SERVER['HTTP_USER_AGENT'])))->count()==0) {
189 189
                 return DeviceToken::create([
190 190
                     'user_id' => $this->auth->params['authId'],
191 191
                     'token' => $this->auth->params['token'],
@@ -195,10 +195,10 @@  discard block
 block discarded – undo
195 195
                     'expire' => 0
196 196
                 ]);
197 197
             }
198
-            else{
198
+            else {
199 199
 
200
-                return DeviceToken::where('user_id',$this->auth->params['authId'])
201
-                    ->where('device_agent_integer',crc32(md5($_SERVER['HTTP_USER_AGENT'])))
200
+                return DeviceToken::where('user_id', $this->auth->params['authId'])
201
+                    ->where('device_agent_integer', crc32(md5($_SERVER['HTTP_USER_AGENT'])))
202 202
                     ->update([
203 203
                     'token' => $this->auth->params['token'],
204 204
                     'token_integer' => $token_integer
@@ -218,12 +218,12 @@  discard block
 block discarded – undo
218 218
     {
219 219
         $token_integer = crc32(md5($this->auth->getTokenData()));
220 220
 
221
-        if(!is_null($token_integer)){
221
+        if (!is_null($token_integer)) {
222 222
 
223
-            if(DeviceToken::where('user_id',$this->auth->params['authId'])
224
-                    ->where('device_agent_integer',crc32(md5($_SERVER['HTTP_USER_AGENT'])))->count()){
223
+            if (DeviceToken::where('user_id', $this->auth->params['authId'])
224
+                    ->where('device_agent_integer', crc32(md5($_SERVER['HTTP_USER_AGENT'])))->count()) {
225 225
 
226
-                DeviceToken::where('token_integer',$token_integer)->delete();
226
+                DeviceToken::where('token_integer', $token_integer)->delete();
227 227
             }
228 228
         }
229 229
 
Please login to merge, or discard this patch.
src/resta/Authenticate/Driver/Eloquent/DeviceToken.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,5 +13,5 @@
 block discarded – undo
13 13
     /**
14 14
      * @var array 
15 15
      */
16
-    protected $fillable = ['user_id','token','token_integer','device_agent','device_agent_integer','expire'];
16
+    protected $fillable = ['user_id', 'token', 'token_integer', 'device_agent', 'device_agent_integer', 'expire'];
17 17
 }
Please login to merge, or discard this patch.