@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | */ |
| 40 | 40 | public static function onlineModels(bool $onlySingles = false, Model $ignoredModel = null): Collection |
| 41 | 41 | { |
| 42 | - $models = chiefMemoize('all-online-models', function () use ($onlySingles) { |
|
| 42 | + $models = chiefMemoize('all-online-models', function() use ($onlySingles) { |
|
| 43 | 43 | $builder = UrlRecord::whereNull('redirect_id') |
| 44 | 44 | ->select('model_type', 'model_id') |
| 45 | 45 | ->groupBy('model_type', 'model_id'); |
@@ -48,17 +48,17 @@ discard block |
||
| 48 | 48 | $builder->where('model_type', 'singles'); |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | - return $builder->get()->mapToGroups(function ($record) { |
|
| 51 | + return $builder->get()->mapToGroups(function($record) { |
|
| 52 | 52 | return [$record->model_type => $record->model_id]; |
| 53 | - })->map(function ($record, $key) { |
|
| 53 | + })->map(function($record, $key) { |
|
| 54 | 54 | return Morphables::instance($key)->find($record->toArray()); |
| 55 | - })->map->reject(function ($model) { |
|
| 55 | + })->map->reject(function($model) { |
|
| 56 | 56 | return is_null($model) || !$model->isPublished(); // Invalid references to archived or removed models where url record still exists. |
| 57 | 57 | })->flatten(); |
| 58 | 58 | }, [$onlySingles]); |
| 59 | 59 | |
| 60 | 60 | if ($ignoredModel) { |
| 61 | - $models = $models->reject(function ($model) use ($ignoredModel) { |
|
| 61 | + $models = $models->reject(function($model) use ($ignoredModel) { |
|
| 62 | 62 | return (get_class($model) === get_class($ignoredModel) && $model->id === $ignoredModel->id); |
| 63 | 63 | }); |
| 64 | 64 | } |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | return static::$managedModelKey; |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | - throw new \Exception('Missing required static property \'managedModelKey\' on ' . static::class. '.'); |
|
| 89 | + throw new \Exception('Missing required static property \'managedModelKey\' on '.static::class.'.'); |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | /** |
@@ -126,9 +126,9 @@ discard block |
||
| 126 | 126 | public function flatReferenceLabel(): string |
| 127 | 127 | { |
| 128 | 128 | if ($this->exists) { |
| 129 | - $status = ! $this->isPublished() ? ' [' . $this->statusAsPlainLabel().']' : null; |
|
| 129 | + $status = !$this->isPublished() ? ' ['.$this->statusAsPlainLabel().']' : null; |
|
| 130 | 130 | |
| 131 | - return $this->title ? $this->title . $status : ''; |
|
| 131 | + return $this->title ? $this->title.$status : ''; |
|
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | return ''; |
@@ -138,8 +138,8 @@ discard block |
||
| 138 | 138 | { |
| 139 | 139 | $classKey = get_class($this); |
| 140 | 140 | if (property_exists($this, 'labelSingular')) { |
| 141 | - $labelSingular = $this->labelSingular; |
|
| 142 | - } else { |
|
| 141 | + $labelSingular = $this->labelSingular; |
|
| 142 | + }else { |
|
| 143 | 143 | $labelSingular = Str::singular($classKey); |
| 144 | 144 | } |
| 145 | 145 | |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | |
| 183 | 183 | $memoizedKey = $this->getMorphClass().'-'.$this->id.'-'.$locale; |
| 184 | 184 | |
| 185 | - if(isset(static::$cachedUrls[$memoizedKey])) { |
|
| 185 | + if (isset(static::$cachedUrls[$memoizedKey])) { |
|
| 186 | 186 | return static::$cachedUrls[$memoizedKey]; |
| 187 | 187 | } |
| 188 | 188 | |