diff --git a/app/Http/Controllers/CrudController.php b/app/Http/Controllers/CrudController.php index 5dbef81eae..d018dce213 100644 --- a/app/Http/Controllers/CrudController.php +++ b/app/Http/Controllers/CrudController.php @@ -160,7 +160,7 @@ public function crudIndex(Request $request) // Don't use total as it won't use the distinct() filters (typically when doing // left join on the entities table) $filteredCount = $models->total(); - //$filteredCount = count($models); //->total() + //$filteredCount = count($models); //->total() } else { /** @var Paginator $models */ $models = $base->paginate(); diff --git a/app/Models/Attribute.php b/app/Models/Attribute.php index 1a722c6649..91d164b36b 100644 --- a/app/Models/Attribute.php +++ b/app/Models/Attribute.php @@ -353,7 +353,7 @@ protected function calculateListConstraints(): self */ public function listRange(): array { - if (! is_array($this->listRange)) { + if (!is_array($this->listRange)) { return []; } return $this->listRange; diff --git a/app/Models/Character.php b/app/Models/Character.php index 6b8af7438b..222d61904a 100644 --- a/app/Models/Character.php +++ b/app/Models/Character.php @@ -45,9 +45,9 @@ class Character extends MiscModel use CampaignTrait; use ExportableTrait; use HasFactory; + use Searchable; use SoftDeletes; use SortableTrait; - use Searchable; /** @var string[] */ protected $fillable = [ diff --git a/app/Models/Concerns/Nested.php b/app/Models/Concerns/Nested.php index d9de27cd0b..7f88ad080e 100644 --- a/app/Models/Concerns/Nested.php +++ b/app/Models/Concerns/Nested.php @@ -112,11 +112,11 @@ protected function callPendingAction() { $this->moved = false; - if (! $this->pending && ! $this->exists) { + if (!$this->pending && !$this->exists) { $this->makeRoot(); } - if (! $this->pending) { + if (!$this->pending) { return; } @@ -189,7 +189,7 @@ protected function actionRaw() protected function actionRoot() { // Simplest case that do not affect other nodes. - if (! $this->exists) { + if (!$this->exists) { $cut = $this->getLowerBound() + 1; $this->setLft($cut); @@ -228,7 +228,7 @@ protected function actionAppendOrPrepend(self $parent, $prepend = false) $cut = $prepend ? $parent->getLft() + 1 : $parent->getRgt(); - if (! $this->insertAt($cut)) { + if (!$this->insertAt($cut)) { return false; } @@ -271,7 +271,7 @@ protected function actionBeforeOrAfter(self $node, $after = false) */ public function refreshNode() { - if (! $this->exists || static::$actionsPerformed === 0) { + if (!$this->exists || static::$actionsPerformed === 0) { return; } @@ -523,7 +523,7 @@ public function beforeOrAfterNode(self $node, $after = false) ->assertNotDescendant($node) ->assertSameScope($node); - if (! $this->isSiblingOf($node)) { + if (!$this->isSiblingOf($node)) { $this->setParent($node->getRelationValue('parent')); } @@ -551,7 +551,7 @@ public function insertAfterNode(self $node) */ public function insertBeforeNode(self $node) { - if (! $this->beforeNode($node)->save()) { + if (!$this->beforeNode($node)->save()) { return false; } @@ -587,7 +587,7 @@ public function up($amount = 1) ->skip($amount - 1) ->first(); - if (! $sibling) { + if (!$sibling) { return false; } @@ -609,7 +609,7 @@ public function down($amount = 1) ->skip($amount - 1) ->first(); - if (! $sibling) { + if (!$sibling) { return false; } @@ -752,12 +752,12 @@ public function newScopedQuery(string $table = null) public function applyNestedSetScope($query, $table = null) { // @phpstan-ignore-next-line - if (! $scoped = $this->getScopeAttributes()) { + if (!$scoped = $this->getScopeAttributes()) { return $query; } // @phpstan-ignore-next-line - if (! $table) { + if (!$table) { $table = $this->getTable(); } @@ -839,7 +839,7 @@ public static function create(array $attributes = [], self $parent = null) */ public function getNodeHeight() { - if (! $this->exists) { + if (!$this->exists) { return 2; } @@ -1138,7 +1138,7 @@ protected function getArrayableRelations() */ protected function hardDeleting() { - return ! $this->usesSoftDelete() || $this->forceDeleting; + return !$this->usesSoftDelete() || $this->forceDeleting; } /** @@ -1217,7 +1217,7 @@ protected function assertNotDescendant(self $node) */ protected function assertNodeExists(self $node) { - if (! $node->getLft() || ! $node->getRgt()) { + if (!$node->getLft() || !$node->getRgt()) { $field = $node->getParentIdName(); $error = \Illuminate\Validation\ValidationException::withMessages([ $field => [__('crud.errors.invalid_node')] diff --git a/app/Models/Map.php b/app/Models/Map.php index 32d04c2d52..fb05d62dc2 100644 --- a/app/Models/Map.php +++ b/app/Models/Map.php @@ -622,7 +622,7 @@ public function explorable(): bool if (empty($this->entity->image_path) && !$this->isReal()) { return false; } - return ! ($this->isChunked() && ($this->chunkingError() || $this->chunkingRunning())); + return !($this->isChunked() && ($this->chunkingError() || $this->chunkingRunning())); } /** diff --git a/app/Models/PluginVersion.php b/app/Models/PluginVersion.php index eee0967a75..a97428f94f 100644 --- a/app/Models/PluginVersion.php +++ b/app/Models/PluginVersion.php @@ -367,7 +367,7 @@ protected function emptyBlock(array $matches) if (Str::contains($condition, '')) { return false; } - return ! (empty($condition)); + return !(empty($condition)); } /** diff --git a/app/Models/Scopes/AclScope.php b/app/Models/Scopes/AclScope.php index 994508178e..334fbf72cf 100644 --- a/app/Models/Scopes/AclScope.php +++ b/app/Models/Scopes/AclScope.php @@ -45,7 +45,7 @@ public function extend(Builder $builder) protected function addWithInvisible(Builder $builder) { $builder->macro('withInvisible', function (Builder $builder, $withInvisible = true) { - if (! $withInvisible) { + if (!$withInvisible) { // Sends the default scope return $builder; } diff --git a/app/Observers/CampaignObserver.php b/app/Observers/CampaignObserver.php index f050b1826e..f8cf990fc6 100644 --- a/app/Observers/CampaignObserver.php +++ b/app/Observers/CampaignObserver.php @@ -55,7 +55,7 @@ public function saving(Campaign $campaign) $isPublic = request()->get('is_public', null); if (!empty($isPublic) && $previousVisibility == Campaign::VISIBILITY_PRIVATE) { $campaign->visibility_id = Campaign::VISIBILITY_PUBLIC; - // Default to public for now. Later will have REVIEW mode. + // Default to public for now. Later will have REVIEW mode. } elseif (empty($isPublic) && $previousVisibility != Campaign::VISIBILITY_PRIVATE) { $campaign->visibility_id = Campaign::VISIBILITY_PRIVATE; } diff --git a/app/Renderers/DatagridRenderer.php b/app/Renderers/DatagridRenderer.php index 642bb347a0..793adc9fcd 100644 --- a/app/Renderers/DatagridRenderer.php +++ b/app/Renderers/DatagridRenderer.php @@ -153,7 +153,7 @@ private function renderHeadColumn($column) $class = $column['type']; if ($type == 'avatar') { $class = (!empty($column['parent']) ? $this->hidden : $class) . ' w-14'; - //$html = null; + //$html = null; } elseif ($type == 'location') { $class .= ' ' . $this->hidden; $label = Arr::get($column, 'label', Module::singular(config('entities.ids.location'), __('entities.location'))); diff --git a/app/Renderers/DatagridRenderer2.php b/app/Renderers/DatagridRenderer2.php index 9346281146..966e79d1d2 100644 --- a/app/Renderers/DatagridRenderer2.php +++ b/app/Renderers/DatagridRenderer2.php @@ -168,7 +168,7 @@ public function bulks(): array } continue; } - // More specific use cases? + // More specific use cases? } elseif ($bulk === Layout::ACTION_DELETE) { if (auth()->check() && auth()->user()->isAdmin()) { $this->bulks[] = $bulk; diff --git a/app/Rules/EntityFileRule.php b/app/Rules/EntityFileRule.php index fd55105f65..c50cc33b46 100644 --- a/app/Rules/EntityFileRule.php +++ b/app/Rules/EntityFileRule.php @@ -25,7 +25,7 @@ public function __construct() public function passes($attribute, $value) { // Not a valid file, don't go further - if ($value instanceof UploadedFile && ! $value->isValid()) { + if ($value instanceof UploadedFile && !$value->isValid()) { return false; } @@ -48,7 +48,7 @@ public function passes($attribute, $value) return false; } - return ! (!in_array($value->getClientOriginalExtension(), ['mp3', 'ogg', 'json'])) + return !(!in_array($value->getClientOriginalExtension(), ['mp3', 'ogg', 'json'])) diff --git a/app/Services/AttributeMentionService.php b/app/Services/AttributeMentionService.php index 85d1548bb7..05bd94b3b6 100644 --- a/app/Services/AttributeMentionService.php +++ b/app/Services/AttributeMentionService.php @@ -76,7 +76,7 @@ protected function validField(string $value = null): bool if (!Str::contains($value, ['{', '}'])) { return false; } - return ! (Str::contains($value, ['<', '>'])); + return !(Str::contains($value, ['<', '>'])); } /** * Load all the entity attributes and pre-calculate the values diff --git a/app/Services/Users/PurgeService.php b/app/Services/Users/PurgeService.php index bdb657c3a2..1ed0d4d41f 100644 --- a/app/Services/Users/PurgeService.php +++ b/app/Services/Users/PurgeService.php @@ -188,7 +188,7 @@ public function firstWarning(): int FirstWarningJob::dispatch($user->id); } - $this->count ++; + $this->count++; } }, 'users.id', 'id'); return $this->count; @@ -245,7 +245,7 @@ public function secondWarning(): int SecondWarningJob::dispatch($user->id); } - $this->count ++; + $this->count++; } }, 'users.id', 'id'); return $this->count; @@ -292,7 +292,7 @@ public function purge(): int DeleteUser::dispatch($user); } - $this->count ++; + $this->count++; } }); return $this->count; diff --git a/database/migrations/2023_11_07_034812_rollback_entities_deleted_index.php b/database/migrations/2023_11_07_034812_rollback_entities_deleted_index.php index 262854fdde..cfada89bf7 100644 --- a/database/migrations/2023_11_07_034812_rollback_entities_deleted_index.php +++ b/database/migrations/2023_11_07_034812_rollback_entities_deleted_index.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. */ @@ -22,7 +21,7 @@ public function up(): void public function down(): void { Schema::table('entities', function (Blueprint $table) { - // + }); } };