@@ -52,7 +52,7 @@ |
||
52 | 52 | $this->options['href'] = Url::to($this->link); |
53 | 53 | } |
54 | 54 | if ($this->buttonType) { |
55 | - Html::addCssClass($this->options, 'btn-'.$this->buttonType); |
|
55 | + Html::addCssClass($this->options, 'btn-' . $this->buttonType); |
|
56 | 56 | } |
57 | 57 | if ($this->iconClass) { |
58 | 58 | $this->label = Html::tag('span', '', [ |
@@ -19,7 +19,7 @@ |
||
19 | 19 | { |
20 | 20 | return array_merge(parent::rules(), [ |
21 | 21 | [['password'], 'string', 'min' => 6], |
22 | - [['auth_key'], 'default', 'value' => function () { |
|
22 | + [['auth_key'], 'default', 'value' => function() { |
|
23 | 23 | return $this->generateAuthKey(); |
24 | 24 | }], |
25 | 25 | ]); |
@@ -62,6 +62,6 @@ |
||
62 | 62 | */ |
63 | 63 | public function __toString() |
64 | 64 | { |
65 | - return $this->domain->name . ': ' . $this->source . ' => '. $this->destination; |
|
65 | + return $this->domain->name . ': ' . $this->source . ' => ' . $this->destination; |
|
66 | 66 | } |
67 | 67 | } |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | [['domain_id', 'email'], 'required'], |
37 | 37 | [['domain_id'], 'exist', 'targetClass' => MailerDomain::class, 'targetAttribute' => 'id'], |
38 | 38 | [['email'], 'string', 'max' => 120], |
39 | - [['email'], 'filter', 'filter' => function ($value) { |
|
39 | + [['email'], 'filter', 'filter' => function($value) { |
|
40 | 40 | return $value . '@' . $this->domain->name; |
41 | 41 | }], |
42 | 42 | [['email'], 'unique', 'targetAttribute' => ['domain_id', 'email'], 'message' => 'Email is not unique'], |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | |
79 | 79 | protected function generatePasswordHash($string) |
80 | 80 | { |
81 | - return crypt($string, '$6$'.substr(md5(rand(1, 10000)), -16)); |
|
81 | + return crypt($string, '$6$' . substr(md5(rand(1, 10000)), -16)); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | protected function randomPassword($length = self::PASSWORD_LENGTH) |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | { |
57 | 57 | $model = new MailerAccount(); |
58 | 58 | if ($model->load(Yii::$app->request->post()) && $model->validate()) { |
59 | - $password = $model->generatePassword(); |
|
59 | + $password = $model->generatePassword(); |
|
60 | 60 | if ($model->save(false)) { |
61 | 61 | $this |
62 | 62 | ->addFlashMessage('Account created: ' . $model->email, self::FLASH_SUCCESS) |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | if ($model->load($request->post()) && $model->validate()) { |
84 | 84 | $password = null; |
85 | 85 | if (!empty($request->post($model->formName())['password'])) { |
86 | - $password = $model->generatePassword(); |
|
86 | + $password = $model->generatePassword(); |
|
87 | 87 | } |
88 | 88 | if ($model->save(false)) { |
89 | 89 | $this->addFlashMessage('Account updated: ' . $model->email, self::FLASH_SUCCESS); |
@@ -20,7 +20,7 @@ |
||
20 | 20 | 'fixture' => [ |
21 | 21 | 'class' => 'yii\console\controllers\FixtureController', |
22 | 22 | 'namespace' => 'common\fixtures', |
23 | - ], |
|
23 | + ], |
|
24 | 24 | ], |
25 | 25 | 'components' => [ |
26 | 26 | 'db' => [ |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | { |
24 | 24 | echo Table::widget([ |
25 | 25 | 'headers' => ['User', 'Status', 'Modified'], |
26 | - 'rows' => array_map(function (User $user) { |
|
26 | + 'rows' => array_map(function(User $user) { |
|
27 | 27 | return [ |
28 | 28 | $user->username, |
29 | 29 | $user->status === User::STATUS_ACTIVE ? 'Active' : '', |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | $user = $this->findModel($username); |
73 | 73 | $password = $this->prompt('Please, input new password:', [ |
74 | 74 | 'required' => true, |
75 | - 'validator' => function ($input, &$error) { |
|
75 | + 'validator' => function($input, &$error) { |
|
76 | 76 | if (strlen($input) < 6) { |
77 | 77 | $error = 'Password must be at least 6 characters'; |
78 | 78 | return false; |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | protected function findModel($username) |
98 | 98 | { |
99 | 99 | $user = User::find() |
100 | - ->where([ 'username' => $username ]) |
|
100 | + ->where(['username' => $username]) |
|
101 | 101 | ->one(); |
102 | 102 | if (!$user) { |
103 | 103 | throw new Exception('User not found'); |