From a60545fc59c55f41847d2fe2d10e95fecc397b1a Mon Sep 17 00:00:00 2001 From: Mohammad Alavi Date: Mon, 5 Feb 2024 20:31:57 +0330 Subject: [PATCH] style: apply php cs fixer --- src/Abstracts/Exceptions/Exception.php | 10 +++++----- src/Abstracts/Repositories/Repository.php | 2 +- src/Abstracts/Requests/Request.php | 4 ++-- src/Foundation/Apiato.php | 2 +- src/Generator/Commands/ActionGenerator.php | 2 +- src/Generator/Commands/ConfigurationGenerator.php | 2 +- src/Generator/Commands/ContainerApiGenerator.php | 2 +- src/Generator/Commands/ContainerGenerator.php | 2 +- src/Generator/Commands/ContainerWebGenerator.php | 2 +- src/Generator/Commands/ControllerGenerator.php | 2 +- src/Generator/Commands/EventGenerator.php | 2 +- src/Generator/Commands/EventListenerGenerator.php | 2 +- src/Generator/Commands/ExceptionGenerator.php | 2 +- src/Generator/Commands/JobGenerator.php | 2 +- src/Generator/Commands/MailGenerator.php | 2 +- src/Generator/Commands/MiddlewareGenerator.php | 2 +- src/Generator/Commands/MigrationGenerator.php | 2 +- src/Generator/Commands/ModelFactoryGenerator.php | 2 +- src/Generator/Commands/ModelGenerator.php | 2 +- src/Generator/Commands/NotificationGenerator.php | 2 +- src/Generator/Commands/PolicyGenerator.php | 2 +- src/Generator/Commands/ReadmeGenerator.php | 2 +- src/Generator/Commands/RepositoryGenerator.php | 2 +- src/Generator/Commands/RequestGenerator.php | 2 +- src/Generator/Commands/RouteGenerator.php | 2 +- src/Generator/Commands/SeederGenerator.php | 2 +- src/Generator/Commands/ServiceProviderGenerator.php | 2 +- src/Generator/Commands/SubActionGenerator.php | 2 +- src/Generator/Commands/TaskGenerator.php | 2 +- src/Generator/Commands/TestFunctionalTestGenerator.php | 2 +- src/Generator/Commands/TestTestCaseGenerator.php | 2 +- src/Generator/Commands/TestUnitTestGenerator.php | 2 +- src/Generator/Commands/TransformerGenerator.php | 2 +- src/Generator/Commands/ValueGenerator.php | 2 +- src/Generator/GeneratorCommand.php | 2 +- src/Generator/Interfaces/ComponentsGenerator.php | 2 +- src/Helpers/helpers.php | 2 -- src/Loaders/LocalizationLoaderTrait.php | 2 +- src/Loaders/RoutesLoaderTrait.php | 2 +- src/Loaders/ViewsLoaderTrait.php | 2 +- src/Traits/FactoryLocatorTrait.php | 2 +- src/Traits/HasRequestCriteriaTrait.php | 2 +- src/Traits/ResponseTrait.php | 2 +- .../TestTraits/PhpUnit/TestAssertionHelperTrait.php | 1 - 44 files changed, 47 insertions(+), 50 deletions(-) diff --git a/src/Abstracts/Exceptions/Exception.php b/src/Abstracts/Exceptions/Exception.php index 30c0f7b0..6e04c271 100644 --- a/src/Abstracts/Exceptions/Exception.php +++ b/src/Abstracts/Exceptions/Exception.php @@ -12,9 +12,9 @@ abstract class Exception extends BaseException protected array $errors = []; public function __construct( - null|string $message = null, - null|int $code = null, - null|\Throwable $previous = null, + string|null $message = null, + int|null $code = null, + \Throwable|null $previous = null, ) { // Detect and set the running environment $this->environment = Config::get('app.env'); @@ -22,12 +22,12 @@ public function __construct( parent::__construct($this->prepareMessage($message), $this->prepareStatusCode($code), $previous); } - private function prepareMessage(null|string $message = null): string + private function prepareMessage(string|null $message = null): string { return is_null($message) ? $this->message : $message; } - private function prepareStatusCode(null|int $code = null): int + private function prepareStatusCode(int|null $code = null): int { return is_null($code) ? $this->code : $code; } diff --git a/src/Abstracts/Repositories/Repository.php b/src/Abstracts/Repositories/Repository.php index 8820e1a7..748d2088 100644 --- a/src/Abstracts/Repositories/Repository.php +++ b/src/Abstracts/Repositories/Repository.php @@ -22,7 +22,7 @@ abstract class Repository extends PrettusRepository implements PrettusCacheable */ protected int $maxPaginationLimit = 0; - protected null|bool $allowDisablePagination = null; + protected bool|null $allowDisablePagination = null; /** * This function relies on strict conventions: diff --git a/src/Abstracts/Requests/Request.php b/src/Abstracts/Requests/Request.php index b0e38706..19679caa 100644 --- a/src/Abstracts/Requests/Request.php +++ b/src/Abstracts/Requests/Request.php @@ -55,7 +55,7 @@ abstract class Request extends LaravelRequest /** * To be used mainly from unit tests. */ - public static function injectData(array $parameters = [], null|User $user = null, array $cookies = [], array $files = [], array $server = []): static + public static function injectData(array $parameters = [], User|null $user = null, array $cookies = [], array $files = [], array $server = []): static { // if user is passed, will be returned when asking for the authenticated user using `\Auth::user()` if ($user) { @@ -111,7 +111,7 @@ public function getUrlParametersArray(): array * User can set multiple permissions (separated with "|") and if the user has * any of the permissions, he will be authorized to proceed with this action. */ - public function hasAccess(null|User $user = null): bool + public function hasAccess(User|null $user = null): bool { // if not in parameters, take from the request object {$this} $user = $user ?: $this->user(); diff --git a/src/Foundation/Apiato.php b/src/Foundation/Apiato.php index 5d760ce0..e414a1bd 100644 --- a/src/Foundation/Apiato.php +++ b/src/Foundation/Apiato.php @@ -67,7 +67,7 @@ public function getClassFullNameFromFile(string $filePathName): string /** * Get the class namespace form file path using token. */ - protected function getClassNamespaceFromFile(string $filePathName): null|string + protected function getClassNamespaceFromFile(string $filePathName): string|null { $src = file_get_contents($filePathName); diff --git a/src/Generator/Commands/ActionGenerator.php b/src/Generator/Commands/ActionGenerator.php index 4281540c..d917af08 100644 --- a/src/Generator/Commands/ActionGenerator.php +++ b/src/Generator/Commands/ActionGenerator.php @@ -48,7 +48,7 @@ class ActionGenerator extends GeneratorCommand implements ComponentsGenerator */ protected string $stubName = 'actions/generic.stub'; - public function getUserInputs(): null|array + public function getUserInputs(): array|null { $model = $this->checkParameterOrAsk('model', 'Enter the name of the model this action is for.', $this->containerName); $ui = Str::upper($this->checkParameterOrChoice('ui', 'Which UI is this Action for?', ['API', 'WEB'], 0)); diff --git a/src/Generator/Commands/ConfigurationGenerator.php b/src/Generator/Commands/ConfigurationGenerator.php index db735551..20ff4fe5 100644 --- a/src/Generator/Commands/ConfigurationGenerator.php +++ b/src/Generator/Commands/ConfigurationGenerator.php @@ -43,7 +43,7 @@ class ConfigurationGenerator extends GeneratorCommand implements ComponentsGener */ protected string $stubName = 'config.stub'; - public function getUserInputs(): null|array + public function getUserInputs(): array|null { return [ 'path-parameters' => [ diff --git a/src/Generator/Commands/ContainerApiGenerator.php b/src/Generator/Commands/ContainerApiGenerator.php index a6e9da2e..9f6dbaa7 100644 --- a/src/Generator/Commands/ContainerApiGenerator.php +++ b/src/Generator/Commands/ContainerApiGenerator.php @@ -53,7 +53,7 @@ class ContainerApiGenerator extends GeneratorCommand implements ComponentsGenera */ protected string $stubName = 'composer.stub'; - public function getUserInputs(): null|array + public function getUserInputs(): array|null { $ui = 'api'; diff --git a/src/Generator/Commands/ContainerGenerator.php b/src/Generator/Commands/ContainerGenerator.php index 2531ad02..d588d6be 100644 --- a/src/Generator/Commands/ContainerGenerator.php +++ b/src/Generator/Commands/ContainerGenerator.php @@ -45,7 +45,7 @@ class ContainerGenerator extends GeneratorCommand implements ComponentsGenerator */ protected string $stubName = 'composer.stub'; - public function getUserInputs(): null|array + public function getUserInputs(): array|null { $ui = Str::lower($this->checkParameterOrChoice('ui', 'Select the UI for this container', ['API', 'WEB', 'BOTH'], 0)); diff --git a/src/Generator/Commands/ContainerWebGenerator.php b/src/Generator/Commands/ContainerWebGenerator.php index 279c2d1e..86d27d7e 100644 --- a/src/Generator/Commands/ContainerWebGenerator.php +++ b/src/Generator/Commands/ContainerWebGenerator.php @@ -48,7 +48,7 @@ class ContainerWebGenerator extends GeneratorCommand implements ComponentsGenera */ protected string $stubName = 'composer.stub'; - public function getUserInputs(): null|array + public function getUserInputs(): array|null { $ui = 'web'; diff --git a/src/Generator/Commands/ControllerGenerator.php b/src/Generator/Commands/ControllerGenerator.php index a96d1523..2c87ffdb 100644 --- a/src/Generator/Commands/ControllerGenerator.php +++ b/src/Generator/Commands/ControllerGenerator.php @@ -48,7 +48,7 @@ class ControllerGenerator extends GeneratorCommand implements ComponentsGenerato */ protected string $stubName = 'controllers/generic.stub'; - public function getUserInputs(): null|array + public function getUserInputs(): array|null { $ui = Str::lower($this->checkParameterOrChoice('ui', 'Select the UI for the controller', ['API', 'WEB'], 0)); diff --git a/src/Generator/Commands/EventGenerator.php b/src/Generator/Commands/EventGenerator.php index 9dd8d5ca..c67c9742 100644 --- a/src/Generator/Commands/EventGenerator.php +++ b/src/Generator/Commands/EventGenerator.php @@ -47,7 +47,7 @@ class EventGenerator extends GeneratorCommand implements ComponentsGenerator */ protected string $stubName = 'events/generic.stub'; - public function getUserInputs(): null|array + public function getUserInputs(): array|null { $model = $this->checkParameterOrAsk('model', 'Enter the name of the Model to generate this Event for', Str::ucfirst($this->containerName)); diff --git a/src/Generator/Commands/EventListenerGenerator.php b/src/Generator/Commands/EventListenerGenerator.php index cfa60fb7..5b68b321 100644 --- a/src/Generator/Commands/EventListenerGenerator.php +++ b/src/Generator/Commands/EventListenerGenerator.php @@ -44,7 +44,7 @@ class EventListenerGenerator extends GeneratorCommand implements ComponentsGener */ protected string $stubName = 'listeners/listener.stub'; - public function getUserInputs(): null|array + public function getUserInputs(): array|null { $event = $this->checkParameterOrAsk('event', 'Enter the name of the Event to generate this Listener for'); diff --git a/src/Generator/Commands/ExceptionGenerator.php b/src/Generator/Commands/ExceptionGenerator.php index 1a0199ad..7b121da6 100644 --- a/src/Generator/Commands/ExceptionGenerator.php +++ b/src/Generator/Commands/ExceptionGenerator.php @@ -43,7 +43,7 @@ class ExceptionGenerator extends GeneratorCommand implements ComponentsGenerator */ protected string $stubName = 'exception.stub'; - public function getUserInputs(): null|array + public function getUserInputs(): array|null { return [ 'path-parameters' => [ diff --git a/src/Generator/Commands/JobGenerator.php b/src/Generator/Commands/JobGenerator.php index 815de3da..35babdec 100644 --- a/src/Generator/Commands/JobGenerator.php +++ b/src/Generator/Commands/JobGenerator.php @@ -43,7 +43,7 @@ class JobGenerator extends GeneratorCommand implements ComponentsGenerator */ protected string $stubName = 'job.stub'; - public function getUserInputs(): null|array + public function getUserInputs(): array|null { return [ 'path-parameters' => [ diff --git a/src/Generator/Commands/MailGenerator.php b/src/Generator/Commands/MailGenerator.php index 328c93e6..582d30c4 100644 --- a/src/Generator/Commands/MailGenerator.php +++ b/src/Generator/Commands/MailGenerator.php @@ -45,7 +45,7 @@ class MailGenerator extends GeneratorCommand implements ComponentsGenerator */ protected string $stubName = 'mail.stub'; - public function getUserInputs(): null|array + public function getUserInputs(): array|null { $view = $this->checkParameterOrAsk('view', 'Enter the name of the view to be loaded when sending this Mail'); diff --git a/src/Generator/Commands/MiddlewareGenerator.php b/src/Generator/Commands/MiddlewareGenerator.php index 0cd2be20..7c8ee5f0 100644 --- a/src/Generator/Commands/MiddlewareGenerator.php +++ b/src/Generator/Commands/MiddlewareGenerator.php @@ -43,7 +43,7 @@ class MiddlewareGenerator extends GeneratorCommand implements ComponentsGenerato */ protected string $stubName = 'middleware.stub'; - public function getUserInputs(): null|array + public function getUserInputs(): array|null { return [ 'path-parameters' => [ diff --git a/src/Generator/Commands/MigrationGenerator.php b/src/Generator/Commands/MigrationGenerator.php index a8682478..a7d9e72e 100644 --- a/src/Generator/Commands/MigrationGenerator.php +++ b/src/Generator/Commands/MigrationGenerator.php @@ -48,7 +48,7 @@ class MigrationGenerator extends GeneratorCommand implements ComponentsGenerator */ protected string $stubName = 'migration.stub'; - public function getUserInputs(): null|array + public function getUserInputs(): array|null { $tableName = Str::lower($this->checkParameterOrAsk('tablename', 'Enter the name of the database table', Str::snake(Pluralizer::plural($this->containerName)))); diff --git a/src/Generator/Commands/ModelFactoryGenerator.php b/src/Generator/Commands/ModelFactoryGenerator.php index 59b3e3fa..39424543 100644 --- a/src/Generator/Commands/ModelFactoryGenerator.php +++ b/src/Generator/Commands/ModelFactoryGenerator.php @@ -45,7 +45,7 @@ class ModelFactoryGenerator extends GeneratorCommand implements ComponentsGenera */ protected string $stubName = 'factory.stub'; - public function getUserInputs(): null|array + public function getUserInputs(): array|null { $model = $this->checkParameterOrAsk('model', 'Enter the name of the Model to generate this Factory for'); diff --git a/src/Generator/Commands/ModelGenerator.php b/src/Generator/Commands/ModelGenerator.php index 6b3e2dea..51473533 100644 --- a/src/Generator/Commands/ModelGenerator.php +++ b/src/Generator/Commands/ModelGenerator.php @@ -45,7 +45,7 @@ class ModelGenerator extends GeneratorCommand implements ComponentsGenerator */ protected string $stubName = 'model.stub'; - public function getUserInputs(): null|array + public function getUserInputs(): array|null { $repository = $this->checkParameterOrConfirm('repository', 'Do you want to generate the corresponding Repository for this Model?', true); if ($repository) { diff --git a/src/Generator/Commands/NotificationGenerator.php b/src/Generator/Commands/NotificationGenerator.php index a7dafa0c..c4e59f36 100644 --- a/src/Generator/Commands/NotificationGenerator.php +++ b/src/Generator/Commands/NotificationGenerator.php @@ -43,7 +43,7 @@ class NotificationGenerator extends GeneratorCommand implements ComponentsGenera */ protected string $stubName = 'notification.stub'; - public function getUserInputs(): null|array + public function getUserInputs(): array|null { return [ 'path-parameters' => [ diff --git a/src/Generator/Commands/PolicyGenerator.php b/src/Generator/Commands/PolicyGenerator.php index bd0f2578..0967d850 100644 --- a/src/Generator/Commands/PolicyGenerator.php +++ b/src/Generator/Commands/PolicyGenerator.php @@ -43,7 +43,7 @@ class PolicyGenerator extends GeneratorCommand implements ComponentsGenerator */ protected string $stubName = 'policy.stub'; - public function getUserInputs(): null|array + public function getUserInputs(): array|null { return [ 'path-parameters' => [ diff --git a/src/Generator/Commands/ReadmeGenerator.php b/src/Generator/Commands/ReadmeGenerator.php index bea17498..f2b73086 100644 --- a/src/Generator/Commands/ReadmeGenerator.php +++ b/src/Generator/Commands/ReadmeGenerator.php @@ -43,7 +43,7 @@ class ReadmeGenerator extends GeneratorCommand implements ComponentsGenerator */ protected string $stubName = 'readme.stub'; - public function getUserInputs(): null|array + public function getUserInputs(): array|null { return [ 'path-parameters' => [ diff --git a/src/Generator/Commands/RepositoryGenerator.php b/src/Generator/Commands/RepositoryGenerator.php index 4a058162..153e0a64 100644 --- a/src/Generator/Commands/RepositoryGenerator.php +++ b/src/Generator/Commands/RepositoryGenerator.php @@ -43,7 +43,7 @@ class RepositoryGenerator extends GeneratorCommand implements ComponentsGenerato */ protected string $stubName = 'repository.stub'; - public function getUserInputs(): null|array + public function getUserInputs(): array|null { return [ 'path-parameters' => [ diff --git a/src/Generator/Commands/RequestGenerator.php b/src/Generator/Commands/RequestGenerator.php index 9d3051e0..157d2125 100644 --- a/src/Generator/Commands/RequestGenerator.php +++ b/src/Generator/Commands/RequestGenerator.php @@ -52,7 +52,7 @@ class RequestGenerator extends GeneratorCommand implements ComponentsGenerator */ protected string $stubName = 'requests/generic.stub'; - public function getUserInputs(): null|array + public function getUserInputs(): array|null { $ui = Str::lower($this->checkParameterOrChoice('ui', 'Select the UI for the controller', ['API', 'WEB'], 0)); $stub = $this->option('stub'); diff --git a/src/Generator/Commands/RouteGenerator.php b/src/Generator/Commands/RouteGenerator.php index 57435782..b88fc46d 100644 --- a/src/Generator/Commands/RouteGenerator.php +++ b/src/Generator/Commands/RouteGenerator.php @@ -51,7 +51,7 @@ class RouteGenerator extends GeneratorCommand implements ComponentsGenerator */ protected string $stubName = 'routes/generic.stub'; - public function getUserInputs(): null|array + public function getUserInputs(): array|null { $ui = Str::lower($this->checkParameterOrChoice('ui', 'Select the UI for the controller', ['API', 'WEB'], 0)); $version = $this->checkParameterOrAsk('docversion', 'Enter the endpoint version (integer)', 1); diff --git a/src/Generator/Commands/SeederGenerator.php b/src/Generator/Commands/SeederGenerator.php index 73743470..d1309f92 100644 --- a/src/Generator/Commands/SeederGenerator.php +++ b/src/Generator/Commands/SeederGenerator.php @@ -43,7 +43,7 @@ class SeederGenerator extends GeneratorCommand implements ComponentsGenerator */ protected string $stubName = 'seeder.stub'; - public function getUserInputs(): null|array + public function getUserInputs(): array|null { return [ 'path-parameters' => [ diff --git a/src/Generator/Commands/ServiceProviderGenerator.php b/src/Generator/Commands/ServiceProviderGenerator.php index 5fade629..1eb922ee 100644 --- a/src/Generator/Commands/ServiceProviderGenerator.php +++ b/src/Generator/Commands/ServiceProviderGenerator.php @@ -45,7 +45,7 @@ class ServiceProviderGenerator extends GeneratorCommand implements ComponentsGen */ protected string $stubName = 'providers/mainserviceprovider.stub'; - public function getUserInputs(): null|array + public function getUserInputs(): array|null { $stub = Str::lower( $this->checkParameterOrChoice( diff --git a/src/Generator/Commands/SubActionGenerator.php b/src/Generator/Commands/SubActionGenerator.php index 4c5ec051..820a0608 100644 --- a/src/Generator/Commands/SubActionGenerator.php +++ b/src/Generator/Commands/SubActionGenerator.php @@ -43,7 +43,7 @@ class SubActionGenerator extends GeneratorCommand implements ComponentsGenerator */ protected string $stubName = 'subaction.stub'; - public function getUserInputs(): null|array + public function getUserInputs(): array|null { return [ 'path-parameters' => [ diff --git a/src/Generator/Commands/TaskGenerator.php b/src/Generator/Commands/TaskGenerator.php index 706a7613..48759e2f 100644 --- a/src/Generator/Commands/TaskGenerator.php +++ b/src/Generator/Commands/TaskGenerator.php @@ -48,7 +48,7 @@ class TaskGenerator extends GeneratorCommand implements ComponentsGenerator */ protected string $stubName = 'tasks/generic.stub'; - public function getUserInputs(): null|array + public function getUserInputs(): array|null { $model = $this->checkParameterOrAsk('model', 'Enter the name of the model this task is for.', $this->containerName); $stub = Str::lower( diff --git a/src/Generator/Commands/TestFunctionalTestGenerator.php b/src/Generator/Commands/TestFunctionalTestGenerator.php index 7a82924a..bdcf1fb5 100644 --- a/src/Generator/Commands/TestFunctionalTestGenerator.php +++ b/src/Generator/Commands/TestFunctionalTestGenerator.php @@ -48,7 +48,7 @@ class TestFunctionalTestGenerator extends GeneratorCommand implements Components */ protected string $stubName = 'tests/functional/generic.stub'; - public function getUserInputs(): null|array + public function getUserInputs(): array|null { $ui = Str::lower($this->checkParameterOrChoice('ui', 'Select the UI for the Test', ['API', 'WEB', 'CLI'], 0)); diff --git a/src/Generator/Commands/TestTestCaseGenerator.php b/src/Generator/Commands/TestTestCaseGenerator.php index 4f9baf15..af693bf6 100644 --- a/src/Generator/Commands/TestTestCaseGenerator.php +++ b/src/Generator/Commands/TestTestCaseGenerator.php @@ -46,7 +46,7 @@ class TestTestCaseGenerator extends GeneratorCommand implements ComponentsGenera */ protected string $stubName = 'tests/testcase/generic.stub'; - public function getUserInputs(): null|array + public function getUserInputs(): array|null { $type = Str::lower($this->checkParameterOrChoice('type', 'Select the TestCase type', ['Unit', 'Functional'], 0)); diff --git a/src/Generator/Commands/TestUnitTestGenerator.php b/src/Generator/Commands/TestUnitTestGenerator.php index 8cc12e23..dd04daff 100644 --- a/src/Generator/Commands/TestUnitTestGenerator.php +++ b/src/Generator/Commands/TestUnitTestGenerator.php @@ -48,7 +48,7 @@ class TestUnitTestGenerator extends GeneratorCommand implements ComponentsGenera */ protected string $stubName = 'tests/unit/generic.stub'; - public function getUserInputs(): null|array + public function getUserInputs(): array|null { $model = $this->option('model'); $stub = $this->option('stub'); diff --git a/src/Generator/Commands/TransformerGenerator.php b/src/Generator/Commands/TransformerGenerator.php index 39d4d581..3c3d95d4 100644 --- a/src/Generator/Commands/TransformerGenerator.php +++ b/src/Generator/Commands/TransformerGenerator.php @@ -47,7 +47,7 @@ class TransformerGenerator extends GeneratorCommand implements ComponentsGenerat */ protected string $stubName = 'transformer.stub'; - public function getUserInputs(): null|array + public function getUserInputs(): array|null { $model = $this->checkParameterOrAsk('model', 'Enter the name of the Model to generate this Transformer for'); $full = $this->checkParameterOrConfirm('full', 'Generate a Transformer with all fields', false); diff --git a/src/Generator/Commands/ValueGenerator.php b/src/Generator/Commands/ValueGenerator.php index 336ad28b..176192ea 100644 --- a/src/Generator/Commands/ValueGenerator.php +++ b/src/Generator/Commands/ValueGenerator.php @@ -44,7 +44,7 @@ class ValueGenerator extends GeneratorCommand implements ComponentsGenerator */ protected string $stubName = 'value.stub'; - public function getUserInputs(): null|array + public function getUserInputs(): array|null { return [ 'path-parameters' => [ diff --git a/src/Generator/GeneratorCommand.php b/src/Generator/GeneratorCommand.php index 511490b5..8e8781db 100644 --- a/src/Generator/GeneratorCommand.php +++ b/src/Generator/GeneratorCommand.php @@ -150,7 +150,7 @@ private function validateGenerator($generator): void /** * Checks if the param is set (via CLI), otherwise asks the user for a value. */ - protected function checkParameterOrAsk($param, $question, null|string $default = null): mixed + protected function checkParameterOrAsk($param, $question, string|null $default = null): mixed { // Check if we already have a param set $value = $this->option($param); diff --git a/src/Generator/Interfaces/ComponentsGenerator.php b/src/Generator/Interfaces/ComponentsGenerator.php index 70273343..55d84c41 100644 --- a/src/Generator/Interfaces/ComponentsGenerator.php +++ b/src/Generator/Interfaces/ComponentsGenerator.php @@ -7,5 +7,5 @@ interface ComponentsGenerator /** * Reads all data for the component to be generated (as well as the mappings for path, file and stubs). */ - public function getUserInputs(): null|array; + public function getUserInputs(): array|null; } diff --git a/src/Helpers/helpers.php b/src/Helpers/helpers.php index 26bc4be8..d19bc63a 100644 --- a/src/Helpers/helpers.php +++ b/src/Helpers/helpers.php @@ -1,7 +1,5 @@ query->replace($query); } - private function decodeValue(string $searchQuery): null|string + private function decodeValue(string $searchQuery): string|null { $searchValue = $this->parserSearchValue($searchQuery); diff --git a/src/Traits/ResponseTrait.php b/src/Traits/ResponseTrait.php index e8ef0895..00b1e86d 100644 --- a/src/Traits/ResponseTrait.php +++ b/src/Traits/ResponseTrait.php @@ -139,7 +139,7 @@ public function created($data = null, $status = 201, array $headers = [], $optio /** * @throws \ReflectionException */ - public function deleted(null|Model $deletedModel = null): JsonResponse + public function deleted(Model|null $deletedModel = null): JsonResponse { if (!$deletedModel) { return $this->accepted(); diff --git a/src/Traits/TestTraits/PhpUnit/TestAssertionHelperTrait.php b/src/Traits/TestTraits/PhpUnit/TestAssertionHelperTrait.php index 65155848..dd7e34e7 100644 --- a/src/Traits/TestTraits/PhpUnit/TestAssertionHelperTrait.php +++ b/src/Traits/TestTraits/PhpUnit/TestAssertionHelperTrait.php @@ -7,7 +7,6 @@ use Illuminate\Support\Collection; use Illuminate\Support\Facades\Schema; use JetBrains\PhpStorm\Deprecated; -use Mockery\MockInterface; use PHPUnit\Framework\MockObject\Exception; use PHPUnit\Framework\MockObject\MockObject;