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 5c5ded7 commit 9d9b998
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 49 deletions.
16 changes: 4 additions & 12 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="3.14.2@3538fe1955d47f6ee926c0769d71af6db08aa488">
<files psalm-version="5.16.0@2897ba636551a8cb61601cc26f6ccfbba6c36591">
<file src="src/Action/EditProfileAction.php">
<InvalidNullableReturnType occurrences="1">
<InvalidNullableReturnType>
<code>Response</code>
</InvalidNullableReturnType>
<NullableReturnStatement occurrences="1">
<code>$event-&gt;getResponse()</code>
</NullableReturnStatement>
</file>
<file src="src/Action/RegistrationAction.php">
<InvalidNullableReturnType occurrences="1">
<code>Response</code>
</InvalidNullableReturnType>
<NullableReturnStatement occurrences="1">
<code>$event-&gt;getResponse()</code>
<NullableReturnStatement>
<code><![CDATA[$event->getResponse()]]></code>
</NullableReturnStatement>
</file>
</files>
4 changes: 1 addition & 3 deletions src/Mailer/NoopRegistrationMailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,5 @@
*/
final class NoopRegistrationMailer implements RegistrationMailer
{
public function sendConfirmationEmailMessage(UserInterface $user): void
{
}
public function sendConfirmationEmailMessage(UserInterface $user): void {}
}
4 changes: 1 addition & 3 deletions src/NucleosProfileBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,4 @@

use Symfony\Component\HttpKernel\Bundle\Bundle;

final class NucleosProfileBundle extends Bundle
{
}
final class NucleosProfileBundle extends Bundle {}
4 changes: 2 additions & 2 deletions tests/Action/RegisterActionIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ final class RegisterActionIntegrationTest extends WebTestCase

protected function setUp(): void
{
$this->client = static::createClient();
$this->client = self::createClient();
}

public function testLogin(): void
{
$this->client->followRedirects(true);
$this->client->request('GET', '/register');

static::assertResponseStatusCodeSame(200);
self::assertResponseStatusCodeSame(200);
}

protected static function getKernelClass(): string
Expand Down
4 changes: 1 addition & 3 deletions tests/App/Entity/TestGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,4 @@

use Nucleos\UserBundle\Model\Group;

class TestGroup extends Group
{
}
class TestGroup extends Group {}
4 changes: 1 addition & 3 deletions tests/App/Entity/TestUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,4 @@
/**
* @phpstan-extends User<\Nucleos\UserBundle\Model\GroupInterface>
*/
class TestUser extends User
{
}
class TestUser extends User {}
8 changes: 4 additions & 4 deletions tests/DependencyInjection/NucleosProfileExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ private function createEmptyConfiguration(): void
$this->configuration = new ContainerBuilder();
$loader = new NucleosProfileExtension();
$loader->load([], $this->configuration);
static::assertTrue($this->configuration->hasAlias('nucleos_profile.mailer'));
self::assertTrue($this->configuration->hasAlias('nucleos_profile.mailer'));
}

private function createFullConfiguration(): void
Expand All @@ -56,7 +56,7 @@ private function createFullConfiguration(): void
$loader = new NucleosProfileExtension();
$config = $this->getFullConfig();
$loader->load([$config], $this->configuration);
static::assertTrue($this->configuration->hasAlias('nucleos_profile.mailer'));
self::assertTrue($this->configuration->hasAlias('nucleos_profile.mailer'));
}

/**
Expand All @@ -79,11 +79,11 @@ private function getFullConfig(): array

private function assertAlias(string $value, string $key): void
{
static::assertSame($value, (string) $this->configuration->getAlias($key), sprintf('%s alias is correct', $key));
self::assertSame($value, (string) $this->configuration->getAlias($key), sprintf('%s alias is correct', $key));
}

private function assertHasDefinition(string $id): void
{
static::assertTrue($this->configuration->hasDefinition($id) ? true : $this->configuration->hasAlias($id));
self::assertTrue($this->configuration->hasDefinition($id) ? true : $this->configuration->hasAlias($id));
}
}
2 changes: 1 addition & 1 deletion tests/EventListener/AuthenticationListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ protected function setUp(): void
$this->event = new FilterUserResponseEvent($user, $request, $response);

$this->eventDispatcher = $this->createMock(EventDispatcherInterface::class);
$this->eventDispatcher->expects(static::once())->method('dispatch');
$this->eventDispatcher->expects(self::once())->method('dispatch');

$loginManager = $this->createMock(LoginManager::class);

Expand Down
8 changes: 4 additions & 4 deletions tests/Form/Type/ProfileFormTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ public function testSubmit(): void
];
$form->submit($formData);

static::assertTrue($form->isSynchronized());
static::assertSame($user, $form->getData());
static::assertSame('Europe/Berlin', $user->getTimezone());
static::assertSame('de_DE', $user->getLocale());
self::assertTrue($form->isSynchronized());
self::assertSame($user, $form->getData());
self::assertSame('Europe/Berlin', $user->getTimezone());
self::assertSame('de_DE', $user->getLocale());
}

/**
Expand Down
10 changes: 5 additions & 5 deletions tests/Form/Type/RegistrationFormTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ public function testSubmit(): void
];
$form->submit($formData);

static::assertTrue($form->isSynchronized());
static::assertSame($user, $form->getData());
static::assertSame('bar', $user->getUsername());
static::assertSame('john@doe.com', $user->getEmail());
static::assertSame('test', $user->getPlainPassword());
self::assertTrue($form->isSynchronized());
self::assertSame($user, $form->getData());
self::assertSame('bar', $user->getUsername());
self::assertSame('john@doe.com', $user->getEmail());
self::assertSame('test', $user->getPlainPassword());
}

/**
Expand Down
8 changes: 4 additions & 4 deletions tests/Resources/XliffTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,21 @@ protected function setUp(): void
}

/**
* @dataProvider getFiles
* @dataProvider provideXliffCases
*/
public function testXliff(string $locale): void
{
$this->validateXliff($locale);

if (\count($this->errors) > 0) {
static::fail(sprintf('Unable to parse xliff files: %s', implode(', ', $this->errors)));
self::fail(sprintf('Unable to parse xliff files: %s', implode(', ', $this->errors)));
}
}

/**
* @return Generator<string[]>
*/
public static function getFiles(): iterable
public static function provideXliffCases(): iterable
{
$files = glob(sprintf('%s/*.xlf', __DIR__.'/../../src/Resources/translations'));

Expand All @@ -67,7 +67,7 @@ private function validateXliff(string $file): void
try {
$catalogue = $this->loader->load($file, $locale);

static::assertGreaterThan(0, $catalogue->getResources());
self::assertGreaterThan(0, $catalogue->getResources());
} catch (InvalidResourceException $e) {
$this->errors[] = sprintf('%s => %s', $locale, $e->getMessage());
}
Expand Down
10 changes: 5 additions & 5 deletions tests/Routing/RoutingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
final class RoutingTest extends TestCase
{
/**
* @dataProvider loadRoutingProvider
* @dataProvider provideLoadRoutingCases
*
* @param string[] $methods
*/
Expand All @@ -37,15 +37,15 @@ public function testLoadRouting(string $routeName, string $path, array $methods)
$collection->addCollection($subCollection);

$route = $collection->get($routeName);
static::assertNotNull($route, sprintf('The route "%s" should exists', $routeName));
static::assertSame($path, $route->getPath());
static::assertSame($methods, $route->getMethods());
self::assertNotNull($route, sprintf('The route "%s" should exists', $routeName));
self::assertSame($path, $route->getPath());
self::assertSame($methods, $route->getMethods());
}

/**
* @return string[][]|string[][][]
*/
public static function loadRoutingProvider(): array
public static function provideLoadRoutingCases(): iterable
{
return [
['nucleos_profile_profile_show', '/profile/', ['GET']],
Expand Down

0 comments on commit 9d9b998

Please sign in to comment.