@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | return $constants; |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | - return array_filter($constants, function ($key) use ($startsWithFilter) { |
|
| 102 | + return array_filter($constants, function($key) use ($startsWithFilter) { |
|
| 103 | 103 | return starts_with(strtolower($key), strtolower($startsWithFilter)); |
| 104 | 104 | }, ARRAY_FILTER_USE_KEY); |
| 105 | 105 | } |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | /** @return \App\Services\Auth\Front\User|null */ |
| 125 | 125 | function current_front_user() |
| 126 | 126 | { |
| 127 | - if (! auth()->guard('front')->check()) { |
|
| 127 | + if (!auth()->guard('front')->check()) { |
|
| 128 | 128 | return null; |
| 129 | 129 | } |
| 130 | 130 | |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | /** @return \App\Services\Auth\Back\User|null */ |
| 135 | 135 | function current_back_user() |
| 136 | 136 | { |
| 137 | - if (! auth()->guard('back')->check()) { |
|
| 137 | + if (!auth()->guard('back')->check()) { |
|
| 138 | 138 | return null; |
| 139 | 139 | } |
| 140 | 140 | |
@@ -144,15 +144,13 @@ discard block |
||
| 144 | 144 | function login_url() : string |
| 145 | 145 | { |
| 146 | 146 | return request()->isFront() ? |
| 147 | - action('Front\AuthController@getLogin') : |
|
| 148 | - action('Back\AuthController@getLogin'); |
|
| 147 | + action('Front\AuthController@getLogin') : action('Back\AuthController@getLogin'); |
|
| 149 | 148 | } |
| 150 | 149 | |
| 151 | 150 | function logout_url() : string |
| 152 | 151 | { |
| 153 | 152 | return request()->isFront() ? |
| 154 | - action('Front\AuthController@getLogout') : |
|
| 155 | - action('Back\AuthController@getLogout'); |
|
| 153 | + action('Front\AuthController@getLogout') : action('Back\AuthController@getLogout'); |
|
| 156 | 154 | } |
| 157 | 155 | |
| 158 | 156 | function register_url() : string |
@@ -10,6 +10,9 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | class ArticlePresenter extends Presenter |
| 12 | 12 | { |
| 13 | + /** |
|
| 14 | + * @param integer $characters |
|
| 15 | + */ |
|
| 13 | 16 | public function tease($characters, $moreTextIndicator = '...') : Str |
| 14 | 17 | { |
| 15 | 18 | return (string) string($this->entity->text)->tease($characters, $moreTextIndicator); |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | |
| 31 | 31 | return Cache::rememberForever( |
| 32 | 32 | "locale.fragments.{$locale}.{$group}", |
| 33 | - function () use ($group, $locale) { |
|
| 33 | + function() use ($group, $locale) { |
|
| 34 | 34 | return Fragment::getGroup($group, $locale); |
| 35 | 35 | } |
| 36 | 36 | ); |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | */ |
| 19 | 19 | public static function findByName(string $name) |
| 20 | 20 | { |
| 21 | - return app('cache')->rememberForever("fragment.findByName.{$name}", function () use ($name) { |
|
| 21 | + return app('cache')->rememberForever("fragment.findByName.{$name}", function() use ($name) { |
|
| 22 | 22 | return static::where('name', $name)->first(); |
| 23 | 23 | }); |
| 24 | 24 | } |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | return static::query() |
| 29 | 29 | ->where('name', 'LIKE', "{$group}.%") |
| 30 | 30 | ->get() |
| 31 | - ->map(function (Fragment $fragment) use ($locale, $group) { |
|
| 31 | + ->map(function(Fragment $fragment) use ($locale, $group) { |
|
| 32 | 32 | return [ |
| 33 | 33 | 'key' => preg_replace("/{$group}\\./", '', $fragment->name, 1), |
| 34 | 34 | 'text' => $fragment->translate($locale)->text, |
@@ -2,30 +2,30 @@ |
||
| 2 | 2 | |
| 3 | 3 | Route::demoAccess('/demo'); |
| 4 | 4 | |
| 5 | -Route::group(['namespace' => 'Back', 'prefix' => 'blender'], function () { |
|
| 5 | +Route::group(['namespace' => 'Back', 'prefix' => 'blender'], function() { |
|
| 6 | 6 | |
| 7 | - require __DIR__ . '/back_auth.php'; |
|
| 7 | + require __DIR__.'/back_auth.php'; |
|
| 8 | 8 | |
| 9 | - Route::group(['middleware' => 'auth'], function () { |
|
| 10 | - require __DIR__ . '/back.php'; |
|
| 9 | + Route::group(['middleware' => 'auth'], function() { |
|
| 10 | + require __DIR__.'/back.php'; |
|
| 11 | 11 | }); |
| 12 | 12 | }); |
| 13 | 13 | |
| 14 | -Route::group(['namespace' => 'Front', 'middleware' => 'demoMode'], function () { |
|
| 14 | +Route::group(['namespace' => 'Front', 'middleware' => 'demoMode'], function() { |
|
| 15 | 15 | |
| 16 | 16 | $multiLingual = count(config('app.locales')) > 1; |
| 17 | 17 | |
| 18 | - Route::group($multiLingual ? ['prefix' => locale()] : [], function () { |
|
| 18 | + Route::group($multiLingual ? ['prefix' => locale()] : [], function() { |
|
| 19 | 19 | try { |
| 20 | - require __DIR__ . '/front_auth.php'; |
|
| 21 | - require __DIR__ . '/front.php'; |
|
| 20 | + require __DIR__.'/front_auth.php'; |
|
| 21 | + require __DIR__.'/front.php'; |
|
| 22 | 22 | } catch (Exception $exception) { |
| 23 | 23 | logger()->warning('Front routes weren\'t included.'); |
| 24 | 24 | } |
| 25 | 25 | }); |
| 26 | 26 | |
| 27 | 27 | if ($multiLingual) { |
| 28 | - Route::get('/', function () { |
|
| 28 | + Route::get('/', function() { |
|
| 29 | 29 | return redirect(locale()); |
| 30 | 30 | }); |
| 31 | 31 | } |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | public function label(string $name, bool $required = false, array $options = []) : string |
| 29 | 29 | { |
| 30 | - return Form::label($name, fragment("back.{$this->module}.{$name}") . ($required ? '*' : ''), $options); |
|
| 30 | + return Form::label($name, fragment("back.{$this->module}.{$name}").($required ? '*' : ''), $options); |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | public function error(string $name) : string |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | $fieldName = $this->fieldName($name, $locale); |
| 85 | 85 | |
| 86 | 86 | $contents = Form::checkbox($fieldName, 1, Form::useInitialValue($this->model, $name, $locale), |
| 87 | - ['class' => 'form-control']) . ' ' . fragment("back.{$this->module}.{$name}"); |
|
| 87 | + ['class' => 'form-control']).' '.fragment("back.{$this->module}.{$name}"); |
|
| 88 | 88 | |
| 89 | 89 | return $this->group([el('label.-checkbox', $contents)]); |
| 90 | 90 | } |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | public function tags(string $type) : string |
| 136 | 136 | { |
| 137 | 137 | return $this->group([ |
| 138 | - Form::label($type.'_tags[]', fragment("back.{$this->module}.{$type}") . '*'), |
|
| 138 | + Form::label($type.'_tags[]', fragment("back.{$this->module}.{$type}").'*'), |
|
| 139 | 139 | Form::tags($this->model, $type), |
| 140 | 140 | ]); |
| 141 | 141 | } |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | public function category(string $type) : string |
| 144 | 144 | { |
| 145 | 145 | return $this->group([ |
| 146 | - Form::label($type.'_tags[]', fragment("back.{$this->module}.{$type}") . '*'), |
|
| 146 | + Form::label($type.'_tags[]', fragment("back.{$this->module}.{$type}").'*'), |
|
| 147 | 147 | Form::category($this->model, $type, ['data-select'=>'select']), |
| 148 | 148 | ]); |
| 149 | 149 | } |
@@ -67,7 +67,7 @@ |
||
| 67 | 67 | [ |
| 68 | 68 | 'class' => 'button -danger -small', |
| 69 | 69 | ] |
| 70 | - ) . el('span.fa.fa-remove') . Form::closeButton(); |
|
| 70 | + ).el('span.fa.fa-remove').Form::closeButton(); |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | public function onlineIndicator(bool $online) : string |