Skip to content

Leverage symfony-tools/fabbot #1720

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 1.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/fabbot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: CS

on:
pull_request:

permissions:
contents: read

jobs:
call-fabbot:
name: Fabbot
uses: symfony-tools/fabbot/.github/workflows/fabbot.yml@main
with:
package: MakerBundle
2 changes: 1 addition & 1 deletion src/Maker/MakeMigration.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public function generate(InputInterface $input, ConsoleStyle $io, Generator $gen
try {
$returnCode = $generateMigrationCommand->run($generateMigrationCommandInput, $commandOutput);

// non-zero code would ideally mean the internal command has already printed an errror
// non-zero code would ideally mean the internal command has already printed an error
// this happens if you "decline" generating a migration when you already
// have some available
if (0 !== $returnCode) {
Expand Down
4 changes: 2 additions & 2 deletions tests/Command/MakerCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

class MakerCommandTest extends TestCase
{
public function testExceptionOnMissingDependencies(): void
public function testExceptionOnMissingDependencies()

Check failure on line 26 in tests/Command/MakerCommandTest.php

View workflow job for this annotation

GitHub Actions / PHPStan

Method Symfony\Bundle\MakerBundle\Tests\Command\MakerCommandTest::testExceptionOnMissingDependencies() has no return type specified.
{
$this->expectException(RuntimeCommandException::class);
if (method_exists($this, 'expectExceptionMessageMatches')) {
Expand All @@ -47,7 +47,7 @@
$tester->execute([]);
}

public function testExceptionOnUnknownRootNamespace(): void
public function testExceptionOnUnknownRootNamespace()

Check failure on line 50 in tests/Command/MakerCommandTest.php

View workflow job for this annotation

GitHub Actions / PHPStan

Method Symfony\Bundle\MakerBundle\Tests\Command\MakerCommandTest::testExceptionOnUnknownRootNamespace() has no return type specified.
{
$maker = $this->createMock(MakerInterface::class);

Expand Down
8 changes: 4 additions & 4 deletions tests/Docker/DatabaseServicesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/
final class DatabaseServicesTest extends TestCase
{
public function testExceptionThrownWithInvalidDatabaseProvided(): void
public function testExceptionThrownWithInvalidDatabaseProvided()

Check failure on line 23 in tests/Docker/DatabaseServicesTest.php

View workflow job for this annotation

GitHub Actions / PHPStan

Method Symfony\Bundle\MakerBundle\Tests\Docker\DatabaseServicesTest::testExceptionThrownWithInvalidDatabaseProvided() has no return type specified.
{
$this->expectException(RuntimeCommandException::class);
$this->expectExceptionMessage('foo is not a valid / supported docker database type.');
Expand All @@ -38,7 +38,7 @@
/**
* @dataProvider mixedNameDataProvider
*/
public function testSkeletonReturnArrayForDesiredDatabase(string $databaseName): void
public function testSkeletonReturnArrayForDesiredDatabase(string $databaseName)

Check failure on line 41 in tests/Docker/DatabaseServicesTest.php

View workflow job for this annotation

GitHub Actions / PHPStan

Method Symfony\Bundle\MakerBundle\Tests\Docker\DatabaseServicesTest::testSkeletonReturnArrayForDesiredDatabase() has no return type specified.
{
$result = DockerDatabaseServices::getDatabaseSkeleton($databaseName, 'latest');

Expand All @@ -49,7 +49,7 @@
/**
* @dataProvider mixedNameDataProvider
*/
public function testGetDefaultPorts(string $databaseName): void
public function testGetDefaultPorts(string $databaseName)

Check failure on line 52 in tests/Docker/DatabaseServicesTest.php

View workflow job for this annotation

GitHub Actions / PHPStan

Method Symfony\Bundle\MakerBundle\Tests\Docker\DatabaseServicesTest::testGetDefaultPorts() has no return type specified.
{
$result = DockerDatabaseServices::getDefaultPorts($databaseName);

Expand All @@ -59,7 +59,7 @@
/**
* @dataProvider mixedNameDataProvider
*/
public function testSuggestedVersion(string $databaseName): void
public function testSuggestedVersion(string $databaseName)

Check failure on line 62 in tests/Docker/DatabaseServicesTest.php

View workflow job for this annotation

GitHub Actions / PHPStan

Method Symfony\Bundle\MakerBundle\Tests\Docker\DatabaseServicesTest::testSuggestedVersion() has no return type specified.
{
$result = DockerDatabaseServices::getSuggestedServiceVersion($databaseName);

Expand Down
2 changes: 1 addition & 1 deletion tests/Doctrine/EntityRegeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class EntityRegeneratorTest extends TestCase
/**
* @dataProvider getRegenerateEntitiesTests
*/
public function testRegenerateEntities(string $expectedDirName, bool $overwrite): void
public function testRegenerateEntities(string $expectedDirName, bool $overwrite)
{
$kernel = new TestEntityRegeneratorKernel('dev', true);
$this->doTestRegeneration(
Expand Down
2 changes: 1 addition & 1 deletion tests/FileManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public function getPathForTemplateTests()
];
}

public function testWithMakerFileLinkFormatter(): void
public function testWithMakerFileLinkFormatter()
{
if (getenv('MAKER_DISABLE_FILE_LINKS')) {
$this->markTestSkipped();
Expand Down
2 changes: 1 addition & 1 deletion tests/GeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class GeneratorTest extends TestCase
/**
* @dataProvider getClassNameDetailsTests
*/
public function testCreateClassNameDetails(string $name, string $prefix, string $suffix, string $expectedFullClassName, string $expectedRelativeClassName): void
public function testCreateClassNameDetails(string $name, string $prefix, string $suffix, string $expectedFullClassName, string $expectedRelativeClassName)
{
$fileManager = $this->createMock(FileManager::class);
$fileManager->expects($this->any())
Expand Down
2 changes: 1 addition & 1 deletion tests/Maker/FunctionalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* Smoke test to make sure the DI autowiring works and all makers
* are registered and have the correct arguments.
*/
public function testWiring(): void
public function testWiring()

Check failure on line 27 in tests/Maker/FunctionalTest.php

View workflow job for this annotation

GitHub Actions / PHPStan

Method Symfony\Bundle\MakerBundle\Tests\Maker\FunctionalTest::testWiring() has no return type specified.
{
$kernel = new MakerTestKernel('dev', true);

Expand Down
4 changes: 2 additions & 2 deletions tests/RegexTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
class RegexTest extends TestCase
{
/** @dataProvider generatedFilesRegexDataProvider */
public function testMakerTestEnvironmentGeneratedFilesRegex(string $subjectData, array $expectedResult): void
public function testMakerTestEnvironmentGeneratedFilesRegex(string $subjectData, array $expectedResult)
{
$result = [];

Expand Down Expand Up @@ -69,7 +69,7 @@ private function generatedFilesRegexDataProvider(): \Generator
}

/** @dataProvider webhookNameRegexDataProvider */
public function testWebhookNameRegex(string $subjectData, bool $expectedResult): void
public function testWebhookNameRegex(string $subjectData, bool $expectedResult)
{
$result = preg_match(MakeWebhook::WEBHOOK_NAME_PATTERN, $subjectData);

Expand Down
2 changes: 1 addition & 1 deletion tests/Security/InteractiveSecurityHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ public function guessEmailFieldTest()
}

/** @dataProvider authenticatorClassProvider */
public function testGetAuthenticatorsFromConfig(array $firewalls, array $expectedResults): void
public function testGetAuthenticatorsFromConfig(array $firewalls, array $expectedResults)
{
$helper = new InteractiveSecurityHelper();
$result = $helper->getAuthenticatorsFromConfig($firewalls);
Expand Down
10 changes: 5 additions & 5 deletions tests/Security/SecurityConfigUpdaterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class SecurityConfigUpdaterTest extends TestCase
/**
* @dataProvider getUserClassTests
*/
public function testUpdateForUserClass(UserClassConfiguration $userConfig, string $expectedSourceFilename, string $startingSourceFilename = 'simple_security.yaml'): void
public function testUpdateForUserClass(UserClassConfiguration $userConfig, string $expectedSourceFilename, string $startingSourceFilename = 'simple_security.yaml')
{
$this->createLogger();

Expand Down Expand Up @@ -104,7 +104,7 @@ public function getUserClassTests(): \Generator
/**
* @dataProvider getAuthenticatorTests
*/
public function testUpdateForAuthenticator(string $firewallName, $entryPoint, string $expectedSourceFilename, string $startingSourceFilename, bool $logoutSetup, bool $supportRememberMe, bool $alwaysRememberMe): void
public function testUpdateForAuthenticator(string $firewallName, $entryPoint, string $expectedSourceFilename, string $startingSourceFilename, bool $logoutSetup, bool $supportRememberMe, bool $alwaysRememberMe)
{
$this->createLogger();

Expand Down Expand Up @@ -199,7 +199,7 @@ public function getAuthenticatorTests(): \Generator
];
}

public function testUpdateForFormLogin(): void
public function testUpdateForFormLogin()
{
$this->createLogger();

Expand All @@ -214,7 +214,7 @@ public function testUpdateForFormLogin(): void
);
}

public function testUpdateForJsonLogin(): void
public function testUpdateForJsonLogin()
{
$this->createLogger();

Expand All @@ -229,7 +229,7 @@ public function testUpdateForJsonLogin(): void
);
}

public function testUpdateForLogout(): void
public function testUpdateForLogout()
{
$this->createLogger();

Expand Down
6 changes: 3 additions & 3 deletions tests/Security/SecurityControllerBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,23 @@ class SecurityControllerBuilderTest extends TestCase
{
private string $expectedBasePath = __DIR__.'/fixtures/expected';

public function testLoginMethod(): void
public function testLoginMethod()
{
$this->runMethodTest(
'addLoginMethod',
\sprintf('%s/%s', $this->expectedBasePath, 'SecurityController_login.php')
);
}

public function testLogoutMethod(): void
public function testLogoutMethod()
{
$this->runMethodTest(
'addLogoutMethod',
\sprintf('%s/%s', $this->expectedBasePath, 'SecurityController_logout.php')
);
}

public function testLoginAndLogoutMethod(): void
public function testLoginAndLogoutMethod()
{
$builder = new SecurityControllerBuilder();
$csm = $this->getClassSourceManipulator();
Expand Down
2 changes: 1 addition & 1 deletion tests/Security/UserClassBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class UserClassBuilderTest extends TestCase
/**
* @dataProvider getUserInterfaceTests
*/
public function testAddUserInterfaceImplementation(UserClassConfiguration $userClassConfig, string $expectedFilename): void
public function testAddUserInterfaceImplementation(UserClassConfiguration $userClassConfig, string $expectedFilename)
{
$manipulator = $this->getClassSourceManipulator($userClassConfig);

Expand Down
6 changes: 3 additions & 3 deletions tests/Test/MakerTestDetailsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

class MakerTestDetailsTest extends TestCase
{
public function testAddExtraDependencies(): void
public function testAddExtraDependencies()
{
$details = new MakerTestDetails($this->createMock(MakerInterface::class));

Expand All @@ -38,7 +38,7 @@ public function testAddExtraDependencies(): void
self::assertSame(['twig', 'ux', 'mercure'], $details->getExtraDependencies());
}

public function testAddRequiredPackageVersions(): void
public function testAddRequiredPackageVersions()
{
$details = new MakerTestDetails($this->createMock(MakerInterface::class));

Expand All @@ -53,7 +53,7 @@ public function testAddRequiredPackageVersions(): void
], $details->getRequiredPackageVersions());
}

public function testGetDependencies(): void
public function testGetDependencies()
{
$details = new MakerTestDetails(new TestMakerFixture());

Expand Down
2 changes: 1 addition & 1 deletion tests/Util/ClassDetailsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/
final class ClassDetailsTest extends TestCase
{
public function testHasAttribute(): void
public function testHasAttribute()
{
self::assertTrue((new ClassDetails(FixtureClassDetails::class))->hasAttribute(UniqueEntity::class));

Expand Down
20 changes: 10 additions & 10 deletions tests/Util/ClassSource/ClassDataTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

class ClassDataTest extends TestCase
{
public function testStaticConstructor(): void
public function testStaticConstructor()
{
$meta = ClassData::create(MakerBundle::class);

Expand All @@ -30,14 +30,14 @@ public function testStaticConstructor(): void
self::assertSame('App\Symfony\Bundle\MakerBundle\MakerBundle', $meta->getFullClassName());
}

public function testGetClassDeclaration(): void
public function testGetClassDeclaration()
{
$meta = ClassData::create(MakerBundle::class);

self::assertSame('final class MakerBundle', $meta->getClassDeclaration());
}

public function testIsFinal(): void
public function testIsFinal()
{
$meta = ClassData::create(MakerBundle::class);

Expand All @@ -49,15 +49,15 @@ public function testIsFinal(): void
self::assertSame('class MakerBundle', $meta->getClassDeclaration());
}

public function testGetClassDeclarationWithExtends(): void
public function testGetClassDeclarationWithExtends()
{
$meta = ClassData::create(class: MakerBundle::class, extendsClass: MakerTestKernel::class);

self::assertSame('final class MakerBundle extends MakerTestKernel', $meta->getClassDeclaration());
}

/** @dataProvider suffixDataProvider */
public function testSuffix(?string $suffix, string $expectedResult): void
public function testSuffix(?string $suffix, string $expectedResult)
{
$data = ClassData::create(class: MakerBundle::class, suffix: $suffix);

Expand All @@ -72,7 +72,7 @@ public function suffixDataProvider(): \Generator
}

/** @dataProvider namespaceDataProvider */
public function testNamespace(string $class, ?string $rootNamespace, string $expectedNamespace, string $expectedFullClassName): void
public function testNamespace(string $class, ?string $rootNamespace, string $expectedNamespace, string $expectedFullClassName)
{
$class = ClassData::create($class);

Expand All @@ -92,7 +92,7 @@ public function namespaceDataProvider(): \Generator
yield ['Controller\MyController', 'Maker', 'Maker\Controller', 'Maker\Controller\MyController'];
}

public function testGetClassName(): void
public function testGetClassName()
{
$class = ClassData::create(class: 'Controller\\Foo', suffix: 'Controller');
self::assertSame('FooController', $class->getClassName());
Expand All @@ -102,7 +102,7 @@ public function testGetClassName(): void
self::assertSame('App\Controller\FooController', $class->getFullClassName());
}

public function testGetClassNameRelativeNamespace(): void
public function testGetClassNameRelativeNamespace()
{
$class = ClassData::create(class: 'Controller\\Admin\\Foo', suffix: 'Controller');
self::assertSame('FooController', $class->getClassName());
Expand All @@ -112,7 +112,7 @@ public function testGetClassNameRelativeNamespace(): void
self::assertSame('App\Controller\Admin\FooController', $class->getFullClassName());
}

public function testGetClassNameWithAbsoluteNamespace(): void
public function testGetClassNameWithAbsoluteNamespace()
{
$class = ClassData::create(class: '\\Foo\\Bar\\Admin\\Baz', suffix: 'Controller');
self::assertSame('BazController', $class->getClassName());
Expand All @@ -121,7 +121,7 @@ public function testGetClassNameWithAbsoluteNamespace(): void
}

/** @dataProvider fullClassNameProvider */
public function testGetFullClassName(string $class, ?string $rootNamespace, bool $withoutRootNamespace, bool $withoutSuffix, string $expectedFullClassName): void
public function testGetFullClassName(string $class, ?string $rootNamespace, bool $withoutRootNamespace, bool $withoutSuffix, string $expectedFullClassName)
{
$class = ClassData::create($class, suffix: 'Controller');

Expand Down
Loading
Loading