From 62ac020ad7f015c73dd16f3e2ec1e2469652474e Mon Sep 17 00:00:00 2001 From: markhuot Date: Mon, 30 Sep 2024 12:54:27 -0400 Subject: [PATCH] pint --- src/console/TestableResponse.php | 3 +-- src/events/RollbackTransactionEvent.php | 4 +--- src/exceptions/AutoCommittingFieldsException.php | 4 +--- src/factories/Asset.php | 2 +- src/factories/BlockType.php | 2 +- src/factories/Category.php | 2 +- src/factories/Entry.php | 2 +- src/factories/EntryType.php | 2 +- src/factories/Fieldable.php | 2 +- src/factories/Section.php | 4 ++-- src/helpers/Craft.php | 2 +- src/http/requests/GetRequest.php | 4 +--- src/http/requests/PostRequest.php | 4 +--- src/web/BenchmarkResult.php | 3 +-- 14 files changed, 15 insertions(+), 25 deletions(-) diff --git a/src/console/TestableResponse.php b/src/console/TestableResponse.php index 4861fef..0b9314e 100644 --- a/src/console/TestableResponse.php +++ b/src/console/TestableResponse.php @@ -10,8 +10,7 @@ public function __construct( protected int $exitCode, protected string $stdout, protected string $stderr, - ) { - } + ) {} public function assertSuccesful() { diff --git a/src/events/RollbackTransactionEvent.php b/src/events/RollbackTransactionEvent.php index add3448..18d2d7b 100644 --- a/src/events/RollbackTransactionEvent.php +++ b/src/events/RollbackTransactionEvent.php @@ -4,6 +4,4 @@ use yii\base\Event; -class RollbackTransactionEvent extends Event -{ -} +class RollbackTransactionEvent extends Event {} diff --git a/src/exceptions/AutoCommittingFieldsException.php b/src/exceptions/AutoCommittingFieldsException.php index 2d9158d..ff89255 100644 --- a/src/exceptions/AutoCommittingFieldsException.php +++ b/src/exceptions/AutoCommittingFieldsException.php @@ -2,6 +2,4 @@ namespace markhuot\craftpest\exceptions; -class AutoCommittingFieldsException extends \Exception -{ -} +class AutoCommittingFieldsException extends \Exception {} diff --git a/src/factories/Asset.php b/src/factories/Asset.php index 9190709..d7eff35 100644 --- a/src/factories/Asset.php +++ b/src/factories/Asset.php @@ -78,7 +78,7 @@ public function source(string $source) public function newElement() { - return new \craft\elements\Asset(); + return new \craft\elements\Asset; } public function definition(int $index = 0) diff --git a/src/factories/BlockType.php b/src/factories/BlockType.php index aaa1354..824f6d7 100644 --- a/src/factories/BlockType.php +++ b/src/factories/BlockType.php @@ -33,7 +33,7 @@ public function inferences(array $definition = []) public function newElement() { - return new MatrixBlockType(); + return new MatrixBlockType; } public function store($blockType) diff --git a/src/factories/Category.php b/src/factories/Category.php index c041b08..204dca2 100644 --- a/src/factories/Category.php +++ b/src/factories/Category.php @@ -22,7 +22,7 @@ public function group($handle) public function newElement() { - return new \craft\elements\Category(); + return new \craft\elements\Category; } public function definition(int $index = 0) diff --git a/src/factories/Entry.php b/src/factories/Entry.php index 8fdd473..444dcb3 100644 --- a/src/factories/Entry.php +++ b/src/factories/Entry.php @@ -187,7 +187,7 @@ public function inferTypeId(?int $sectionid): ?int */ public function newElement() { - return new \craft\elements\Entry(); + return new \craft\elements\Entry; } /** diff --git a/src/factories/EntryType.php b/src/factories/EntryType.php index a8431ba..68caf14 100644 --- a/src/factories/EntryType.php +++ b/src/factories/EntryType.php @@ -35,7 +35,7 @@ public function inferences(array $definition = []) public function newElement() { - return new EntryTypeModel(); + return new EntryTypeModel; } public function store($entryType) diff --git a/src/factories/Fieldable.php b/src/factories/Fieldable.php index 41461b4..fa21954 100644 --- a/src/factories/Fieldable.php +++ b/src/factories/Fieldable.php @@ -55,7 +55,7 @@ public function storeFields(FieldLayout $fieldLayout, $context = null) ->toArray(); if (empty($fieldLayout->getTabs()[0])) { - $fieldLayoutTab = new FieldLayoutTab(); + $fieldLayoutTab = new FieldLayoutTab; $fieldLayoutTab->name = 'Content'; $fieldLayoutTab->sortOrder = 1; $fieldLayout->setTabs([$fieldLayoutTab]); diff --git a/src/factories/Section.php b/src/factories/Section.php index 530d414..6d75cdf 100644 --- a/src/factories/Section.php +++ b/src/factories/Section.php @@ -66,7 +66,7 @@ public function template(string $template) */ public function newElement() { - return new \craft\models\Section(); + return new \craft\models\Section; } /** @@ -94,7 +94,7 @@ public function inferences(array $definition = []) $handle = $definition['handle']; $definition['siteSettings'] = collect(Craft::$app->sites->getAllSites()) ->mapWithkeys(function ($site) use ($name, $handle) { - $settings = new Section_SiteSettings(); + $settings = new Section_SiteSettings; $settings->siteId = $site->id; $settings->hasUrls = $this->hasUrls; $settings->uriFormat = $this->uriFormat; diff --git a/src/helpers/Craft.php b/src/helpers/Craft.php index 6484fed..96d5b8e 100644 --- a/src/helpers/Craft.php +++ b/src/helpers/Craft.php @@ -80,7 +80,7 @@ function createVolume() function volumeDefinition(array $definition = []) { if (version_greater_than_or_equal_to(\Craft::$app->version, '4')) { - $fileSystem = new \craft\fs\Local(); // @phpstan-ignore-line + $fileSystem = new \craft\fs\Local; // @phpstan-ignore-line $fileSystem->name = $definition['name'].' FS'; // @phpstan-ignore-line $fileSystem->handle = $definition['handle'].'Fs'; // @phpstan-ignore-line $fileSystem->path = \Craft::getAlias('@storage').'/volumes/'.$definition['handle'].'/'; // @phpstan-ignore-line diff --git a/src/http/requests/GetRequest.php b/src/http/requests/GetRequest.php index 1675c23..e85b0b2 100644 --- a/src/http/requests/GetRequest.php +++ b/src/http/requests/GetRequest.php @@ -2,6 +2,4 @@ namespace markhuot\craftpest\http\requests; -class GetRequest extends WebRequest -{ -} +class GetRequest extends WebRequest {} diff --git a/src/http/requests/PostRequest.php b/src/http/requests/PostRequest.php index 59502fa..8f70355 100644 --- a/src/http/requests/PostRequest.php +++ b/src/http/requests/PostRequest.php @@ -2,6 +2,4 @@ namespace markhuot\craftpest\http\requests; -class PostRequest extends WebRequest -{ -} +class PostRequest extends WebRequest {} diff --git a/src/web/BenchmarkResult.php b/src/web/BenchmarkResult.php index 6f7fa20..33056d6 100644 --- a/src/web/BenchmarkResult.php +++ b/src/web/BenchmarkResult.php @@ -29,8 +29,7 @@ class BenchmarkResult public function __construct( public int $startProfileAt, public int $endProfileAt, - ) { - } + ) {} // function summary() // {