From 2aee285df224375b4d25acdd8e01da109def6ffb Mon Sep 17 00:00:00 2001 From: butschster Date: Thu, 22 Dec 2022 15:00:18 +0400 Subject: [PATCH 1/3] Move debug output information into verbose level --- README.md | 21 ++++-- composer.json | 2 +- installer/Configurator.php | 4 +- installer/Generator/BootloaderGroup.php | 8 +-- installer/Generator/Bootloaders.php | 4 +- installer/Generator/EnvConfigurator.php | 4 +- installer/Generator/EnvGroup.php | 12 ++-- installer/Installer.php | 48 ++++++++----- installer/Question/AbstractQuestion.php | 8 ++- installer/Resource.php | 4 ++ .../Resources/applications/custom/psalm.xml | 4 +- .../shared/tests/Feature/Job/PingTest.php | 5 +- .../Application/Middleware/LocaleSelector.php | 2 +- .../web/app/src/Application/helpers.php | 2 +- .../applications/web/public/images/403.svg | 6 +- .../applications/web/public/images/404.svg | 6 +- .../applications/web/public/images/500.svg | 6 +- .../applications/web/public/images/logo.svg | 12 ++-- .../common/app/config/scaffolder.php | 2 +- installer/Resources/common/deptrac.yaml | 16 ++--- installer/Resources/common/phpunit.xml | 32 ++++----- installer/Resources/common/psalm.xml | 4 +- installer/Resources/common/tests/TestCase.php | 4 +- .../docker/temporal/development-cass.yaml | 2 +- .../temporal/docker/temporal/development.yaml | 4 +- .../packages/twig/views/exception/403.twig | 3 +- .../packages/twig/views/exception/404.twig | 3 +- .../packages/twig/views/exception/500.twig | 3 +- .../packages/twig/views/exception/error.twig | 3 +- .../Resources/packages/twig/views/home.twig | 3 +- .../packages/twig/views/layout/base.twig | 20 +++--- psalm.xml | 70 +++++++++---------- 32 files changed, 187 insertions(+), 140 deletions(-) diff --git a/README.md b/README.md index 36d3a2a..cb84fbc 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,21 @@ # Spiral Application installer -[App Skeleton](https://github.com/spiral/app) | [**Documentation**](https://spiral.dev/docs) | [Discord](https://discord.gg/TFeEmCs) | [Twitter](https://twitter.com/spiralphp) | [Contributing](https://spiral.dev/docs/about-contributing/) +[App Skeleton](https://github.com/spiral/app) | [**Documentation +**](https://spiral.dev/docs) | [Discord](https://discord.gg/TFeEmCs) | [Twitter](https://twitter.com/spiralphp) | [Contributing](https://spiral.dev/docs/about-contributing/) ![Installer](https://user-images.githubusercontent.com/773481/208850084-891a9d6f-3e70-4a06-af57-4e63c37c9c47.png) -Spiral Framework is a High-Performance PHP/Go Full-Stack framework and group of over sixty PSR-compatible components. The Framework execution model based on a hybrid runtime where some services (GRPC, Queue, WebSockets, etc.) handled by Application Server [RoadRunner](https://github.com/roadrunner-server/roadrunner) and the PHP code of your application stays in memory permanently (anti-memory leak tools included). +Spiral Framework is a High-Performance PHP/Go Full-Stack framework and group of over sixty PSR-compatible components. +The Framework execution model based on a hybrid runtime where some services (GRPC, Queue, WebSockets, etc.) handled by +Application Server [RoadRunner](https://github.com/roadrunner-server/roadrunner) and the PHP code of your application +stays in memory permanently (anti-memory leak tools included).
## Server Requirements Make sure that your server is configured with following PHP version and extensions: + * PHP 8.1+, 64bit * [mb-string](https://www.php.net/manual/en/intro.mbstring.php) extension * PDO Extension with desired database drivers @@ -21,7 +26,8 @@ Make sure that your server is configured with following PHP version and extensio composer create-project spiral/installer my-app ``` -> **Note**: Application server will be downloaded automatically (`php-curl` and `php-zip` required). +> **Note**: +> Application server will be downloaded automatically (`php-curl` and `php-zip` required).
@@ -35,10 +41,13 @@ cd my-app
-Once you have started RoadRunner server, your application will be accessible in your web browser at `http://localhost:8080`. +Once you have started RoadRunner server, your application will be accessible in your web browser +at `http://localhost:8080`. -> **Note**: Read more about application server configuration [here](https://roadrunner.dev/docs). +> **Note**: +> Read more about application server configuration [here](https://roadrunner.dev/docs). ## License: -MIT License (MIT). Please see [`LICENSE`](./LICENSE) for more information. Maintained by [Spiral Scout](https://spiralscout.com). +MIT License (MIT). Please see [`LICENSE`](./LICENSE) for more information. Maintained +by [Spiral Scout](https://spiralscout.com). diff --git a/composer.json b/composer.json index dc67aeb..d9023f0 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ "require": { "php": ">=8.1", "spiral/roadrunner-cli": "^2.4", - "spiral/framework": "^3.2" + "spiral/framework": "^3.3" }, "require-dev": { "phpunit/phpunit": "^9.5", diff --git a/installer/Configurator.php b/installer/Configurator.php index b573c69..ecbb0fc 100644 --- a/installer/Configurator.php +++ b/installer/Configurator.php @@ -113,7 +113,7 @@ private function showInstructions(): void // from application foreach ($this->application->getInstructions() as $index => $instruction) { - $this->io->write(\sprintf(' %s. %s', (int) $index + 1, $instruction)); + $this->io->write(\sprintf(' %s. %s', (int)$index + 1, $instruction)); } $showPackageInstruction = function (Package $package): void { @@ -122,7 +122,7 @@ private function showInstructions(): void } foreach ($package->getInstructions() as $index => $instruction) { - $this->io->write(\sprintf(' %s. %s', (int) $index + 1, $instruction)); + $this->io->write(\sprintf(' %s. %s', (int)$index + 1, $instruction)); } }; diff --git a/installer/Generator/BootloaderGroup.php b/installer/Generator/BootloaderGroup.php index 8df1dda..f18aa53 100644 --- a/installer/Generator/BootloaderGroup.php +++ b/installer/Generator/BootloaderGroup.php @@ -35,9 +35,9 @@ public function append(string $bootloader, string $afterBootloader): void foreach ($this->bootloaders as $pos => $value) { if ($afterBootloader === $value) { $this->bootloaders = \array_merge( - \array_slice($this->bootloaders, 0, (int) $pos + 1), + \array_slice($this->bootloaders, 0, (int)$pos + 1), [$bootloader], - \array_slice($this->bootloaders, (int) $pos + 1) + \array_slice($this->bootloaders, (int)$pos + 1) ); break; } @@ -52,9 +52,9 @@ public function prepend(string $bootloader, string $beforeBootloader): void foreach ($this->bootloaders as $pos => $value) { if ($beforeBootloader === $value) { $this->bootloaders = \array_merge( - \array_slice($this->bootloaders, 0, (int) $pos), + \array_slice($this->bootloaders, 0, (int)$pos), [$bootloader], - \array_slice($this->bootloaders, (int) $pos) + \array_slice($this->bootloaders, (int)$pos) ); break; } diff --git a/installer/Generator/Bootloaders.php b/installer/Generator/Bootloaders.php index b5de531..620266f 100644 --- a/installer/Generator/Bootloaders.php +++ b/installer/Generator/Bootloaders.php @@ -71,11 +71,11 @@ public function updateDeclaration(ClassDeclaration $class, PhpNamespace $namespa { \uasort( $this->groups, - static fn (BootloaderGroup $a, BootloaderGroup $b) => $a->priority <=> $b->priority + static fn(BootloaderGroup $a, BootloaderGroup $b) => $a->priority <=> $b->priority ); $groups = \array_map( - static fn (BootloaderGroup $group) => $group->render($namespace), + static fn(BootloaderGroup $group) => $group->render($namespace), \array_values($this->groups) ); diff --git a/installer/Generator/EnvConfigurator.php b/installer/Generator/EnvConfigurator.php index 69b8ed0..6f6d21b 100644 --- a/installer/Generator/EnvConfigurator.php +++ b/installer/Generator/EnvConfigurator.php @@ -26,10 +26,10 @@ public function __construct( public function __destruct() { - \uasort($this->groups, static fn (EnvGroup $a, EnvGroup $b) => $a->priority <=> $b->priority); + \uasort($this->groups, static fn(EnvGroup $a, EnvGroup $b) => $a->priority <=> $b->priority); $groups = \array_map( - static fn (EnvGroup $group) => $group->render(), + static fn(EnvGroup $group) => $group->render(), \array_values($this->groups) ); diff --git a/installer/Generator/EnvGroup.php b/installer/Generator/EnvGroup.php index 640e24a..5a58c7b 100644 --- a/installer/Generator/EnvGroup.php +++ b/installer/Generator/EnvGroup.php @@ -39,10 +39,14 @@ public function render(): string $values = []; foreach ($this->values as $key => $value) { - $values[] = \sprintf('%s=%s', $key, match (true) { - \is_bool($value) => \var_export($value, true), - default => $value - }); + $values[] = \sprintf( + '%s=%s', + $key, + match (true) { + \is_bool($value) => \var_export($value, true), + default => $value + } + ); } return $comment . \implode(PHP_EOL, $values); diff --git a/installer/Installer.php b/installer/Installer.php index 72ecffa..a65a4b3 100644 --- a/installer/Installer.php +++ b/installer/Installer.php @@ -34,6 +34,8 @@ final class Installer extends AbstractInstaller /** @var array */ private array $stabilityFlags = []; + private readonly bool $verbose; + /** * @throws ParsingException */ @@ -54,16 +56,16 @@ public static function install(Event $event): void { $installer = new self($event->getIO(), $event->getComposer()); - $installer->io->write('Setting up application preset'); + $installer->writeInfo('Setting up application preset'); $installer->setApplicationType($installer->requestApplicationType()); - $installer->io->write('Setting up required packages'); + $installer->writeInfo('Setting up required packages'); $installer->setRequiredPackages(); - $installer->io->write('Setting up optional packages'); + $installer->writeInfo('Setting up optional packages'); $installer->promptForOptionalPackages(); - $installer->io->write('Setting up application files'); + $installer->writeInfo('Setting up application files'); $installer->setApplicationFiles(); $installer->removeInstallerFromDefinition(); @@ -130,12 +132,12 @@ private function requestApplicationType(): int ]; foreach ($this->config as $key => $app) { if ($app instanceof ApplicationInterface) { - $query[] = \sprintf(" [%s] %s\n", (int) $key + 1, $app->getName()); + $query[] = \sprintf(" [%s] %s\n", (int)$key + 1, $app->getName()); } } $query[] = \sprintf(' Make your selection (%s): ', 1); - return (int) $this->io->ask(\implode($query), 1) - 1; + return (int)$this->io->ask(\implode($query), 1) - 1; } private function setApplicationType(int $type): void @@ -152,31 +154,33 @@ private function setApplicationType(int $type): void private function askQuestion(QuestionInterface $question): int { - $answer = $this->io->ask($question->getQuestion(), (string) $question->getDefault()); + $answer = $this->io->ask($question->getQuestion(), (string)$question->getDefault()); // Handling "y", "Y", "n", "N" - if (\strtolower((string) $answer) === 'n') { + if (\strtolower((string)$answer) === 'n') { $answer = 0; } - if (\strtolower((string) $answer) === 'y' && count($question->getOptions()) === 2) { + if (\strtolower((string)$answer) === 'y' && count($question->getOptions()) === 2) { $answer = 1; } - if (!$question->hasOption((int) $answer)) { + if (!$question->hasOption((int)$answer)) { $this->io->write('Invalid answer'); exit; } - return (int) $answer; + return (int)$answer; } private function addPackage(Package $package): void { - $this->io->write(\sprintf( - ' - Adding package %s (%s)', - $package->getName(), - $package->getVersion() - )); + $this->writeInfo( + \sprintf( + ' - Adding package %s (%s)', + $package->getName(), + $package->getVersion() + ) + ); $versionParser = new VersionParser(); $constraint = $versionParser->parseConstraints($package->getVersion()); @@ -209,6 +213,7 @@ private function addPackage(Package $package): void 'RC' => BasePackage::STABILITY_RC, default => null }; + if ($stability !== null) { $this->stabilityFlags[$package->getName()] = $stability; } @@ -239,7 +244,7 @@ private function updateRootPackage(): void private function removeInstallerFromDefinition(): void { - $this->io->write('Remove Installer from composer.json'); + $this->writeInfo('Remove Installer from composer.json'); unset( $this->composerDevRequires['composer/composer'], @@ -265,4 +270,13 @@ private function addBooleanAnswer(QuestionInterface $question, BooleanOption $an $this->composerDefinition['extra']['spiral']['options'][$question::class] = $answer->value; } } + + private function writeInfo(string $message): void + { + if (!$this->io->isVerbose()) { + return; + } + + $this->io->write($message); + } } diff --git a/installer/Question/AbstractQuestion.php b/installer/Question/AbstractQuestion.php index d3f5039..63d3c13 100644 --- a/installer/Question/AbstractQuestion.php +++ b/installer/Question/AbstractQuestion.php @@ -128,12 +128,16 @@ private function setOptions(array $options): void if ($option instanceof Option && $option->getPackages() === []) { $this->options[0] = $option; } else { - $this->options[(int) $key + 1] = $option; + $this->options[(int)$key + 1] = $option; } } if ($this->required !== true && !isset($this->options[0])) { - $this->options[self::NONE_OPTION] = new Option(name: \count($this->options) === 1 ? 'No' : 'None of the above'); + $this->options[self::NONE_OPTION] = new Option( + name: \count( + $this->options + ) === 1 ? 'No' : 'None of the above' + ); } } diff --git a/installer/Resource.php b/installer/Resource.php index 0fb116e..fe9a50c 100644 --- a/installer/Resource.php +++ b/installer/Resource.php @@ -61,6 +61,10 @@ public function getSource(): string private function writeInfo(string $destination): void { + if (!$this->io?->isVerbose()) { + return; + } + $this->io?->write(\sprintf(' - Copying %s', $destination)); } } diff --git a/installer/Resources/applications/custom/psalm.xml b/installer/Resources/applications/custom/psalm.xml index 95a84a2..a7dff04 100644 --- a/installer/Resources/applications/custom/psalm.xml +++ b/installer/Resources/applications/custom/psalm.xml @@ -7,9 +7,9 @@ xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd" > - + - + diff --git a/installer/Resources/applications/shared/tests/Feature/Job/PingTest.php b/installer/Resources/applications/shared/tests/Feature/Job/PingTest.php index 4012944..f78bd12 100644 --- a/installer/Resources/applications/shared/tests/Feature/Job/PingTest.php +++ b/installer/Resources/applications/shared/tests/Feature/Job/PingTest.php @@ -23,8 +23,9 @@ public function testJobPushed(): void { $this->connection->push(Ping::class, ['value' => 'hello world']); - $this->connection->assertPushed(Ping::class, fn (array $data) => - $data['handler'] instanceof Ping && $data['payload']['value'] === 'hello world' + $this->connection->assertPushed( + Ping::class, + fn(array $data) => $data['handler'] instanceof Ping && $data['payload']['value'] === 'hello world' ); } } diff --git a/installer/Resources/applications/web/app/src/Application/Middleware/LocaleSelector.php b/installer/Resources/applications/web/app/src/Application/Middleware/LocaleSelector.php index f618282..5fcbf0d 100644 --- a/installer/Resources/applications/web/app/src/Application/Middleware/LocaleSelector.php +++ b/installer/Resources/applications/web/app/src/Application/Middleware/LocaleSelector.php @@ -45,7 +45,7 @@ public function fetchLocales(ServerRequestInterface $request): \Generator $header = $request->getHeaderLine('accept-language'); foreach (\explode(',', $header) as $value) { $pos = \strpos($value, ';'); - if ($pos!== false) { + if ($pos !== false) { yield \substr($value, 0, $pos); } diff --git a/installer/Resources/applications/web/app/src/Application/helpers.php b/installer/Resources/applications/web/app/src/Application/helpers.php index ca83a93..c32f551 100644 --- a/installer/Resources/applications/web/app/src/Application/helpers.php +++ b/installer/Resources/applications/web/app/src/Application/helpers.php @@ -30,7 +30,7 @@ function dumprr(mixed $value, mixed ...$values): mixed $cloner->addCasters(ReflectionCaster::UNSET_CLOSURE_FILE_INFO); // Set new handler and store previous one - $prevent = VarDumper::setHandler(static fn ($value) => $dumper->dump($cloner->cloneVar($value))); + $prevent = VarDumper::setHandler(static fn($value) => $dumper->dump($cloner->cloneVar($value))); $result = VarDumper::dump($value); foreach ($values as $v) { diff --git a/installer/Resources/applications/web/public/images/403.svg b/installer/Resources/applications/web/public/images/403.svg index 0cbe856..460c5a5 100644 --- a/installer/Resources/applications/web/public/images/403.svg +++ b/installer/Resources/applications/web/public/images/403.svg @@ -1,3 +1,5 @@ - - + + diff --git a/installer/Resources/applications/web/public/images/404.svg b/installer/Resources/applications/web/public/images/404.svg index 7325eee..03a130f 100644 --- a/installer/Resources/applications/web/public/images/404.svg +++ b/installer/Resources/applications/web/public/images/404.svg @@ -1,3 +1,5 @@ - - + + diff --git a/installer/Resources/applications/web/public/images/500.svg b/installer/Resources/applications/web/public/images/500.svg index af0c775..9b13a6e 100644 --- a/installer/Resources/applications/web/public/images/500.svg +++ b/installer/Resources/applications/web/public/images/500.svg @@ -1,3 +1,5 @@ - - + + diff --git a/installer/Resources/applications/web/public/images/logo.svg b/installer/Resources/applications/web/public/images/logo.svg index 24d847c..086956f 100644 --- a/installer/Resources/applications/web/public/images/logo.svg +++ b/installer/Resources/applications/web/public/images/logo.svg @@ -1,8 +1,8 @@ - - - - - - + + + + + + diff --git a/installer/Resources/common/app/config/scaffolder.php b/installer/Resources/common/app/config/scaffolder.php index 9c82e58..f50381b 100644 --- a/installer/Resources/common/app/config/scaffolder.php +++ b/installer/Resources/common/app/config/scaffolder.php @@ -6,5 +6,5 @@ * @see \Spiral\Scaffolder\Config\ScaffolderConfig */ return [ - 'namespace' => 'App', + 'namespace' => 'App', ]; diff --git a/installer/Resources/common/deptrac.yaml b/installer/Resources/common/deptrac.yaml index d82905c..c907a28 100644 --- a/installer/Resources/common/deptrac.yaml +++ b/installer/Resources/common/deptrac.yaml @@ -26,10 +26,10 @@ deptrac: collectors: - type: className value: App\\Application\\Bootloader\\.* -# - name: AppTest -# collectors: -# - type: className -# value: Tests\\.* + # - name: AppTest + # collectors: + # - type: className + # value: Tests\\.* # Api - name: Controller @@ -59,10 +59,10 @@ deptrac: collectors: - type: className value: App\\Module\\.*Bootloader.* -# - name: ModuleTest -# collectors: -# - type: className -# value: App\\Module\\[a-z_][a-z0-9_]*\\Tests?\\.* + # - name: ModuleTest + # collectors: + # - type: className + # value: App\\Module\\[a-z_][a-z0-9_]*\\Tests?\\.* # Vendor - name: VendorBootloader diff --git a/installer/Resources/common/phpunit.xml b/installer/Resources/common/phpunit.xml index a875d9e..44f91c2 100644 --- a/installer/Resources/common/phpunit.xml +++ b/installer/Resources/common/phpunit.xml @@ -14,20 +14,20 @@ stopOnFailure="false" stopOnError="false" stderr="true"> - - - app/src - - - - - tests/Unit - - - tests/Feature - - - app/src/Module/*/Test - - + + + app/src + + + + + tests/Unit + + + tests/Feature + + + app/src/Module/*/Test + + diff --git a/installer/Resources/common/psalm.xml b/installer/Resources/common/psalm.xml index 95a84a2..a7dff04 100644 --- a/installer/Resources/common/psalm.xml +++ b/installer/Resources/common/psalm.xml @@ -7,9 +7,9 @@ xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd" > - + - + diff --git a/installer/Resources/common/tests/TestCase.php b/installer/Resources/common/tests/TestCase.php index 282bd12..4998fda 100644 --- a/installer/Resources/common/tests/TestCase.php +++ b/installer/Resources/common/tests/TestCase.php @@ -18,7 +18,7 @@ class TestCase extends BaseTestCase protected function setUp(): void { $this->beforeBooting(static function (ConfiguratorInterface $config): void { - if (! $config->exists('session')) { + if (!$config->exists('session')) { return; } @@ -49,7 +49,7 @@ protected function tearDown(): void public function rootDirectory(): string { - return __DIR__.'/..'; + return __DIR__ . '/..'; } public function defineDirectories(string $root): array diff --git a/installer/Resources/packages/temporal/docker/temporal/development-cass.yaml b/installer/Resources/packages/temporal/docker/temporal/development-cass.yaml index 4b91616..6520d6c 100644 --- a/installer/Resources/packages/temporal/docker/temporal/development-cass.yaml +++ b/installer/Resources/packages/temporal/docker/temporal/development-cass.yaml @@ -1,3 +1,3 @@ system.forceSearchAttributesCacheRefreshOnRead: - value: true # Dev setup only. Please don't turn this on in production. - constraints: {} + constraints: { } diff --git a/installer/Resources/packages/temporal/docker/temporal/development.yaml b/installer/Resources/packages/temporal/docker/temporal/development.yaml index 8862dfa..597d521 100644 --- a/installer/Resources/packages/temporal/docker/temporal/development.yaml +++ b/installer/Resources/packages/temporal/docker/temporal/development.yaml @@ -1,6 +1,6 @@ limit.maxIDLength: - value: 255 - constraints: {} + constraints: { } system.forceSearchAttributesCacheRefreshOnRead: - value: true # Dev setup only. Please don't turn this on in production. - constraints: {} + constraints: { } diff --git a/installer/Resources/packages/twig/views/exception/403.twig b/installer/Resources/packages/twig/views/exception/403.twig index ad3932f..582739a 100644 --- a/installer/Resources/packages/twig/views/exception/403.twig +++ b/installer/Resources/packages/twig/views/exception/403.twig @@ -1,7 +1,8 @@ {% extends "layout/base.twig" %} {% block title %}[[Access Forbidden]]{% endblock %} -{% block styles %}{% endblock %} +{% block styles %} + {% endblock %} {% block body %}
diff --git a/installer/Resources/packages/twig/views/exception/404.twig b/installer/Resources/packages/twig/views/exception/404.twig index 660313b..8a4f646 100644 --- a/installer/Resources/packages/twig/views/exception/404.twig +++ b/installer/Resources/packages/twig/views/exception/404.twig @@ -1,7 +1,8 @@ {% extends "layout/base.twig" %} {% block title %}[[Page not found]]{% endblock %} -{% block styles %}{% endblock %} +{% block styles %} + {% endblock %} {% block body %}
diff --git a/installer/Resources/packages/twig/views/exception/500.twig b/installer/Resources/packages/twig/views/exception/500.twig index 9615f64..9b63b10 100644 --- a/installer/Resources/packages/twig/views/exception/500.twig +++ b/installer/Resources/packages/twig/views/exception/500.twig @@ -1,7 +1,8 @@ {% extends "layout/base.twig" %} {% block title %}[[Something went wrong]]{% endblock %} -{% block styles %}{% endblock %} +{% block styles %} + {% endblock %} {% block body %}
diff --git a/installer/Resources/packages/twig/views/exception/error.twig b/installer/Resources/packages/twig/views/exception/error.twig index 8d12c35..f78838e 100644 --- a/installer/Resources/packages/twig/views/exception/error.twig +++ b/installer/Resources/packages/twig/views/exception/error.twig @@ -1,7 +1,8 @@ {% extends "layout/base.twig" %} {% block title %}[[Something went wrong]]{% endblock %} -{% block styles %}{% endblock %} +{% block styles %} + {% endblock %} {% block body %}
diff --git a/installer/Resources/packages/twig/views/home.twig b/installer/Resources/packages/twig/views/home.twig index 811a7df..41a6cdf 100644 --- a/installer/Resources/packages/twig/views/home.twig +++ b/installer/Resources/packages/twig/views/home.twig @@ -1,7 +1,8 @@ {% extends "layout/base.twig" %} {% block title %}[[Welcome To Spiral]]{% endblock %} -{% block styles %}{% endblock %} +{% block styles %} + {% endblock %} {% block body %}
diff --git a/installer/Resources/packages/twig/views/layout/base.twig b/installer/Resources/packages/twig/views/layout/base.twig index 85493e0..1382fc0 100644 --- a/installer/Resources/packages/twig/views/layout/base.twig +++ b/installer/Resources/packages/twig/views/layout/base.twig @@ -1,13 +1,13 @@ - - {% block title %}{% endblock %} - {% block styles %}{% endblock %} - - - {% block body %}{% endblock %} - {% block scripts %}{% endblock %} - - - {{ context }} + + {% block title %}{% endblock %} + {% block styles %}{% endblock %} + + +{% block body %}{% endblock %} +{% block scripts %}{% endblock %} + + +{{ context }} diff --git a/psalm.xml b/psalm.xml index a364896..74d8f13 100644 --- a/psalm.xml +++ b/psalm.xml @@ -7,47 +7,47 @@ xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd" > - + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 12ef5077416093c48709de3d518c5d0a6f67c292 Mon Sep 17 00:00:00 2001 From: butschster Date: Thu, 22 Dec 2022 15:19:15 +0400 Subject: [PATCH 2/3] Style fixes --- installer/Generator/EnvGroup.php | 12 ++++-------- installer/Question/AbstractQuestion.php | 4 +--- .../Resources/packages/twig/views/exception/403.twig | 3 +-- .../Resources/packages/twig/views/exception/404.twig | 3 +-- .../Resources/packages/twig/views/exception/500.twig | 3 +-- .../packages/twig/views/exception/error.twig | 3 +-- 6 files changed, 9 insertions(+), 19 deletions(-) diff --git a/installer/Generator/EnvGroup.php b/installer/Generator/EnvGroup.php index 5a58c7b..640e24a 100644 --- a/installer/Generator/EnvGroup.php +++ b/installer/Generator/EnvGroup.php @@ -39,14 +39,10 @@ public function render(): string $values = []; foreach ($this->values as $key => $value) { - $values[] = \sprintf( - '%s=%s', - $key, - match (true) { - \is_bool($value) => \var_export($value, true), - default => $value - } - ); + $values[] = \sprintf('%s=%s', $key, match (true) { + \is_bool($value) => \var_export($value, true), + default => $value + }); } return $comment . \implode(PHP_EOL, $values); diff --git a/installer/Question/AbstractQuestion.php b/installer/Question/AbstractQuestion.php index 63d3c13..de570d9 100644 --- a/installer/Question/AbstractQuestion.php +++ b/installer/Question/AbstractQuestion.php @@ -134,9 +134,7 @@ private function setOptions(array $options): void if ($this->required !== true && !isset($this->options[0])) { $this->options[self::NONE_OPTION] = new Option( - name: \count( - $this->options - ) === 1 ? 'No' : 'None of the above' + name: \count($this->options) === 1 ? 'No' : 'None of the above' ); } } diff --git a/installer/Resources/packages/twig/views/exception/403.twig b/installer/Resources/packages/twig/views/exception/403.twig index 582739a..ad3932f 100644 --- a/installer/Resources/packages/twig/views/exception/403.twig +++ b/installer/Resources/packages/twig/views/exception/403.twig @@ -1,8 +1,7 @@ {% extends "layout/base.twig" %} {% block title %}[[Access Forbidden]]{% endblock %} -{% block styles %} - {% endblock %} +{% block styles %}{% endblock %} {% block body %}
diff --git a/installer/Resources/packages/twig/views/exception/404.twig b/installer/Resources/packages/twig/views/exception/404.twig index 8a4f646..660313b 100644 --- a/installer/Resources/packages/twig/views/exception/404.twig +++ b/installer/Resources/packages/twig/views/exception/404.twig @@ -1,8 +1,7 @@ {% extends "layout/base.twig" %} {% block title %}[[Page not found]]{% endblock %} -{% block styles %} - {% endblock %} +{% block styles %}{% endblock %} {% block body %}
diff --git a/installer/Resources/packages/twig/views/exception/500.twig b/installer/Resources/packages/twig/views/exception/500.twig index 9b63b10..9615f64 100644 --- a/installer/Resources/packages/twig/views/exception/500.twig +++ b/installer/Resources/packages/twig/views/exception/500.twig @@ -1,8 +1,7 @@ {% extends "layout/base.twig" %} {% block title %}[[Something went wrong]]{% endblock %} -{% block styles %} - {% endblock %} +{% block styles %}{% endblock %} {% block body %}
diff --git a/installer/Resources/packages/twig/views/exception/error.twig b/installer/Resources/packages/twig/views/exception/error.twig index f78838e..8d12c35 100644 --- a/installer/Resources/packages/twig/views/exception/error.twig +++ b/installer/Resources/packages/twig/views/exception/error.twig @@ -1,8 +1,7 @@ {% extends "layout/base.twig" %} {% block title %}[[Something went wrong]]{% endblock %} -{% block styles %} - {% endblock %} +{% block styles %}{% endblock %} {% block body %}
From f524243ce2099fc6e6e4d92021d468287392d2c3 Mon Sep 17 00:00:00 2001 From: butschster Date: Thu, 22 Dec 2022 15:19:49 +0400 Subject: [PATCH 3/3] Style fixes --- installer/Resources/packages/twig/views/home.twig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/installer/Resources/packages/twig/views/home.twig b/installer/Resources/packages/twig/views/home.twig index 41a6cdf..811a7df 100644 --- a/installer/Resources/packages/twig/views/home.twig +++ b/installer/Resources/packages/twig/views/home.twig @@ -1,8 +1,7 @@ {% extends "layout/base.twig" %} {% block title %}[[Welcome To Spiral]]{% endblock %} -{% block styles %} - {% endblock %} +{% block styles %}{% endblock %} {% block body %}