Skip to content

Commit 62ca42d

Browse files
author
roadiz-ci
committed
Merge branch hotfix/2.7.38
1 parent ef68e91 commit 62ca42d

7 files changed

Lines changed: 103 additions & 13 deletions

File tree

.github/workflows/run-test.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Static analysis and code style
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
- 'release/**'
8+
- 'hotfix/**'
9+
tags: ['**']
10+
pull_request:
11+
types:
12+
- opened
13+
- reopened
14+
- synchronize
15+
- ready_for_review
16+
17+
jobs:
18+
static-analysis-tests:
19+
runs-on: ubuntu-latest
20+
strategy:
21+
matrix:
22+
php-version: ['8.3', '8.4', '8.5']
23+
steps:
24+
- uses: shivammathur/setup-php@v2
25+
with:
26+
php-version: ${{ matrix.php-version }}
27+
- uses: actions/checkout@v3
28+
- name: Cache Composer packages
29+
id: composer-cache
30+
uses: actions/cache@v3
31+
with:
32+
path: vendor
33+
key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}
34+
restore-keys: |
35+
${{ runner.os }}-php-${{ matrix.php-version }}-
36+
- name: Install Dependencies
37+
run: composer install --no-scripts --no-ansi --no-interaction --no-progress
38+
- name: Run PHPStan
39+
run: vendor/bin/phpstan analyse --no-progress -c phpstan.neon

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright © 2026 Ambroise Maupate, Julien Blanchet
3+
Copyright © 2025 Ambroise Maupate, Julien Blanchet
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
66

phpstan.neon

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
parameters:
2+
level: 7
3+
paths:
4+
- src
5+
doctrine:
6+
repositoryClass: RZ\Roadiz\CoreBundle\Repository\EntityRepository
7+
excludePaths:
8+
- */node_modules/*
9+
- */bower_components/*
10+
- */static/*
11+
ignoreErrors:
12+
- identifier: missingType.iterableValue
13+
- identifier: missingType.generics
14+
- '#Call to an undefined method RZ\\Roadiz\\CoreBundle\\Repository#'
15+
- '#Call to an undefined method RZ\\Roadiz\\UserBundle\\Repository#'
16+
- '#Call to an undefined method Doctrine\\Persistence\\ObjectRepository#'
17+
- '#Call to an undefined method Doctrine\\Persistence\\ObjectManager#'
18+
- '#Call to an undefined method Doctrine\\ORM\\EntityRepository#'
19+
- '#Call to an undefined method Symfony\\Component\\Config\\Definition\\Builder\\NodeDefinition::#'
20+
- '#Access to an undefined property Symfony\\Component\\Validator\\Constraint::#'
21+
- '#RZ\\Roadiz\\Core\\Entities\\Tag does not have a field named \$translation#'
22+
- '#does not have a field named \$node\.home#'
23+
- '#does not have a field named \$node\.id#'
24+
- '#does not have a field named \$node\.parent#'
25+
- '#does not have a field named \$translation#'
26+
# PHPStan Doctrine does not support ResolveTargetEntityListener
27+
- '#Property ([a-zA-Z\\\:\$]+) type mapping mismatch: property can contain ([a-zA-Z\\\&\>\<]+)Interface\>?\|null but database expects ([a-zA-Z\\\&\>\<]+)\|null#'
28+
- '#Property ([a-zA-Z\\\:\$]+) type mapping mismatch: property can contain ([a-zA-Z\\\&\>\<]+)Interface\>? but database expects ([a-zA-Z\\\&\>\<]+)#'
29+
- '#type mapping mismatch: database can contain array\|bool\|float\|int\|JsonSerializable\|stdClass\|string\|null but property expects array\|null#'
30+
- '#Doctrine\\ORM\\Mapping\\GeneratedValue constructor expects#'
31+
- '#type mapping mismatch: property can contain Doctrine\\Common\\Collections\\Collection<int, [^\>]+> but database expects Doctrine\\Common\\Collections\\Collection&iterable<[^\>]+>#'
32+
- '#should return Doctrine\\Common\\Collections\\Collection<int, [^\>]+Interface> but returns Doctrine\\Common\\Collections\\Collection<int, [^\>]+>#'
33+
- '#but returns Doctrine\\Common\\Collections\\ReadableCollection<int, [^\>]+>#'
34+
- '#does not accept Doctrine\\Common\\Collections\\ReadableCollection<int, [^\>]+>#'
35+
36+
reportUnmatchedIgnoredErrors: false
37+
includes:
38+
- vendor/phpstan/phpstan-doctrine/extension.neon
39+
- vendor/phpstan/phpstan-doctrine/rules.neon

src/Controller/AbstractSingleNodeTypeController.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,9 @@ protected function getEditRouteName(): string
186186

187187
protected function getShadowContainer(): Node
188188
{
189-
$this->shadowContainer ??= $this->nodeRepository->findOneByNodeName($this->getShadowRootNodeName()) ?? throw new \RuntimeException(sprintf('No shadow root node "%s" found.', $this->getShadowRootNodeName()));
189+
if (null === $this->shadowContainer) {
190+
$this->shadowContainer = $this->nodeRepository->findOneByNodeName($this->getShadowRootNodeName()) ?? throw new \RuntimeException(sprintf('No shadow root node "%s" found.', $this->getShadowRootNodeName()));
191+
}
190192

191193
return $this->shadowContainer;
192194
}

src/Controller/EntityThumbnail/EntityThumbnailController.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ public function __invoke(Request $request): JsonResponse
5656
// Get thumbnail data - provider is responsible for fetching entity
5757
$thumbnail = $this->entityThumbnailProvider->getThumbnail($entityClass, $entityId);
5858

59-
$thumbnail ??= new EntityThumbnail();
59+
if (null === $thumbnail) {
60+
$thumbnail = new EntityThumbnail();
61+
}
6062

6163
$response = new JsonResponse(
6264
$this->serializer->serialize($thumbnail, 'json'),

src/RozierServiceRegistry.php

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,25 +58,31 @@ public function getAdminImage(): ?DocumentInterface
5858

5959
public function getSettingGroups(): array
6060
{
61-
$this->settingGroups ??= $this->managerRegistry->getRepository(SettingGroup::class)
62-
->findBy(
63-
['inMenu' => true],
64-
['name' => 'ASC']
65-
);
61+
if (null === $this->settingGroups) {
62+
$this->settingGroups = $this->managerRegistry->getRepository(SettingGroup::class)
63+
->findBy(
64+
['inMenu' => true],
65+
['name' => 'ASC']
66+
);
67+
}
6668

6769
return $this->settingGroups;
6870
}
6971

7072
public function getTagTree(): TagTreeWidget
7173
{
72-
$this->tagTree ??= $this->treeWidgetFactory->createTagTree();
74+
if (null === $this->tagTree) {
75+
$this->tagTree = $this->treeWidgetFactory->createTagTree();
76+
}
7377

7478
return $this->tagTree;
7579
}
7680

7781
public function getFolderTree(): FolderTreeWidget
7882
{
79-
$this->folderTree ??= $this->treeWidgetFactory->createFolderTree();
83+
if (null === $this->folderTree) {
84+
$this->folderTree = $this->treeWidgetFactory->createFolderTree();
85+
}
8086

8187
return $this->folderTree;
8288
}

src/Widget/FolderTreeWidget.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,11 @@ public function getRootFolder(): ?Folder
4242
*/
4343
public function getFolders(): iterable
4444
{
45-
$this->folders ??= $this->getManagerRegistry()
46-
->getRepository(Folder::class)
47-
->findByParentAndTranslation($this->getRootFolder(), $this->getTranslation());
45+
if (null === $this->folders) {
46+
$this->folders = $this->getManagerRegistry()
47+
->getRepository(Folder::class)
48+
->findByParentAndTranslation($this->getRootFolder(), $this->getTranslation());
49+
}
4850

4951
return $this->folders;
5052
}

0 commit comments

Comments
 (0)