@@ -87,11 +87,11 @@ |
||
87 | 87 | // allow authenticated users if invites are allowed |
88 | 88 | [ |
89 | 89 | 'allow' => setting('user', 'allowUserInvitations', false), |
90 | - 'roles' => [ 'neon-administrator' ] |
|
90 | + 'roles' => ['neon-administrator'] |
|
91 | 91 | ], |
92 | 92 | [ |
93 | 93 | 'allow' => setting('user', 'allowUserInvitations', false), |
94 | - 'matchCallback' => function ($rule, $action) { |
|
94 | + 'matchCallback' => function($rule, $action) { |
|
95 | 95 | return neon()->user->isSuper(); |
96 | 96 | } |
97 | 97 | ] |
@@ -68,7 +68,7 @@ |
||
68 | 68 | return neon()->mailer->compose($templates, $templateData) |
69 | 69 | ->setFrom([$fromAddress => $fromName]) |
70 | 70 | ->setTo($this->email) |
71 | - ->setSubject('Password reset for ' . $siteName) |
|
71 | + ->setSubject('Password reset for '.$siteName) |
|
72 | 72 | ->send(); |
73 | 73 | } |
74 | 74 | } |
@@ -14,7 +14,7 @@ |
||
14 | 14 | // the key fields in this table are responsible for the session |
15 | 15 | // this is the session id, expire and data fields. After that the next important field is the user_uuid |
16 | 16 | // then the following additional information fields |
17 | - $this->addColumn(\neon\user\models\Session::tableName(), 'user_uuid', $this->uuid64() .' AFTER `data`'); |
|
17 | + $this->addColumn(\neon\user\models\Session::tableName(), 'user_uuid', $this->uuid64().' AFTER `data`'); |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | public function safeDown() |
@@ -9,7 +9,7 @@ |
||
9 | 9 | { |
10 | 10 | $this->createTable(UserInvite::tableName(), [ |
11 | 11 | 'token'=>'varchar(255) CHARACTER SET latin1 COLLATE latin1_general_cs PRIMARY KEY COMMENT "The token"', |
12 | - 'user_id'=> $this->uuid64( 'foreign key of the user who owns this token')->notNull(), |
|
12 | + 'user_id'=> $this->uuid64('foreign key of the user who owns this token')->notNull(), |
|
13 | 13 | // timestamps |
14 | 14 | 'expires_at' => $this->dateTime(), |
15 | 15 | 'created_at' => $this->createdAt(), |
@@ -71,22 +71,22 @@ |
||
71 | 71 | 'created_at' => $this->integer(), |
72 | 72 | 'updated_at' => $this->integer(), |
73 | 73 | 'PRIMARY KEY (name)', |
74 | - 'FOREIGN KEY (rule_name) REFERENCES ' . neon()->authManager->ruleTable . ' (name) ON DELETE SET NULL ON UPDATE CASCADE' |
|
74 | + 'FOREIGN KEY (rule_name) REFERENCES '.neon()->authManager->ruleTable.' (name) ON DELETE SET NULL ON UPDATE CASCADE' |
|
75 | 75 | ]); |
76 | 76 | $this->createIndex('idx-auth_item-type', AuthItem::tableName(), 'type'); |
77 | 77 | $this->createTable(AuthItemChild::tableName(), [ |
78 | 78 | 'parent' => $this->string(64)->notNull(), |
79 | 79 | 'child' => $this->string(64)->notNull(), |
80 | 80 | 'PRIMARY KEY (parent, child)', |
81 | - 'FOREIGN KEY (parent) REFERENCES ' . neon()->authManager->itemTable . ' (name) ON DELETE CASCADE ON UPDATE CASCADE', |
|
82 | - 'FOREIGN KEY (child) REFERENCES ' . neon()->authManager->itemTable . ' (name) ON DELETE CASCADE ON UPDATE CASCADE' |
|
81 | + 'FOREIGN KEY (parent) REFERENCES '.neon()->authManager->itemTable.' (name) ON DELETE CASCADE ON UPDATE CASCADE', |
|
82 | + 'FOREIGN KEY (child) REFERENCES '.neon()->authManager->itemTable.' (name) ON DELETE CASCADE ON UPDATE CASCADE' |
|
83 | 83 | ]); |
84 | 84 | $this->createTable(AuthAssignment::tableName(), [ |
85 | 85 | 'item_name' => $this->string(64)->notNull(), |
86 | 86 | 'user_id' => $this->string(64)->notNull(), |
87 | 87 | 'created_at' => $this->integer(), |
88 | 88 | 'PRIMARY KEY (item_name, user_id)', |
89 | - 'FOREIGN KEY (item_name) REFERENCES ' . neon()->authManager->itemTable . ' (name) ON DELETE CASCADE ON UPDATE CASCADE', |
|
89 | + 'FOREIGN KEY (item_name) REFERENCES '.neon()->authManager->itemTable.' (name) ON DELETE CASCADE ON UPDATE CASCADE', |
|
90 | 90 | ]); |
91 | 91 | $this->createTable(Session::tableName(), [ |
92 | 92 | 'id' => 'CHAR(64) NOT NULL PRIMARY KEY', |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | /** |
126 | 126 | * @inheritdoc |
127 | 127 | */ |
128 | - public function getDataMap($key, $query='', $filters=[], $fields=[], $start=0, $length=100) |
|
128 | + public function getDataMap($key, $query = '', $filters = [], $fields = [], $start = 0, $length = 100) |
|
129 | 129 | { |
130 | 130 | if ($key === 'users') { |
131 | 131 | return User::getUserList($query, $filters, $fields, $start, $length); |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | * @param array &$roles the roles that matched |
277 | 277 | * @return boolean whether it matched any roles |
278 | 278 | */ |
279 | - public function routeHasRoles($route, &$roles=null) |
|
279 | + public function routeHasRoles($route, &$roles = null) |
|
280 | 280 | { |
281 | 281 | $roles = []; |
282 | 282 | foreach ($this->_routes as $r) { |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | } |
286 | 286 | } |
287 | 287 | // allow guest access if this is the only allowed role |
288 | - if (count($roles)==1 && isset($roles['?'])) |
|
288 | + if (count($roles) == 1 && isset($roles['?'])) |
|
289 | 289 | return false; |
290 | 290 | // otherwise restrict to requiring a role if one matched |
291 | 291 | return (count($roles) > 0); |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | ['class'=>'email'], |
32 | 32 | ['class'=>'required'] |
33 | 33 | ], |
34 | - 'placeholder' => 'e.g. robot@' . strtolower(setting('core', 'site_name', neon()->name)) . '.com' |
|
34 | + 'placeholder' => 'e.g. robot@'.strtolower(setting('core', 'site_name', neon()->name)).'.com' |
|
35 | 35 | ], |
36 | 36 | 'fromEmailName' => [ |
37 | 37 | 'name' => 'fromEmailName', |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | 'name' => 'sslOnly', |
44 | 44 | 'class' => '\neon\core\form\fields\SwitchButton', |
45 | 45 | 'label' => 'Force SSL (https) everywhere', |
46 | - 'hint' => 'The application will redirect all requests to secure https requests. ' . |
|
46 | + 'hint' => 'The application will redirect all requests to secure https requests. '. |
|
47 | 47 | (neon()->isDevMode() ? 'Note: You are currently in dev mode so the redirects to https will not happen' : '') |
48 | 48 | ], |
49 | 49 | ]; |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | (for example, plural in |
72 | 72 | <a href=\"http://www.yiiframework.com/doc-2.0/yii-i18n-formatter.html#asRelativeTime%28%29-detail\"> |
73 | 73 | Formatter::asRelativeTime()</a>) in the <code>yii\i18n\Formatter</code> class. Your current ICU version is ' . |
74 | - (defined('INTL_ICU_VERSION') ? INTL_ICU_VERSION : '(ICU is missing)') . '.' |
|
74 | + (defined('INTL_ICU_VERSION') ? INTL_ICU_VERSION : '(ICU is missing)').'.' |
|
75 | 75 | ], |
76 | 76 | [ |
77 | 77 | 'name' => 'ICU Data version', |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | (for example, plural in |
83 | 83 | <a href=\"http://www.yiiframework.com/doc-2.0/yii-i18n-formatter.html#asRelativeTime%28%29-detail\"> |
84 | 84 | Formatter::asRelativeTime()</a>) in the <code>yii\i18n\Formatter</code> class. Your current ICU Data version is ' . |
85 | - (defined('INTL_ICU_DATA_VERSION') ? INTL_ICU_DATA_VERSION : '(ICU Data is missing)') . '.' |
|
85 | + (defined('INTL_ICU_DATA_VERSION') ? INTL_ICU_DATA_VERSION : '(ICU Data is missing)').'.' |
|
86 | 86 | ], |
87 | 87 | [ |
88 | 88 | 'name' => 'Fileinfo extension', |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | */ |
22 | 22 | public static function getLocalConfigFile() |
23 | 23 | { |
24 | - return \Neon::getALias(DIR_CONFIG . '/env.ini'); |
|
24 | + return \Neon::getALias(DIR_CONFIG.'/env.ini'); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | /** |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | |
43 | 43 | 0 => 'Ready Check', // (a requirements check stage) |
44 | 44 | 1 => 'Configure', // condition=>self::hasLocalConfigFile // create config file |
45 | - 2 => 'Database Install',// condition=>self::tablesExist // install tables |
|
45 | + 2 => 'Database Install', // condition=>self::tablesExist // install tables |
|
46 | 46 | 3 => 'Account', // condition=>self::hasUserAccount // install user admin account |
47 | 47 | 4 => 'Log In' // (just a "well done, all done", link to log in page) |
48 | 48 | ]; |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | try { |
113 | 113 | \Neon::$app->db->open(); |
114 | 114 | return true; |
115 | - } catch(\Exception $e) { |
|
115 | + } catch (\Exception $e) { |
|
116 | 116 | return false; |
117 | 117 | } |
118 | 118 | } |
@@ -225,14 +225,14 @@ discard block |
||
225 | 225 | public static function getAllMigrations() |
226 | 226 | { |
227 | 227 | $migrations = ['core' => [], 'apps' => []]; |
228 | - foreach(neon()->getCoreApps() as $appName => $config) { |
|
228 | + foreach (neon()->getCoreApps() as $appName => $config) { |
|
229 | 229 | $app = neon()->getApp($appName); |
230 | 230 | if ($app) { |
231 | 231 | $ms = $app->getNewMigrations(); |
232 | 232 | $migrations['core'][$appName] = $ms; |
233 | 233 | } |
234 | 234 | } |
235 | - foreach(neon()->getApps() as $appName => $config) { |
|
235 | + foreach (neon()->getApps() as $appName => $config) { |
|
236 | 236 | $app = neon()->getApp($appName); |
237 | 237 | if ($app) { |
238 | 238 | $ms = $app->getNewMigrations(); |
@@ -397,11 +397,11 @@ discard block |
||
397 | 397 | * @return boolean |
398 | 398 | * @throws \yii\db\Exception |
399 | 399 | */ |
400 | - private static function checkForUserAccounts($super=false) |
|
400 | + private static function checkForUserAccounts($super = false) |
|
401 | 401 | { |
402 | 402 | $userTable = \neon\user\models\User::tableName(); |
403 | 403 | try { |
404 | - $query = 'SELECT `id` from ' . $userTable; |
|
404 | + $query = 'SELECT `id` from '.$userTable; |
|
405 | 405 | if ($super) |
406 | 406 | $query .= " WHERE `super`=1"; |
407 | 407 | $result = neon()->db->createCommand($query)->queryOne(); |