Skip to content

Commit

Permalink
Fix CS
Browse files Browse the repository at this point in the history
  • Loading branch information
core23 committed Dec 3, 2023
1 parent e0a3735 commit 951c26f
Show file tree
Hide file tree
Showing 13 changed files with 32 additions and 44 deletions.
13 changes: 7 additions & 6 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" colors="true" processIsolation="false" stopOnFailure="false" bootstrap="tests/bootstrap.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd" cacheDirectory=".phpunit.cache">
<coverage>
<include>
<directory suffix=".php">./src/</directory>
</include>
</coverage>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" colors="true" processIsolation="false" stopOnFailure="false" bootstrap="tests/bootstrap.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" cacheDirectory=".phpunit.cache">
<coverage/>
<php>
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=0"/>
</php>
Expand All @@ -13,4 +9,9 @@
<directory>./tests/</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory suffix=".php">./src/</directory>
</include>
</source>
</phpunit>
22 changes: 11 additions & 11 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="4.6.0@77feecb3707bd50378c21ae4d3fe9e320e6cea65">
<files psalm-version="5.16.0@2897ba636551a8cb61601cc26f6ccfbba6c36591">
<file src="src/Block/Service/SpaceStatisticBlockService.php">
<ParamNameMismatch occurrences="1">
<ParamNameMismatch>
<code>$formMapper</code>
</ParamNameMismatch>
</file>
<file src="src/Service/AbstractService.php">
<InvalidScalarArgument occurrences="1">
<code>$fault-&gt;getCode()</code>
</InvalidScalarArgument>
</file>
<file src="src/Service/AuthService.php">
<InvalidScalarArgument occurrences="1">
<code>$fault-&gt;getCode()</code>
</InvalidScalarArgument>
<file src="src/DependencyInjection/Configuration.php">
<UndefinedMethod>
<code>addDefaultsIfNotSet</code>
<code>append</code>
<code>append</code>
<code>append</code>
<code>children</code>
<code>fixXmlConfig</code>
</UndefinedMethod>
</file>
</files>
4 changes: 1 addition & 3 deletions src/Block/Service/SpaceStatisticBlockService.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,7 @@ public function configureSettings(OptionsResolver $resolver): void
$resolver->setRequired(['login', 'password']);

Check warning on line 120 in src/Block/Service/SpaceStatisticBlockService.php

View workflow job for this annotation

GitHub Actions / run / Mutation Tests (8.3)

Escaped Mutant for Mutator "ArrayItemRemoval": --- Original +++ New @@ @@ public function configureSettings(OptionsResolver $resolver) : void { $resolver->setDefaults(['title' => null, 'translation_domain' => null, 'icon' => 'fa fa-bar-chart-o', 'class' => null, 'login' => null, 'password' => null, 'template' => '@NucleosAllInkl/Block/block_space_statistic.html.twig']); - $resolver->setRequired(['login', 'password']); + $resolver->setRequired(['password']); } public function validate(ErrorElement $errorElement, BlockInterface $block) : void {

Check warning on line 120 in src/Block/Service/SpaceStatisticBlockService.php

View workflow job for this annotation

GitHub Actions / run / Mutation Tests (8.3)

Escaped Mutant for Mutator "MethodCallRemoval": --- Original +++ New @@ @@ public function configureSettings(OptionsResolver $resolver) : void { $resolver->setDefaults(['title' => null, 'translation_domain' => null, 'icon' => 'fa fa-bar-chart-o', 'class' => null, 'login' => null, 'password' => null, 'template' => '@NucleosAllInkl/Block/block_space_statistic.html.twig']); - $resolver->setRequired(['login', 'password']); + } public function validate(ErrorElement $errorElement, BlockInterface $block) : void {
}

public function validate(ErrorElement $errorElement, BlockInterface $block): void
{
}
public function validate(ErrorElement $errorElement, BlockInterface $block): void {}

public function getMetadata(): MetadataInterface
{
Expand Down
4 changes: 1 addition & 3 deletions src/Exception/AllInklException.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,4 @@

use Exception;

final class AllInklException extends Exception
{
}
final class AllInklException extends Exception {}
1 change: 0 additions & 1 deletion src/Resources/config/block.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,5 @@
->call('setLogger', [
new Reference('logger'),
])

;
};
1 change: 0 additions & 1 deletion src/Resources/config/commands.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,5 @@
new Parameter('nucleos_allinkl.check.accounts'),
new Parameter('nucleos_allinkl.check.warning'),
])

;
};
1 change: 0 additions & 1 deletion src/Resources/config/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,5 @@
->args([
new Parameter('nucleos_allinkl.api.api_endpoint'),
])

;
};
3 changes: 0 additions & 3 deletions src/Service/AbstractService.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ abstract class AbstractService implements LoggerAwareInterface
*/
private $endpoint;

/**
* @param string $endpoint
*/
public function __construct(string $endpoint = null)
{
if (null === $endpoint) {
Expand Down
5 changes: 1 addition & 4 deletions src/Service/AuthService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
14 changes: 7 additions & 7 deletions tests/Block/Service/SpaceStatisticBlockServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,17 @@ 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)
;

$dataResponse = [
['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)
;

Expand All @@ -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',
[
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/BundleIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ public function testStartup(): void

$client->request('GET', '/test');

static::assertSame(200, $client->getResponse()->getStatusCode());
self::assertSame(200, $client->getResponse()->getStatusCode());
}
}
4 changes: 2 additions & 2 deletions tests/DependencyInjection/ConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function testOptions(): void
],
];

static::assertSame($expected, $config);
self::assertSame($expected, $config);
}

public function testCronOptions(): void
Expand Down Expand Up @@ -75,6 +75,6 @@ public function testCronOptions(): void
],
];

static::assertSame($expected, $config);
self::assertSame($expected, $config);
}
}
2 changes: 1 addition & 1 deletion tests/NucleosAllInklBundleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ public function testGetContainerExtension(): void
{
$bundle = new NucleosAllInklBundle();

static::assertInstanceOf(NucleosAllInklExtension::class, $bundle->getContainerExtension());
self::assertInstanceOf(NucleosAllInklExtension::class, $bundle->getContainerExtension());
}
}

0 comments on commit 951c26f

Please sign in to comment.