From 951c26fd1b99d634d2a1bc6cb2122979929acc0a Mon Sep 17 00:00:00 2001 From: core23 Date: Sun, 3 Dec 2023 15:20:58 +0100 Subject: [PATCH] Fix CS --- phpunit.xml.dist | 13 ++++++----- psalm-baseline.xml | 22 +++++++++---------- .../Service/SpaceStatisticBlockService.php | 4 +--- src/Exception/AllInklException.php | 4 +--- src/Resources/config/block.php | 1 - src/Resources/config/commands.php | 1 - src/Resources/config/services.php | 1 - src/Service/AbstractService.php | 3 --- src/Service/AuthService.php | 5 +---- .../SpaceStatisticBlockServiceTest.php | 14 ++++++------ tests/BundleIntegrationTest.php | 2 +- .../DependencyInjection/ConfigurationTest.php | 4 ++-- tests/NucleosAllInklBundleTest.php | 2 +- 13 files changed, 32 insertions(+), 44 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 12b7a2f..a5db219 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,10 +1,6 @@ - - - - ./src/ - - + + @@ -13,4 +9,9 @@ ./tests/ + + + ./src/ + + diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 174310a..b6ecfe8 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,18 +1,18 @@ - + - + $formMapper - - - $fault->getCode() - - - - - $fault->getCode() - + + + addDefaultsIfNotSet + append + append + append + children + fixXmlConfig + diff --git a/src/Block/Service/SpaceStatisticBlockService.php b/src/Block/Service/SpaceStatisticBlockService.php index c98cc9c..54f0d71 100644 --- a/src/Block/Service/SpaceStatisticBlockService.php +++ b/src/Block/Service/SpaceStatisticBlockService.php @@ -120,9 +120,7 @@ public function configureSettings(OptionsResolver $resolver): void $resolver->setRequired(['login', 'password']); } - public function validate(ErrorElement $errorElement, BlockInterface $block): void - { - } + public function validate(ErrorElement $errorElement, BlockInterface $block): void {} public function getMetadata(): MetadataInterface { diff --git a/src/Exception/AllInklException.php b/src/Exception/AllInklException.php index 9cb1829..0afcb81 100644 --- a/src/Exception/AllInklException.php +++ b/src/Exception/AllInklException.php @@ -13,6 +13,4 @@ use Exception; -final class AllInklException extends Exception -{ -} +final class AllInklException extends Exception {} diff --git a/src/Resources/config/block.php b/src/Resources/config/block.php index c48d586..6387aac 100644 --- a/src/Resources/config/block.php +++ b/src/Resources/config/block.php @@ -25,6 +25,5 @@ ->call('setLogger', [ new Reference('logger'), ]) - ; }; diff --git a/src/Resources/config/commands.php b/src/Resources/config/commands.php index 469f456..b2a4392 100644 --- a/src/Resources/config/commands.php +++ b/src/Resources/config/commands.php @@ -28,6 +28,5 @@ new Parameter('nucleos_allinkl.check.accounts'), new Parameter('nucleos_allinkl.check.warning'), ]) - ; }; diff --git a/src/Resources/config/services.php b/src/Resources/config/services.php index 897462f..e0ac5bb 100644 --- a/src/Resources/config/services.php +++ b/src/Resources/config/services.php @@ -43,6 +43,5 @@ ->args([ new Parameter('nucleos_allinkl.api.api_endpoint'), ]) - ; }; diff --git a/src/Service/AbstractService.php b/src/Service/AbstractService.php index 62a8be2..38857ba 100644 --- a/src/Service/AbstractService.php +++ b/src/Service/AbstractService.php @@ -34,9 +34,6 @@ abstract class AbstractService implements LoggerAwareInterface */ private $endpoint; - /** - * @param string $endpoint - */ public function __construct(string $endpoint = null) { if (null === $endpoint) { diff --git a/src/Service/AuthService.php b/src/Service/AuthService.php index ec443c2..42a8900 100644 --- a/src/Service/AuthService.php +++ b/src/Service/AuthService.php @@ -23,13 +23,10 @@ final class AuthService extends AbstractService implements AuthServiceInterface */ private const DEFAULT_AUTH_ENDPOINT = 'https://kasapi.kasserver.com/soap/wsdl/KasAuth.wsdl'; - /** - * @param string $endpoint - */ public function __construct(string $endpoint = null) { if (null === $endpoint) { - $endpoint = static::DEFAULT_AUTH_ENDPOINT; + $endpoint = self::DEFAULT_AUTH_ENDPOINT; } parent::__construct($endpoint); diff --git a/tests/Block/Service/SpaceStatisticBlockServiceTest.php b/tests/Block/Service/SpaceStatisticBlockServiceTest.php index 6a3cf7b..09d6f00 100644 --- a/tests/Block/Service/SpaceStatisticBlockServiceTest.php +++ b/tests/Block/Service/SpaceStatisticBlockServiceTest.php @@ -52,8 +52,8 @@ public function testExecute(): void { $session = new Session('foo', 'token'); - $this->authService->expects(static::once())->method('createSession') - ->with(static::equalTo('foologin'), static::equalTo('barpw')) + $this->authService->expects(self::once())->method('createSession') + ->with(self::equalTo('foologin'), self::equalTo('barpw')) ->willReturn($session) ; @@ -61,8 +61,8 @@ public function testExecute(): void ['foo' => 'bar'], ]; - $this->statisticService->expects(static::once())->method('getSpace') - ->with(static::equalTo($session), true, true) + $this->statisticService->expects(self::once())->method('getSpace') + ->with(self::equalTo($session), true, true) ->willReturn($dataResponse) ; @@ -77,7 +77,7 @@ public function testExecute(): void $response = new Response(); - $this->twig->expects(static::once())->method('render') + $this->twig->expects(self::once())->method('render') ->with( '@NucleosAllInkl/Block/block_space_statistic.html.twig', [ @@ -96,8 +96,8 @@ public function testExecute(): void $this->statisticService ); - static::assertSame($response, $blockService->execute($blockContext, $response)); - static::assertSame('TWIG_CONTENT', $response->getContent()); + self::assertSame($response, $blockService->execute($blockContext, $response)); + self::assertSame('TWIG_CONTENT', $response->getContent()); } public function testDefaultSettings(): void diff --git a/tests/BundleIntegrationTest.php b/tests/BundleIntegrationTest.php index d87a3a3..4559b67 100644 --- a/tests/BundleIntegrationTest.php +++ b/tests/BundleIntegrationTest.php @@ -23,6 +23,6 @@ public function testStartup(): void $client->request('GET', '/test'); - static::assertSame(200, $client->getResponse()->getStatusCode()); + self::assertSame(200, $client->getResponse()->getStatusCode()); } } diff --git a/tests/DependencyInjection/ConfigurationTest.php b/tests/DependencyInjection/ConfigurationTest.php index a614f79..ad815d2 100644 --- a/tests/DependencyInjection/ConfigurationTest.php +++ b/tests/DependencyInjection/ConfigurationTest.php @@ -34,7 +34,7 @@ public function testOptions(): void ], ]; - static::assertSame($expected, $config); + self::assertSame($expected, $config); } public function testCronOptions(): void @@ -75,6 +75,6 @@ public function testCronOptions(): void ], ]; - static::assertSame($expected, $config); + self::assertSame($expected, $config); } } diff --git a/tests/NucleosAllInklBundleTest.php b/tests/NucleosAllInklBundleTest.php index 6c70d1f..254864d 100644 --- a/tests/NucleosAllInklBundleTest.php +++ b/tests/NucleosAllInklBundleTest.php @@ -21,6 +21,6 @@ public function testGetContainerExtension(): void { $bundle = new NucleosAllInklBundle(); - static::assertInstanceOf(NucleosAllInklExtension::class, $bundle->getContainerExtension()); + self::assertInstanceOf(NucleosAllInklExtension::class, $bundle->getContainerExtension()); } }