Skip to content
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

Update tools #103

Merged
merged 3 commits into from
Dec 3, 2023
Merged
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
8 changes: 4 additions & 4 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="4.18.1@dda05fa913f4dc6eb3386f2f7ce5a45d37a71bcb">
<files psalm-version="5.16.0@2897ba636551a8cb61601cc26f6ccfbba6c36591">
<file src="src/DependencyInjection/Compiler/AutoConfigureAdminClassesCompilerPass.php">
<InvalidPropertyAssignmentValue occurrences="2">
<code>$container-&gt;getParameter('sonata.auto_configure.admin.manager_type')</code>
<code>$container-&gt;getParameter('sonata.auto_configure.controller.suffix')</code>
<InvalidPropertyAssignmentValue>
<code><![CDATA[$container->getParameter('sonata.auto_configure.admin.manager_type')]]></code>
<code><![CDATA[$container->getParameter('sonata.auto_configure.controller.suffix')]]></code>
</InvalidPropertyAssignmentValue>
</file>
</files>
4 changes: 1 addition & 3 deletions src/Exception/SonataAutoConfigureExceptionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,4 @@

use Throwable;

interface SonataAutoConfigureExceptionInterface extends Throwable
{
}
interface SonataAutoConfigureExceptionInterface extends Throwable {}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ protected function setUp(): void
}

/**
* @dataProvider processData
* @dataProvider provideProcessCases
*
* @param array<string, mixed> $tagOptions
* @param string[] $methodCalls
Expand Down Expand Up @@ -82,25 +82,25 @@ public function testProcess(

$adminDefinition = $this->containerBuilder->getDefinition($definitionId);

static::assertSame(
self::assertSame(
$tagOptions,
$adminDefinition->getTag('sonata.admin')[0]
);

static::assertSame(
self::assertSame(
$entity,
$adminDefinition->getArgument(1)
);

foreach ($methodCalls as $methodCall) {
static::assertTrue($adminDefinition->hasMethodCall($methodCall));
self::assertTrue($adminDefinition->hasMethodCall($methodCall));
}
}

/**
* @return mixed[]
*/
public function processData(): iterable
public function provideProcessCases(): iterable
{
yield [
CategoryAdmin::class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ protected function setUp(): void
}

/**
* @dataProvider processData
* @dataProvider provideProcessCases
*
* @param string[] $expectedTags
*/
Expand All @@ -56,17 +56,17 @@ public function testProcess(string $extensionServiceId, array $expectedTags = []
$extensionDefinition = $this->containerBuilder->getDefinition($extensionServiceId);

$actualTags = $extensionDefinition->getTag('sonata.admin.extension');
static::assertGreaterThan(0, $actualTags);
self::assertGreaterThan(0, $actualTags);
foreach ($expectedTags as $i => $expectedTag) {
static::assertArrayHasKey($i, $actualTags);
static::assertSame($expectedTag, $actualTags[$i]);
self::assertArrayHasKey($i, $actualTags);
self::assertSame($expectedTag, $actualTags[$i]);
}
}

/**
* @return mixed[]
*/
public function processData(): iterable
public function provideProcessCases(): iterable
{
yield [ExtensionWithoutOptions::class];

Expand Down Expand Up @@ -104,7 +104,7 @@ public function testProcessSkipAutoConfigured(): void

$definition = $this->containerBuilder->getDefinition(TargetedWithPriorityExtension::class);
$tag = $definition->getTag('sonata.admin.extension');
static::assertEmpty(reset($tag));
self::assertEmpty(reset($tag));
}

public function testProcessSkipIfAttributeMissing(): void
Expand All @@ -119,7 +119,7 @@ public function testProcessSkipIfAttributeMissing(): void

$definition = $this->containerBuilder->getDefinition(ExtensionWithoutOptions::class);
$tag = $definition->getTag('sonata.admin.extension');
static::assertEmpty(reset($tag));
self::assertEmpty(reset($tag));
}

/**
Expand Down
4 changes: 1 addition & 3 deletions tests/Fixtures/Admin/AttributedAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,4 @@
'admin.product',
]
)]
class AttributedAdmin extends AbstractAdmin
{
}
class AttributedAdmin extends AbstractAdmin {}
4 changes: 1 addition & 3 deletions tests/Fixtures/Admin/CategoryAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,4 @@
/**
* @extends AbstractAdmin<object>
*/
class CategoryAdmin extends AbstractAdmin
{
}
class CategoryAdmin extends AbstractAdmin {}
4 changes: 1 addition & 3 deletions tests/Fixtures/Admin/DisableAutowireEntityAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,4 @@
* @extends AbstractAdmin<object>
*/
#[Admin(autowireEntity: false, templates: null)]
class DisableAutowireEntityAdmin extends AbstractAdmin
{
}
class DisableAutowireEntityAdmin extends AbstractAdmin {}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,4 @@
* @extends AbstractAdminExtension<object>
*/
#[AdminExtension]
class ExtensionWithoutOptions extends AbstractAdminExtension
{
}
class ExtensionWithoutOptions extends AbstractAdminExtension {}
4 changes: 1 addition & 3 deletions tests/Fixtures/Admin/Extension/GlobalExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,4 @@
* @extends AbstractAdminExtension<object>
*/
#[AdminExtension(global: true)]
class GlobalExtension extends AbstractAdminExtension
{
}
class GlobalExtension extends AbstractAdminExtension {}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,4 @@
#[AdminExtension(
target: ['app.admin.category', 'app.admin.media']
)]
class MultipleTargetedExtension extends AbstractAdminExtension
{
}
class MultipleTargetedExtension extends AbstractAdminExtension {}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,4 @@
* @extends AbstractAdminExtension<object>
*/
#[AdminExtension(priority: 5, target: ['app.admin.category'])]
class TargetedWithPriorityExtension extends AbstractAdminExtension
{
}
class TargetedWithPriorityExtension extends AbstractAdminExtension {}
4 changes: 1 addition & 3 deletions tests/Fixtures/Admin/InvalidAdminClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,4 @@
use Nucleos\SonataAutoConfigureBundle\Attribute\Admin;

#[Admin]
class InvalidAdminClass
{
}
class InvalidAdminClass {}
4 changes: 1 addition & 3 deletions tests/Fixtures/Admin/NoEntityAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,4 @@
/**
* @extends AbstractAdmin<object>
*/
class NoEntityAdmin extends AbstractAdmin
{
}
class NoEntityAdmin extends AbstractAdmin {}
4 changes: 1 addition & 3 deletions tests/Fixtures/Controller/CategoryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,4 @@

namespace Nucleos\SonataAutoConfigureBundle\Tests\Fixtures\Controller;

class CategoryController
{
}
class CategoryController {}
4 changes: 1 addition & 3 deletions tests/Fixtures/Entity/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,4 @@

namespace Nucleos\SonataAutoConfigureBundle\Tests\Fixtures\Entity;

class Category
{
}
class Category {}
2 changes: 1 addition & 1 deletion tests/SonataAutoConfigureBundleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function testCompilerPasses(): void
$containerBuilder = $this->createMock(ContainerBuilder::class);

$containerBuilder
->expects(static::exactly(2))
->expects(self::exactly(2))
->method('addCompilerPass')
->willReturn($containerBuilder)
;
Expand Down
5 changes: 5 additions & 0 deletions vendor-bin/tools/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,10 @@
"phpstan/extension-installer": true
},
"bin-dir": "../../vendor/bin"
},
"extra": {
"symfony": {
"require": "6.4.*"
}
}
}
Loading
Loading