@@ -26,14 +26,14 @@ discard block |
||
| 26 | 26 | { |
| 27 | 27 | $types = config('thinktomorrow.chief.menus', []); |
| 28 | 28 | |
| 29 | - return collect($types)->map(function ($menu, $key) { |
|
| 29 | + return collect($types)->map(function($menu, $key) { |
|
| 30 | 30 | return new static($key, $menu['label'], $menu['view']); |
| 31 | 31 | }); |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | public static function find($key): ?self |
| 35 | 35 | { |
| 36 | - return static::all()->filter(function ($menu) use ($key) { |
|
| 36 | + return static::all()->filter(function($menu) use ($key) { |
|
| 37 | 37 | return $menu->key() == $key; |
| 38 | 38 | })->first(); |
| 39 | 39 | } |
@@ -82,10 +82,10 @@ discard block |
||
| 82 | 82 | { |
| 83 | 83 | $menu = []; |
| 84 | 84 | |
| 85 | - $this->items()->each(function ($item) use (&$menu) { |
|
| 85 | + $this->items()->each(function($item) use (&$menu) { |
|
| 86 | 86 | $menu[] = sprintf('<li><a href="%s">%s</a></li>', $item->url, $item->label); |
| 87 | 87 | }); |
| 88 | 88 | |
| 89 | - return '<ul>' . implode('', $menu) . '</ul>'; |
|
| 89 | + return '<ul>'.implode('', $menu).'</ul>'; |
|
| 90 | 90 | } |
| 91 | 91 | } |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | |
| 58 | 58 | public function getFullnameAttribute() |
| 59 | 59 | { |
| 60 | - return $this->firstname . ' ' . $this->lastname; |
|
| 60 | + return $this->firstname.' '.$this->lastname; |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | public function isSquantoDeveloper() |
@@ -67,6 +67,6 @@ discard block |
||
| 67 | 67 | |
| 68 | 68 | public function getShortNameAttribute() |
| 69 | 69 | { |
| 70 | - return $this->firstname . ' ' . substr($this->lastname, 0, 1) . '.'; |
|
| 70 | + return $this->firstname.' '.substr($this->lastname, 0, 1).'.'; |
|
| 71 | 71 | } |
| 72 | 72 | } |
@@ -36,6 +36,6 @@ |
||
| 36 | 36 | break; |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | - return '<span class="label ' . $flair . '">uitnodiging ' . $this->invitation->stateOf(InvitationState::KEY) . '</span>'; |
|
| 39 | + return '<span class="label '.$flair.'">uitnodiging '.$this->invitation->stateOf(InvitationState::KEY).'</span>'; |
|
| 40 | 40 | } |
| 41 | 41 | } |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | { |
| 28 | 28 | $class = $this->pageState->isOnline() ? 'text-success' : 'text-warning'; |
| 29 | 29 | |
| 30 | - return '<span class="inline-xs stack-s ' . $class . '">' . $this->stateAsLabel() . '</span>'; |
|
| 30 | + return '<span class="inline-xs stack-s '.$class.'">'.$this->stateAsLabel().'</span>'; |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | /** |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | Session::now('note.default', 'U bekijkt een preview.'); |
| 13 | 13 | |
| 14 | 14 | return true; |
| 15 | - } else { |
|
| 15 | + }else { |
|
| 16 | 16 | return false; |
| 17 | 17 | } |
| 18 | 18 | } |
@@ -6,26 +6,26 @@ |
||
| 6 | 6 | { |
| 7 | 7 | public static function invalidState($state, $currentState, $stateMachine) |
| 8 | 8 | { |
| 9 | - return new self('Transition to state [' . $state . '] is not allowed from state [' . $currentState . '] or state does not exist on ' . get_class($stateMachine)); |
|
| 9 | + return new self('Transition to state ['.$state.'] is not allowed from state ['.$currentState.'] or state does not exist on '.get_class($stateMachine)); |
|
| 10 | 10 | } |
| 11 | 11 | |
| 12 | 12 | public static function malformedTransition($transition, $stateMachine) |
| 13 | 13 | { |
| 14 | - return new self('Transition [' . $transition . '] is malformed on ' . get_class($stateMachine) . '. It should contain both a [from:array] and [to:string] value.'); |
|
| 14 | + return new self('Transition ['.$transition.'] is malformed on '.get_class($stateMachine).'. It should contain both a [from:array] and [to:string] value.'); |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | public static function invalidTransitionKey($transition, $stateMachine) |
| 18 | 18 | { |
| 19 | - return new self('unknown transition [' . $transition . '] on ' . get_class($stateMachine)); |
|
| 19 | + return new self('unknown transition ['.$transition.'] on '.get_class($stateMachine)); |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | public static function invalidTransition($transition, $state, $stateMachine) |
| 23 | 23 | { |
| 24 | - return new self('Transition [' . $transition . '] cannot be applied from current state [' . $state . '] on ' . get_class($stateMachine)); |
|
| 24 | + return new self('Transition ['.$transition.'] cannot be applied from current state ['.$state.'] on '.get_class($stateMachine)); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | public static function invalidTransitionState($transition, $state, $stateMachine) |
| 28 | 28 | { |
| 29 | - return new self('Transition [' . $transition . '] contains a non existing [' . $state . '] on ' . get_class($stateMachine)); |
|
| 29 | + return new self('Transition ['.$transition.'] contains a non existing ['.$state.'] on '.get_class($stateMachine)); |
|
| 30 | 30 | } |
| 31 | 31 | } |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | if (is_string($file) && isset(json_decode($file)->output)) { |
| 113 | 113 | $image_name = json_decode($file)->output->name; |
| 114 | 114 | $asset = app(AddAsset::class)->add($model, json_decode($file)->output->image, $type, $locale, $this->sluggifyFilename($image_name)); |
| 115 | - } else { |
|
| 115 | + }else { |
|
| 116 | 116 | if ($file instanceof UploadedFile) { |
| 117 | 117 | $image_name = $file->getClientOriginalName(); |
| 118 | 118 | |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | if (false !== ($key = array_search($image_name, $files_order))) { |
| 124 | 124 | $files_order[$key] = (string)$asset->id; |
| 125 | 125 | } |
| 126 | - } else { |
|
| 126 | + }else { |
|
| 127 | 127 | $file = Asset::find($file); |
| 128 | 128 | if ($file) { |
| 129 | 129 | if ($model->assetRelation()->where('asset_pivots.type', $type)->where('asset_pivots.locale', $locale)->get()->contains($file)) { |
@@ -142,9 +142,9 @@ discard block |
||
| 142 | 142 | */ |
| 143 | 143 | private function sluggifyFilename($filename): string |
| 144 | 144 | { |
| 145 | - $extension = substr($filename, strrpos($filename, '.') + 1); |
|
| 145 | + $extension = substr($filename, strrpos($filename, '.')+1); |
|
| 146 | 146 | $filename = substr($filename, 0, strrpos($filename, '.')); |
| 147 | - $filename = Str::slug($filename) . '.' . $extension; |
|
| 147 | + $filename = Str::slug($filename).'.'.$extension; |
|
| 148 | 148 | |
| 149 | 149 | return $filename; |
| 150 | 150 | } |
@@ -160,9 +160,9 @@ discard block |
||
| 160 | 160 | if ($file instanceof UploadedFile && !$file->isValid()) { |
| 161 | 161 | if ($file->getError() == UPLOAD_ERR_INI_SIZE) { |
| 162 | 162 | throw new FileTooBigException( |
| 163 | - 'Cannot upload file because it exceeded the allowed upload_max_filesize: upload_max_filesize is smaller than post size. ' . |
|
| 164 | - 'upload_max_filesize: ' . (int)ini_get('upload_max_filesize') . 'MB, ' . |
|
| 165 | - 'post_max_size: ' . (int)(ini_get('post_max_size')) . 'MB' |
|
| 163 | + 'Cannot upload file because it exceeded the allowed upload_max_filesize: upload_max_filesize is smaller than post size. '. |
|
| 164 | + 'upload_max_filesize: '.(int)ini_get('upload_max_filesize').'MB, '. |
|
| 165 | + 'post_max_size: '.(int)(ini_get('post_max_size')).'MB' |
|
| 166 | 166 | ); |
| 167 | 167 | } |
| 168 | 168 | } |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | foreach ($files as $locale => $_files) { |
| 178 | 178 | foreach ($_files as $action => $file) { |
| 179 | 179 | if (!in_array($action, $actions)) { |
| 180 | - throw new \InvalidArgumentException('A valid files entry should have a key of either [' . implode(',', $actions) . ']. Instead ' . $action . ' is given.'); |
|
| 180 | + throw new \InvalidArgumentException('A valid files entry should have a key of either ['.implode(',', $actions).']. Instead '.$action.' is given.'); |
|
| 181 | 181 | } |
| 182 | 182 | } |
| 183 | 183 | } |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | { |
| 20 | 20 | $cachableParameters = $this->convertToCachableParameters($parameters); |
| 21 | 21 | |
| 22 | - $cachekey = $this->baseKey . ':' . md5(implode('', $cachableParameters)); |
|
| 22 | + $cachekey = $this->baseKey.':'.md5(implode('', $cachableParameters)); |
|
| 23 | 23 | |
| 24 | 24 | if (isset(static::$cache[$cachekey])) { |
| 25 | 25 | return static::$cache[$cachekey]; |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | { |
| 38 | 38 | foreach ($parameters as $key => $value) { |
| 39 | 39 | if ($value instanceof Model) { |
| 40 | - $parameters[$key] = get_class($value) . '@' . $value->id; |
|
| 40 | + $parameters[$key] = get_class($value).'@'.$value->id; |
|
| 41 | 41 | } |
| 42 | 42 | } |
| 43 | 43 | |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | if (isset($customRules[$rule])) { |
| 52 | - $rules[$k] = $customRules[$rule] . ($params ? ':' . $params : ''); |
|
| 52 | + $rules[$k] = $customRules[$rule].($params ? ':'.$params : ''); |
|
| 53 | 53 | } |
| 54 | 54 | } |
| 55 | 55 | |