From 77f0e31a62683d1aba188a375501bd560c3e7c63 Mon Sep 17 00:00:00 2001 From: StyleCI Bot Date: Wed, 22 Jun 2022 11:54:29 +0000 Subject: [PATCH] Apply fixes from StyleCI --- src/Config/TcpConfig.php | 4 ++-- src/Console/Command/Cache/ClearCommand.php | 1 - src/Console/Command/GRPC/GenerateCommand.php | 3 +-- src/Console/Command/Queue/PauseCommand.php | 1 - src/Console/Command/Queue/ResumeCommand.php | 1 - tests/app/config/queue.php | 2 +- tests/src/Bootloader/BroadcastingBootloaderTest.php | 1 - tests/src/Bootloader/GRPCBootloaderTest.php | 7 +++---- tests/src/Bootloader/QueueBootloaderTest.php | 6 +++--- .../src/Console/Command/GRPC/GenerateCommandTest.php | 6 +++--- tests/src/ConsoleTestCase.php | 11 ++++------- tests/src/Queue/ConsumerTest.php | 4 ++-- tests/src/TestCase.php | 2 +- 13 files changed, 20 insertions(+), 29 deletions(-) diff --git a/src/Config/TcpConfig.php b/src/Config/TcpConfig.php index 7a7939e..4be5786 100644 --- a/src/Config/TcpConfig.php +++ b/src/Config/TcpConfig.php @@ -13,7 +13,7 @@ final class TcpConfig extends InjectableConfig public const CONFIG = 'tcp'; /** - * @return array|array> + * @return array>|array */ public function getServices(): array { @@ -21,7 +21,7 @@ public function getServices(): array } /** - * @return array|array> + * @return array>|array */ public function getInterceptors(): array { diff --git a/src/Console/Command/Cache/ClearCommand.php b/src/Console/Command/Cache/ClearCommand.php index 16c920a..4384c47 100644 --- a/src/Console/Command/Cache/ClearCommand.php +++ b/src/Console/Command/Cache/ClearCommand.php @@ -6,7 +6,6 @@ use Spiral\Cache\CacheStorageProviderInterface; use Spiral\Console\Command; -use Symfony\Component\Console\Input\InputArgument; final class ClearCommand extends Command { diff --git a/src/Console/Command/GRPC/GenerateCommand.php b/src/Console/Command/GRPC/GenerateCommand.php index e71f0c4..f9b6fba 100644 --- a/src/Console/Command/GRPC/GenerateCommand.php +++ b/src/Console/Command/GRPC/GenerateCommand.php @@ -11,11 +11,10 @@ use Spiral\Files\FilesInterface; use Spiral\RoadRunnerBridge\Config\GRPCConfig; use Spiral\RoadRunnerBridge\GRPC\ProtoCompiler; -use Symfony\Component\Console\Input\InputArgument; final class GenerateCommand extends Command { - protected const SIGNATURE = 'grpc:generate + protected const SIGNATURE = 'grpc:generate {path=auto : Base path for generated service code} {namespace=auto : Base namespace for generated service code}'; protected const DESCRIPTION = 'Generate GPRC service code using protobuf specification'; diff --git a/src/Console/Command/Queue/PauseCommand.php b/src/Console/Command/Queue/PauseCommand.php index e589fa6..1caf22c 100644 --- a/src/Console/Command/Queue/PauseCommand.php +++ b/src/Console/Command/Queue/PauseCommand.php @@ -6,7 +6,6 @@ use Spiral\Console\Command; use Spiral\RoadRunner\Jobs\JobsInterface; -use Symfony\Component\Console\Input\InputArgument; final class PauseCommand extends Command { diff --git a/src/Console/Command/Queue/ResumeCommand.php b/src/Console/Command/Queue/ResumeCommand.php index d1dbbc0..4197d05 100644 --- a/src/Console/Command/Queue/ResumeCommand.php +++ b/src/Console/Command/Queue/ResumeCommand.php @@ -6,7 +6,6 @@ use Spiral\Console\Command; use Spiral\RoadRunner\Jobs\JobsInterface; -use Symfony\Component\Console\Input\InputArgument; final class ResumeCommand extends Command { diff --git a/tests/app/config/queue.php b/tests/app/config/queue.php index c1d23fe..a1e8cd3 100644 --- a/tests/app/config/queue.php +++ b/tests/app/config/queue.php @@ -48,7 +48,7 @@ 'connector' => new MemoryCreateInfo('local'), 'serializerFormat' => 'serializer', 'consume' => true, - ] + ], // 'amqp' => [ // 'connector' => new AMQPCreateInfo('bus', ...), // // Don't consume jobs for this pipeline on start diff --git a/tests/src/Bootloader/BroadcastingBootloaderTest.php b/tests/src/Bootloader/BroadcastingBootloaderTest.php index 8e76ded..253f225 100644 --- a/tests/src/Bootloader/BroadcastingBootloaderTest.php +++ b/tests/src/Bootloader/BroadcastingBootloaderTest.php @@ -4,7 +4,6 @@ namespace Spiral\Tests\Bootloader; -use Mockery as m; use Psr\Http\Message\ResponseFactoryInterface; use Spiral\Goridge\RPC\RPCInterface; use Spiral\RoadRunner\Broadcast\Broadcast; diff --git a/tests/src/Bootloader/GRPCBootloaderTest.php b/tests/src/Bootloader/GRPCBootloaderTest.php index 6124a4b..194c046 100644 --- a/tests/src/Bootloader/GRPCBootloaderTest.php +++ b/tests/src/Bootloader/GRPCBootloaderTest.php @@ -4,7 +4,6 @@ namespace Spiral\Tests\Bootloader; -use Spiral\Boot\KernelInterface; use Spiral\Core\ConfigsInterface; use Spiral\RoadRunner\GRPC\Invoker; use Spiral\RoadRunner\GRPC\InvokerInterface; @@ -56,10 +55,10 @@ public function testConfigShouldBeDefined() $config = $configurator->getConfig('grpc'); $this->assertSame([ - 'binaryPath' => $this->getDirectoryByAlias('app').'../protoc-gen-php-grpc', + 'binaryPath' => $this->getDirectoryByAlias('app') . '../protoc-gen-php-grpc', 'services' => [ - $this->getDirectoryByAlias('app').'proto/echo.proto', - $this->getDirectoryByAlias('app').'proto/foo.proto', + $this->getDirectoryByAlias('app') . 'proto/echo.proto', + $this->getDirectoryByAlias('app') . 'proto/foo.proto', ], ], $config); } diff --git a/tests/src/Bootloader/QueueBootloaderTest.php b/tests/src/Bootloader/QueueBootloaderTest.php index 8e4ae15..9d15867 100644 --- a/tests/src/Bootloader/QueueBootloaderTest.php +++ b/tests/src/Bootloader/QueueBootloaderTest.php @@ -146,9 +146,9 @@ public function testFormatIsDefined(): void 'connections' => [ 'roadrunner' => [ 'driver' => 'roadrunner', - 'serializerFormat' => 'defined' - ] - ] + 'serializerFormat' => 'defined', + ], + ], ])); $serializer = $this->getContainer()->get(JobsAdapterSerializer::class); diff --git a/tests/src/Console/Command/GRPC/GenerateCommandTest.php b/tests/src/Console/Command/GRPC/GenerateCommandTest.php index 154b05c..45b781e 100644 --- a/tests/src/Console/Command/GRPC/GenerateCommandTest.php +++ b/tests/src/Console/Command/GRPC/GenerateCommandTest.php @@ -19,12 +19,12 @@ public function testGenerateServices() ]; $this->assertStringContainsString( - sprintf('Compiling `%s`:', $this->getDirectoryByAlias('app').'proto/echo.proto'), + sprintf('Compiling `%s`:', $this->getDirectoryByAlias('app') . 'proto/echo.proto'), $result ); foreach ($files as $file) { - $this->assertFileExists($this->getDirectoryByAlias('app').$file); + $this->assertFileExists($this->getDirectoryByAlias('app') . $file); $this->assertStringContainsString( $file, $result @@ -32,7 +32,7 @@ public function testGenerateServices() } $this->assertStringContainsString( - sprintf('Proto file `%s` not found.', $this->getDirectoryByAlias('app').'proto/foo.proto'), + sprintf('Proto file `%s` not found.', $this->getDirectoryByAlias('app') . 'proto/foo.proto'), $result ); } diff --git a/tests/src/ConsoleTestCase.php b/tests/src/ConsoleTestCase.php index 1a7c946..431f055 100644 --- a/tests/src/ConsoleTestCase.php +++ b/tests/src/ConsoleTestCase.php @@ -5,9 +5,6 @@ namespace Spiral\Tests; use Spiral\Files\Files; -use Symfony\Component\Console\Input\ArrayInput; -use Symfony\Component\Console\Output\BufferedOutput; -use Symfony\Component\Console\Output\OutputInterface; abstract class ConsoleTestCase extends TestCase { @@ -17,7 +14,7 @@ public function generateGRPCService(): string $result = $this->runCommand('grpc:generate', [ 'path' => $appPath, - 'namespace' => 'Spiral\\App' + 'namespace' => 'Spiral\\App', ]); $files = [ @@ -27,7 +24,7 @@ public function generateGRPCService(): string ]; foreach ($files as $file) { - require_once $appPath.$file; + require_once $appPath . $file; } return $result; @@ -36,8 +33,8 @@ public function generateGRPCService(): string public function deleteGRPCService(): void { $fs = new Files(); - if ($fs->isDirectory($this->getDirectoryByAlias('app').'GRPC/EchoService')) { - $fs->deleteDirectory($this->getDirectoryByAlias('app').'GRPC/EchoService'); + if ($fs->isDirectory($this->getDirectoryByAlias('app') . 'GRPC/EchoService')) { + $fs->deleteDirectory($this->getDirectoryByAlias('app') . 'GRPC/EchoService'); } } } diff --git a/tests/src/Queue/ConsumerTest.php b/tests/src/Queue/ConsumerTest.php index 5502d03..99c72fe 100644 --- a/tests/src/Queue/ConsumerTest.php +++ b/tests/src/Queue/ConsumerTest.php @@ -19,7 +19,7 @@ public function testGetPayloadWithDefaultSerializer(): void // default json serializer $payload = new Payload(\json_encode([ 'test' => 'test', - 'other' => 'data' + 'other' => 'data', ])); $result = $ref->invoke($consumer, $payload, 'memory'); @@ -36,7 +36,7 @@ public function testGetPayloadWithConfiguredSerializer(): void // php serialize from config $payload = new Payload(\serialize([ 'test' => 'test', - 'other' => 'data' + 'other' => 'data', ])); $result = $ref->invoke($consumer, $payload, 'withSerializer'); diff --git a/tests/src/TestCase.php b/tests/src/TestCase.php index 497c7ab..f1a2a24 100644 --- a/tests/src/TestCase.php +++ b/tests/src/TestCase.php @@ -38,7 +38,7 @@ public function defineBootloaders(): array public function rootDirectory(): string { - return __DIR__.'/../'; + return __DIR__ . '/../'; } protected function tearDown(): void