Skip to content

Commit 1a9bdc8

Browse files
Remove deprecated spaceless filter (#1794)
* Fix cs * Fix tests * Bump * Remove deprecated spaceless * Debug * Avoid format issues
1 parent ec38020 commit 1a9bdc8

File tree

9 files changed

+15
-15
lines changed

9 files changed

+15
-15
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"cocur/slugify": "^4.0",
2626
"doctrine/doctrine-bundle": "^2.7",
2727
"doctrine/persistence": "^3.0.2",
28-
"sonata-project/admin-bundle": "^4.34",
28+
"sonata-project/admin-bundle": "^4.35.3",
2929
"sonata-project/block-bundle": "^4.18 || ^5.0",
3030
"sonata-project/doctrine-extensions": "^1.18 || ^2.1",
3131
"sonata-project/doctrine-orm-admin-bundle": "^4.0",

src/Resources/views/PageAdmin/field_hybrid.html.twig

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,9 @@ file that was distributed with this source code.
1111
{% extends '@SonataAdmin/CRUD/base_list_field.html.twig' %}
1212

1313
{% block field %}
14-
{% apply spaceless %}
1514
{% if object.isHybrid %}
1615
<i class="fa fa-gears"></i>
1716
{% else %}
1817
<i class="fa fa-code"></i>
1918
{% endif %}
20-
{% endapply %}
2119
{% endblock %}

tests/Admin/Extension/CreateSnapshotAdminExtensionTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function testPostRemoveOnBlock(): void
7878
{
7979
$page = $this->createMock(PageInterface::class);
8080
$block = $this->createMock(PageBlockInterface::class);
81-
$admin = $this->createStub(AdminInterface::class);
81+
$admin = static::createStub(AdminInterface::class);
8282
$createSnapshotByPage = $this->createMock(CreateSnapshotByPageInterface::class);
8383

8484
$block->expects(static::once())->method('getPage')->willReturn($page);
@@ -91,7 +91,7 @@ public function testPostRemoveOnBlock(): void
9191
public function testPostRemoveOnPage(): void
9292
{
9393
$page = $this->createMock(PageInterface::class);
94-
$admin = $this->createStub(AdminInterface::class);
94+
$admin = static::createStub(AdminInterface::class);
9595
$createSnapshotByPage = $this->createMock(CreateSnapshotByPageInterface::class);
9696

9797
$createSnapshotByPage->expects(static::never())->method('createByPage');

tests/Admin/PageAdminTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,17 @@ public function testTabMenuHasLinksWithSubSite(): void
3333
{
3434
$request = new Request(['id' => 42]);
3535
$admin = new PageAdmin(
36-
$this->createStub(PageManagerInterface::class),
37-
$this->createStub(SiteManagerInterface::class),
36+
static::createStub(PageManagerInterface::class),
37+
static::createStub(SiteManagerInterface::class),
3838
);
39-
$admin->setModelManager($this->createStub(ModelManagerInterface::class));
39+
$admin->setModelManager(static::createStub(ModelManagerInterface::class));
4040
$admin->setModelClass(Page::class);
4141
$admin->setBaseControllerName(PageController::class);
4242
$admin->setCode('admin.page');
4343
$admin->setMenuFactory(new MenuFactory());
4444
$admin->setRequest($request);
4545

46-
$site = $this->createStub(Site::class);
46+
$site = static::createStub(Site::class);
4747
$site->method('getRelativePath')->willReturn('/my-subsite');
4848

4949
$page = new Page();

tests/App/AppKernel.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
use Symfony\Component\HttpKernel\Kernel;
3636
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
3737
use Symfony\Component\Security\Http\Attribute\IsGranted;
38+
use Symfony\UX\StimulusBundle\StimulusBundle;
3839

3940
final class AppKernel extends Kernel
4041
{
@@ -48,6 +49,7 @@ public function registerBundles(): iterable
4849
new TwigBundle(),
4950
new SecurityBundle(),
5051
new KnpMenuBundle(),
52+
new StimulusBundle(),
5153
new SonataBlockBundle(),
5254
new SonataDoctrineBundle(),
5355
new SonataAdminBundle(),

tests/Block/ContainerBlockServiceTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ public function testFormBuilder(): void
6767

6868
$formBuilder = $this->createMock(FormBuilderInterface::class);
6969
$form = new FormMapper(
70-
$this->createStub(FormContractorInterface::class),
70+
static::createStub(FormContractorInterface::class),
7171
$formBuilder,
72-
$this->createStub(AdminInterface::class)
72+
static::createStub(AdminInterface::class)
7373
);
7474

7575
$formBuilder->expects(static::exactly(2))->method('add');

tests/Entity/PageManagerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function testFixUrl(): void
2525
{
2626
$manager = new PageManager(
2727
Page::class,
28-
$this->createStub(ManagerRegistry::class),
28+
static::createStub(ManagerRegistry::class),
2929
new Slugify()
3030
);
3131

tests/Entity/SnapshotManagerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ final class SnapshotManagerTest extends TestCase
5757

5858
protected function setUp(): void
5959
{
60-
$this->managerRegistry = $this->createStub(ManagerRegistry::class);
60+
$this->managerRegistry = static::createStub(ManagerRegistry::class);
6161
$this->entityManager = $this->createMock(EntityManagerInterface::class);
6262

6363
$this->managerRegistry->method('getManagerForClass')->willReturn($this->entityManager);

tests/Functional/Admin/SnapshotAdminTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ public static function provideFormsUrlsCases(): iterable
9191
'uniqid' => 'snapshot',
9292
], 'btn_update_and_list', [
9393
'snapshot[enabled]' => false,
94-
'snapshot[publicationDateStart]' => 'May 4, 2022, 8:00:00 AM',
95-
'snapshot[publicationDateEnd]' => 'May 4, 2022, 9:00:00 AM',
94+
'snapshot[publicationDateStart]' => '',
95+
'snapshot[publicationDateEnd]' => '',
9696
]];
9797

9898
yield 'Remove Snapshot' => ['/admin/tests/app/sonatapagesnapshot/1/delete', [], 'btn_delete'];

0 commit comments

Comments
 (0)