@@ -5,7 +5,8 @@ |
||
5 | 5 | } |
6 | 6 | |
7 | 7 | // Super debug func |
8 | -function prr($value) { |
|
8 | +function prr($value) |
|
9 | +{ |
|
9 | 10 | if (defined('DEBUG_MODE') && DEBUG_MODE == 1) { |
10 | 11 | echo '<pre>'; |
11 | 12 | print_r($value); |
@@ -8,8 +8,7 @@ |
||
8 | 8 | */ |
9 | 9 | public function up() |
10 | 10 | { |
11 | - Capsule::schema()->create('roles', function($table) |
|
12 | - { |
|
11 | + Capsule::schema()->create('roles', function($table) { |
|
13 | 12 | $table->increments('id'); |
14 | 13 | $table->string('name')->unique(); |
15 | 14 | $table->string('description'); |
@@ -2,7 +2,8 @@ |
||
2 | 2 | use App\Model\Role; |
3 | 3 | use App\Model\User; |
4 | 4 | |
5 | -class CreateRolesRightsUsers { |
|
5 | +class CreateRolesRightsUsers |
|
6 | +{ |
|
6 | 7 | public function run() |
7 | 8 | { |
8 | 9 | Role::create([ |
@@ -141,7 +141,7 @@ |
||
141 | 141 | $user->setPassword($params['data']['attributes']['password']); |
142 | 142 | $user->removePasswordResetToken(); |
143 | 143 | |
144 | - if($user->save()){ |
|
144 | + if($user->save()) { |
|
145 | 145 | return $this->renderer->jsonApiRender($response, 204); |
146 | 146 | }; |
147 | 147 | } |
@@ -163,7 +163,8 @@ discard block |
||
163 | 163 | /** |
164 | 164 | * Register model observers |
165 | 165 | */ |
166 | - private function registerModelObservers(){ |
|
166 | + private function registerModelObservers() |
|
167 | + { |
|
167 | 168 | $observers = [ |
168 | 169 | Observers\CreatedByAndUpdatedByObserver::class => [ |
169 | 170 | Model\Right::class, |
@@ -178,8 +179,8 @@ discard block |
||
178 | 179 | ] |
179 | 180 | ]; |
180 | 181 | |
181 | - foreach($observers as $observer => $models){ |
|
182 | - foreach($models as $model){ |
|
182 | + foreach($observers as $observer => $models) { |
|
183 | + foreach($models as $model) { |
|
183 | 184 | call_user_func($model. '::observe', $observer); |
184 | 185 | } |
185 | 186 | } |
@@ -45,7 +45,7 @@ |
||
45 | 45 | return false; |
46 | 46 | } |
47 | 47 | return true; |
48 | - } catch (\Exception $e){ |
|
48 | + } catch (\Exception $e) { |
|
49 | 49 | return false; |
50 | 50 | } |
51 | 51 | } |
@@ -51,8 +51,7 @@ |
||
51 | 51 | $i = 1; |
52 | 52 | $token = ''; |
53 | 53 | |
54 | - while ($i <= $length) |
|
55 | - { |
|
54 | + while ($i <= $length) { |
|
56 | 55 | $num = rand() % $charsCount; |
57 | 56 | $tmp = substr($chars, $num, 1); |
58 | 57 | $token .= $tmp; |
@@ -50,10 +50,12 @@ |
||
50 | 50 | ob_start(); |
51 | 51 | $this->protectedIncludeScope($this->templatePath . $template, $data); |
52 | 52 | $output = ob_get_clean(); |
53 | - } catch(\Throwable $e) { // PHP 7+ |
|
53 | + } catch(\Throwable $e) { |
|
54 | +// PHP 7+ |
|
54 | 55 | ob_end_clean(); |
55 | 56 | throw $e; |
56 | - } catch(\Exception $e) { // PHP < 7 |
|
57 | + } catch(\Exception $e) { |
|
58 | +// PHP < 7 |
|
57 | 59 | ob_end_clean(); |
58 | 60 | throw $e; |
59 | 61 | } |
@@ -8,8 +8,7 @@ |
||
8 | 8 | */ |
9 | 9 | public function up() |
10 | 10 | { |
11 | - Capsule::schema()->create('rights', function($table) |
|
12 | - { |
|
11 | + Capsule::schema()->create('rights', function($table) { |
|
13 | 12 | $table->increments('id'); |
14 | 13 | $table->string('name')->unique(); |
15 | 14 | $table->string('description'); |