@@ -30,7 +30,7 @@ discard block |
||
| 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 | |
@@ -49,13 +49,13 @@ discard block |
||
| 49 | 49 | protected function checkQuery($token) |
| 50 | 50 | {
|
| 51 | 51 | //we get the model specified for the builder. |
| 52 | - $driver=$this->query['driver']; |
|
| 52 | + $driver = $this->query['driver']; |
|
| 53 | 53 | |
| 54 | 54 | //token query for builder |
| 55 | 55 | return $driver::where(function($query) use($token) {
|
| 56 | 56 | |
| 57 | 57 | //where query for token |
| 58 | - $query->where('token',$token);
|
|
| 58 | + $query->where('token', $token);
|
|
| 59 | 59 | |
| 60 | 60 | // if the addToWhereClosure value is a closure, |
| 61 | 61 | // then in this case we actually run |
@@ -81,13 +81,13 @@ discard block |
||
| 81 | 81 | protected function logoutQuery($token) |
| 82 | 82 | {
|
| 83 | 83 | //we get the model specified for the builder. |
| 84 | - $driver=$this->query['driver']; |
|
| 84 | + $driver = $this->query['driver']; |
|
| 85 | 85 | |
| 86 | 86 | //token query for builder |
| 87 | - $query=$driver::where(function($query) use($token) {
|
|
| 87 | + $query = $driver::where(function($query) use($token) {
|
|
| 88 | 88 | |
| 89 | 89 | //where query for token |
| 90 | - $query->where('token',$token);
|
|
| 90 | + $query->where('token', $token);
|
|
| 91 | 91 | |
| 92 | 92 | // if the addToWhereClosure value is a closure, |
| 93 | 93 | // then in this case we actually run |
@@ -106,13 +106,13 @@ discard block |
||
| 106 | 106 | * @param array $credentials |
| 107 | 107 | * @return mixed |
| 108 | 108 | */ |
| 109 | - protected function queryAddToWhere($query,$credentials=array()) |
|
| 109 | + protected function queryAddToWhere($query, $credentials = array()) |
|
| 110 | 110 | {
|
| 111 | 111 | // if the addToWhereClosure value is a closure, |
| 112 | 112 | // then in this case we actually run |
| 113 | 113 | // the closure object and add it to the query value. |
| 114 | - if($this->isCallableAddToWhere()){
|
|
| 115 | - return $this->query['addToWhere']($query,$credentials); |
|
| 114 | + if ($this->isCallableAddToWhere()) {
|
|
| 115 | + return $this->query['addToWhere']($query, $credentials); |
|
| 116 | 116 | } |
| 117 | 117 | } |
| 118 | 118 | |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | //we get the model specified for the builder. |
| 128 | 128 | $driver = $this->query['driver']; |
| 129 | 129 | |
| 130 | - if(count($credentials->get())==0){
|
|
| 130 | + if (count($credentials->get())==0) {
|
|
| 131 | 131 | |
| 132 | 132 | // if the credential array is empty in the config section, |
| 133 | 133 | // then you must run the query with a callable value of addToWhere value. |
@@ -135,8 +135,8 @@ discard block |
||
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | // |
| 138 | - if($this->isCallableAddToWhere()){
|
|
| 139 | - return $this->queryAddToWhere($driver,$credentials->get()); |
|
| 138 | + if ($this->isCallableAddToWhere()) {
|
|
| 139 | + return $this->queryAddToWhere($driver, $credentials->get()); |
|
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | // using the driver object we write the query builder statement. |
@@ -145,24 +145,24 @@ discard block |
||
| 145 | 145 | |
| 146 | 146 | // with the callback method (eloquent model) |
| 147 | 147 | // we write the where clause. |
| 148 | - foreach ($credentials->get() as $credential=>$credentialValue){
|
|
| 149 | - $query->where($credential,$credentialValue); |
|
| 148 | + foreach ($credentials->get() as $credential=>$credentialValue) {
|
|
| 149 | + $query->where($credential, $credentialValue); |
|
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | // if the addToWhereClosure value is a closure, |
| 153 | 153 | // then in this case we actually run |
| 154 | 154 | // the closure object and add it to the query value. |
| 155 | - $this->queryAddToWhere($query,$credentials->get(),$credentials->get()); |
|
| 155 | + $this->queryAddToWhere($query, $credentials->get(), $credentials->get()); |
|
| 156 | 156 | }); |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | /** |
| 160 | 160 | * @return void|mixed |
| 161 | 161 | */ |
| 162 | - protected function updateToken($token=null) |
|
| 162 | + protected function updateToken($token = null) |
|
| 163 | 163 | {
|
| 164 | 164 | //if query status value is true |
| 165 | - if($this->auth->params['status']){
|
|
| 165 | + if ($this->auth->params['status']) {
|
|
| 166 | 166 | |
| 167 | 167 | // we go to the method that produces |
| 168 | 168 | // the classical token value and get the token value. |
@@ -172,9 +172,9 @@ discard block |
||
| 172 | 172 | // if there is no update, we reset the status value to 0. |
| 173 | 173 | $update = $this->auth->params['builder']->update(['token'=>$this->auth->params['token']]); |
| 174 | 174 | |
| 175 | - if(!$update){
|
|
| 176 | - $this->auth->params['status']=0; |
|
| 177 | - $this->auth->params['exception']='update'; |
|
| 175 | + if (!$update) {
|
|
| 176 | + $this->auth->params['status'] = 0; |
|
| 177 | + $this->auth->params['exception'] = 'update'; |
|
| 178 | 178 | } |
| 179 | 179 | } |
| 180 | 180 | } |