diff --git a/app/Http/Controllers/Api/v1/FullTextSearchApiController.php b/app/Http/Controllers/Api/v1/FullTextSearchApiController.php index d5ddfe467b..04f6dce9b6 100644 --- a/app/Http/Controllers/Api/v1/FullTextSearchApiController.php +++ b/app/Http/Controllers/Api/v1/FullTextSearchApiController.php @@ -27,7 +27,6 @@ public function index(Campaign $campaign) /** @var Entity|null $entity */ $entity = Entity::where(['name' => request()->term, 'campaign_id' => $campaign->id])->first(); if ($entity) { - // @phpstan-ignore-next-line $term2 = $entity->type() . ':' . $entity->id; } diff --git a/app/Http/Controllers/Entity/ProfileController.php b/app/Http/Controllers/Entity/ProfileController.php index fdc1db40c6..7f3c1021cb 100644 --- a/app/Http/Controllers/Entity/ProfileController.php +++ b/app/Http/Controllers/Entity/ProfileController.php @@ -17,7 +17,6 @@ public function index(Campaign $campaign, Entity $entity) { $this->authEntityView($entity); - // @phpstan-ignore-next-line if (!view()->exists('entities.pages.profile._' . $entity->type())) { return redirect()->to($entity->url()); } diff --git a/app/Http/Controllers/Entity/TransformController.php b/app/Http/Controllers/Entity/TransformController.php index dd0f342534..f9cef49104 100644 --- a/app/Http/Controllers/Entity/TransformController.php +++ b/app/Http/Controllers/Entity/TransformController.php @@ -34,7 +34,6 @@ public function index(Campaign $campaign, Entity $entity) $entities = $this->typeService ->campaign($campaign) - // @phpstan-ignore-next-line ->exclude([$entity->type(), 'bookmark', 'relation']) ->add(['' => __('entities/transform.fields.select_one')]) ->get(); diff --git a/app/Http/Controllers/Search/FullTextController.php b/app/Http/Controllers/Search/FullTextController.php index 95b755fce9..5cd936e373 100644 --- a/app/Http/Controllers/Search/FullTextController.php +++ b/app/Http/Controllers/Search/FullTextController.php @@ -37,7 +37,6 @@ public function index(Campaign $campaign, Request $request) /** @var Entity|null $entity */ $entity = Entity::where('name', $term)->first(); if ($entity) { - // @phpstan-ignore-next-line $term2 = $entity->type() . ':' . $entity->id; } diff --git a/app/Http/Resources/Entity.php b/app/Http/Resources/Entity.php index a7ff689a6e..d3810ad966 100644 --- a/app/Http/Resources/Entity.php +++ b/app/Http/Resources/Entity.php @@ -33,7 +33,6 @@ public function toArray($request) 'image_thumb' => Avatar::entity($model)->size(40)->thumbnail(), 'has_custom_image' => !empty($model->image_path) && !empty($model->image), - // @phpstan-ignore-next-line 'type' => $model->type(), 'type_id' => $model->type_id, 'tooltip' => $model->tooltip, diff --git a/app/Http/Resources/EntityResource.php b/app/Http/Resources/EntityResource.php index e7280bf489..51702a92c8 100644 --- a/app/Http/Resources/EntityResource.php +++ b/app/Http/Resources/EntityResource.php @@ -54,7 +54,6 @@ public function toArray($request) $data = [ 'id' => $entity->id, 'name' => $entity->name, - // @phpstan-ignore-next-line 'type' => $entity->type(), 'type_id' => $entity->type_id, 'child_id' => $entity->entity_id, @@ -110,7 +109,6 @@ public function toArray($request) // Get the actual model if ($this->withMisc) { - // @phpstan-ignore-next-line $className = 'App\Http\Resources\\' . ucfirst($entity->type()) . 'Resource'; if (class_exists($className)) { $obj = new $className($entity->child); diff --git a/app/Models/Concerns/Orderable.php b/app/Models/Concerns/Orderable.php index ecdb6b7ad2..e06bfea88e 100644 --- a/app/Models/Concerns/Orderable.php +++ b/app/Models/Concerns/Orderable.php @@ -15,10 +15,8 @@ trait Orderable */ public function scopeOrder(Builder $query, array|null $data) { - // Default - // @phpstan-ignore-next-line + // Default values can be defined on the model, or default $field = $this->defaultOrderField ?: 'name'; - // @phpstan-ignore-next-line $direction = $this->defaultOrderDirection ?: 'asc'; if (!empty($data) && auth()->check()) { diff --git a/app/Models/Entity.php b/app/Models/Entity.php index 44a7ba636f..1a40860851 100644 --- a/app/Models/Entity.php +++ b/app/Models/Entity.php @@ -128,7 +128,6 @@ public function child() } elseif ($this->isDiceRoll()) { return $this->diceRoll(); } - // @phpstan-ignore-next-line return $this->{$this->type()}(); } @@ -151,7 +150,6 @@ public function reloadChild() } elseif ($this->isDiceRoll()) { return $this->load('diceRoll'); } - // @phpstan-ignore-next-line return $this->load($this->type()); } @@ -224,7 +222,6 @@ public function pluralType(): string if ($this->cachedPluralName !== false) { return $this->cachedPluralName; } - // @phpstan-ignore-next-line return $this->cachedPluralName = Str::plural($this->type()); } @@ -238,7 +235,6 @@ public function typeId() public function entityType(): string { - // @phpstan-ignore-next-line return __('entities.' . $this->type()); } diff --git a/app/Models/PluginVersion.php b/app/Models/PluginVersion.php index 0739af9235..9df5b101a5 100644 --- a/app/Models/PluginVersion.php +++ b/app/Models/PluginVersion.php @@ -427,7 +427,6 @@ protected function prepareBladeData(Entity $entity): array $data['_locale'] = app()->getLocale(); $data['_entity_name'] = $entity->name; $data['_entity_type'] = $entity->child->type; - // @phpstan-ignore-next-line $data['_entity_type_name'] = $entity->type(); if ($entity->isCharacter()) { diff --git a/app/Renderers/DatagridRenderer.php b/app/Renderers/DatagridRenderer.php index a3204c5c7c..db5636d92c 100644 --- a/app/Renderers/DatagridRenderer.php +++ b/app/Renderers/DatagridRenderer.php @@ -319,7 +319,6 @@ private function renderRow(Model $model): string $html = '<tr data-id="' . $model->id . '" ' . (!empty($model->type) ? 'data-type="' . Str::slug($model->type) . '" ' : null) - // @phpstan-ignore-next-line . ($useEntity ? 'data-entity-id="' . $model->entity->id . '" data-entity-type="' . $model->entity->type() . '"' : null); /*if (!empty($this->options['row']) && !empty($this->options['row']['data'])) { foreach ($this->options['row']['data'] as $name => $data) { diff --git a/app/Services/Entity/Connections/MapService.php b/app/Services/Entity/Connections/MapService.php index 3f70016965..2c42727065 100644 --- a/app/Services/Entity/Connections/MapService.php +++ b/app/Services/Entity/Connections/MapService.php @@ -99,7 +99,6 @@ protected function withEntity(bool $with = true): self */ public function map(): array { - // @phpstan-ignore-next-line $entityHook = 'init' . ucfirst($this->entity->type()); if (method_exists($this, $entityHook)) { $this->$entityHook(); @@ -672,7 +671,6 @@ protected function addParent(): self { if (!method_exists($this->entity->child, 'getParentKeyName')) { // If not part of the node model, check for the {self}_id attribute - // @phpstan-ignore-next-line if (!array_key_exists($this->entity->type() . '_id', $this->entity->child->getAttributes())) { return $this; } diff --git a/app/Services/Entity/ExportService.php b/app/Services/Entity/ExportService.php index 3b14aa0f76..54dd3ef451 100644 --- a/app/Services/Entity/ExportService.php +++ b/app/Services/Entity/ExportService.php @@ -24,7 +24,6 @@ public function entity(Entity $entity): self */ public function json() { - // @phpstan-ignore-next-line $child = Str::studly($this->entity->type()); $className = 'App\Http\Resources\\' . $child . 'Resource'; diff --git a/app/Services/Images/AvatarService.php b/app/Services/Images/AvatarService.php index db274de76b..bb18f8a3bd 100644 --- a/app/Services/Images/AvatarService.php +++ b/app/Services/Images/AvatarService.php @@ -134,10 +134,8 @@ protected function fallbackThumbnail(): string } $cloudfront = config('filesystems.disks.cloudfront.url'); - // @phpstan-ignore-next-line if ($this->campaign->boosted() && Arr::has(CampaignCache::defaultImages(), $this->entity->type())) { $url = Img::crop($this->width, $this->height) - // @phpstan-ignore-next-line ->url(CampaignCache::defaultImages()[$this->entity->type()]); return $this->return($url); } elseif (auth()->check() && auth()->user()->isGoblin()) { diff --git a/app/Services/MentionsService.php b/app/Services/MentionsService.php index d83742cfe0..151e8a0335 100644 --- a/app/Services/MentionsService.php +++ b/app/Services/MentionsService.php @@ -430,7 +430,6 @@ protected function replaceEntityMentions(): void $replace = '<a href="' . $url . '"' . ' class="' . implode(' ', $cssClasses) . '"' . ' data-entity-tags="' . implode(' ', $tagClasses) . '"' - // @phpstan-ignore-next-line . ' data-entity-type="' . $entity->type() . '"' . ' data-toggle="tooltip-ajax"' . ' data-id="' . $entity->id . '"' diff --git a/app/Services/Search/RecentService.php b/app/Services/Search/RecentService.php index b7cb9413fc..19d727522b 100644 --- a/app/Services/Search/RecentService.php +++ b/app/Services/Search/RecentService.php @@ -61,7 +61,6 @@ protected function formatForLookup(Entity $entity): array 'is_private' => $entity->is_private, 'image' => Avatar::entity($entity)->fallback()->size(64)->thumbnail(), 'link' => $entity->url(), - // @phpstan-ignore-next-line 'type' => Module::singular($entity->typeId(), __('entities.' . $entity->type())), 'preview' => route('entities.preview', [$this->campaign, $entity]), ]; diff --git a/app/Services/SearchService.php b/app/Services/SearchService.php index 7f814b5009..c2bade4d20 100644 --- a/app/Services/SearchService.php +++ b/app/Services/SearchService.php @@ -280,7 +280,7 @@ public function find() 'image' => $img, 'name' => $parsedName, 'type' => Module::singular($model->type_id, $model->entityType()), - 'model_type' => $model->type(), // @phpstan-ignore-line + 'model_type' => $model->type(), 'url' => $model->url(), 'alias_id' => $model->alias_id, // @phpstan-ignore-line 'advanced_mention' => Mentions::advancedMentionHelper($model->name), @@ -297,7 +297,6 @@ public function find() 'image' => $img, 'name' => $parsedName, 'type' => __('maps.actions.explore'), - // @phpstan-ignore-next-line 'model_type' => $model->type(), 'url' => $model->url('explore'), 'alias_id' => $model->alias_id, // @phpstan-ignore-line @@ -395,7 +394,6 @@ protected function formatForLookup(Entity $entity): array 'is_private' => $entity->is_private, 'image' => Avatar::entity($entity)->fallback()->size(64)->thumbnail(), 'link' => $entity->url(), - // @phpstan-ignore-next-line 'type' => Module::singular($entity->typeId(), __('entities.' . $entity->type())), 'preview' => route('entities.preview', [$this->campaign, $entity]), ];