@@ -18,7 +18,6 @@ |
||
18 | 18 | use yii\base\InvalidArgumentException; |
19 | 19 | use yii\base\Model; |
20 | 20 | use yii\base\ModelEvent; |
21 | -use Yii; |
|
22 | 21 | use Exception; |
23 | 22 | use yii\base\NotSupportedException; |
24 | 23 | use yii\helpers\Inflector; |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | if ($this->hasAttribute($name)) { |
172 | 172 | $this->_attributes[$name] = $value; |
173 | 173 | } else { |
174 | - throw new InvalidArgumentException(get_class($this) . ' has no attribute named "' . $name . '".'); |
|
174 | + throw new InvalidArgumentException(get_class($this).' has no attribute named "'.$name.'".'); |
|
175 | 175 | } |
176 | 176 | } |
177 | 177 | |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | if (isset($this->_oldAttributes[$name]) || $this->hasAttribute($name)) { |
209 | 209 | $this->_oldAttributes[$name] = $value; |
210 | 210 | } else { |
211 | - throw new InvalidArgumentException(get_class($this) . ' has no attribute named "' . $name . '".'); |
|
211 | + throw new InvalidArgumentException(get_class($this).' has no attribute named "'.$name.'".'); |
|
212 | 212 | } |
213 | 213 | } |
214 | 214 | |
@@ -382,10 +382,10 @@ discard block |
||
382 | 382 | * If not set, [[formName()]] will be used. |
383 | 383 | * @return boolean whether the model is successfully populated with some data. |
384 | 384 | */ |
385 | - public function loadIds($data, $formName=null) |
|
385 | + public function loadIds($data, $formName = null) |
|
386 | 386 | { |
387 | 387 | $camelData = []; |
388 | - foreach($data as $key => $value) { |
|
388 | + foreach ($data as $key => $value) { |
|
389 | 389 | $key = lcfirst(Inflector::id2camel($key)); |
390 | 390 | $camelData[$key] = $value; |
391 | 391 | } |
@@ -15,14 +15,12 @@ |
||
15 | 15 | namespace sweelix\oauth2\server\services\redis; |
16 | 16 | |
17 | 17 | use sweelix\oauth2\server\interfaces\BaseModelInterface; |
18 | -use sweelix\oauth2\server\models\BaseModel; |
|
19 | 18 | use sweelix\oauth2\server\Module; |
20 | 19 | use sweelix\oauth2\server\traits\redis\TypeConverter; |
21 | 20 | use yii\base\BaseObject; |
22 | 21 | use yii\di\Instance; |
23 | 22 | use yii\helpers\Json; |
24 | 23 | use yii\redis\Connection; |
25 | -use Yii; |
|
26 | 24 | |
27 | 25 | /** |
28 | 26 | * This is the base service for redis |
@@ -77,10 +77,10 @@ discard block |
||
77 | 77 | $client->grantTypes = empty($this->grantTypes) ? null : explode(',', $this->grantTypes); |
78 | 78 | if ($client->save() === true) { |
79 | 79 | $this->stdout('Client created :'."\n"); |
80 | - $this->stdout(' - id: ' . $client->id . "\n"); |
|
81 | - $this->stdout(' - secret: ' . $client->secret . "\n"); |
|
82 | - $this->stdout(' - name: ' . $client->name . "\n"); |
|
83 | - $this->stdout(' - redirectUri: ' . implode(',', $client->redirectUri) . "\n"); |
|
80 | + $this->stdout(' - id: '.$client->id."\n"); |
|
81 | + $this->stdout(' - secret: '.$client->secret."\n"); |
|
82 | + $this->stdout(' - name: '.$client->name."\n"); |
|
83 | + $this->stdout(' - redirectUri: '.implode(',', $client->redirectUri)."\n"); |
|
84 | 84 | return ExitCode::OK; |
85 | 85 | } else { |
86 | 86 | $this->stdout('Client cannot be created.'."\n"); |
@@ -99,11 +99,11 @@ discard block |
||
99 | 99 | $client->scopes = empty($this->scope) ? null : explode(',', $this->scopes); |
100 | 100 | $client->grantTypes = empty($this->grantTypes) ? null : explode(',', $this->grantTypes); |
101 | 101 | if ($client->save() === true) { |
102 | - $this->stdout('Client updated :' . "\n"); |
|
103 | - $this->stdout(' - id: ' . $client->id . "\n"); |
|
104 | - $this->stdout(' - secret: ' . $client->secret . "\n"); |
|
105 | - $this->stdout(' - name: ' . $client->name . "\n"); |
|
106 | - $this->stdout(' - redirectUri: ' . implode(',', $client->redirectUri) . "\n"); |
|
102 | + $this->stdout('Client updated :'."\n"); |
|
103 | + $this->stdout(' - id: '.$client->id."\n"); |
|
104 | + $this->stdout(' - secret: '.$client->secret."\n"); |
|
105 | + $this->stdout(' - name: '.$client->name."\n"); |
|
106 | + $this->stdout(' - redirectUri: '.implode(',', $client->redirectUri)."\n"); |
|
107 | 107 | return ExitCode::OK; |
108 | 108 | } else { |
109 | 109 | $this->stdout('Client cannot be updated.'."\n"); |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | */ |
124 | 124 | protected function getRandomString($length = 40) |
125 | 125 | { |
126 | - $bytes = (int) $length/2; |
|
126 | + $bytes = (int)$length/2; |
|
127 | 127 | return bin2hex(openssl_random_pseudo_bytes($bytes)); |
128 | 128 | } |
129 | 129 | } |