Skip to content

Commit 7706414

Browse files
authored
Merge pull request #14 from pimcore/11.1-from-7113486479
Automated PR
2 parents db09d25 + 92770c3 commit 7706414

File tree

27 files changed

+100
-83
lines changed

27 files changed

+100
-83
lines changed

bundles/CoreBundle/src/Command/ClassesDefinitionsBuildCommand.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
namespace Pimcore\Bundle\CoreBundle\Command;
1818

19+
use Pimcore\Cache;
1920
use Pimcore\Console\AbstractCommand;
2021
use Pimcore\DataObject\ClassBuilder\PHPClassDumperInterface;
2122
use Pimcore\DataObject\ClassBuilder\PHPFieldCollectionClassDumperInterface;
@@ -49,15 +50,13 @@ public function __construct(
4950

5051
protected function execute(InputInterface $input, OutputInterface $output): int
5152
{
52-
$cacheStatus = \Pimcore\Cache::isEnabled();
53-
\Pimcore\Cache::disable();
53+
$cacheStatus = Cache::isEnabled();
54+
Cache::disable();
5455
$objectClassesFolders = array_unique([PIMCORE_CLASS_DEFINITION_DIRECTORY, PIMCORE_CUSTOM_CONFIGURATION_CLASS_DEFINITION_DIRECTORY]);
5556

5657
foreach ($objectClassesFolders as $objectClassesFolder) {
5758
$files = glob($objectClassesFolder.'/*.php');
5859

59-
$changes = [];
60-
6160
foreach ($files as $file) {
6261
$class = include $file;
6362

@@ -84,7 +83,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
8483
}
8584

8685
if ($cacheStatus) {
87-
\Pimcore\Cache::enable();
86+
Cache::enable();
8887
}
8988

9089
return 0;

bundles/CoreBundle/src/DependencyInjection/Compiler/WorkflowPass.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ public function process(ContainerBuilder $container): void
181181
if (isset($markingStoreDefinition)) {
182182
$workflowDefinition->replaceArgument(1, $markingStoreDefinition);
183183
}
184+
$workflowDefinition->setPublic(true);
184185
$workflowDefinition->replaceArgument(3, $workflowName);
185186
$workflowDefinition->replaceArgument(4, $workflowConfig['events_to_dispatch'] ?? null);
186187

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,8 @@
137137
"require-dev": {
138138
"codeception/codeception": "^5.0.3",
139139
"codeception/module-symfony": "^3.1.0",
140-
"codeception/phpunit-wrapper": "^9",
141140
"ergebnis/phpstan-rules": "^2.0",
142-
"phpstan/phpstan": "1.10.43",
141+
"phpstan/phpstan": "1.10.46",
143142
"phpstan/phpstan-symfony": "^1.3.5",
144143
"phpunit/phpunit": "^9.3",
145144
"gotenberg/gotenberg-php": "^1.1",

doc/01_Getting_Started/00_Installation/00_Docker_Based_Installation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ If you choose to install backend search (which is installed by default), you mus
4343
:::
4444

4545
5. :heavy_check_mark: DONE - You can now visit your pimcore instance:
46-
* The frontend: <http://localhost>
46+
* The frontend: [localhost](http://localhost)
4747
* The admin interface, using the credentials you have chosen above:
48-
<http://localhost/admin>
48+
[Admin interface](http://localhost/admin)
4949

5050

5151
## Caching

doc/02_MVC/04_Routing_and_URLs/02_Custom_Routes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ to do so just embrace the part with curly brackets { } (see example below).
113113

114114
| Name | Pattern | Reverse | Controller | Variables | Defaults | Site IDs | Priority | Methods |
115115
|----------|------------------------|------------------|-----------------------------------------------|-----------|--------------|----------|--------------|-------------|
116-
| news category | /\\/news-category\\/([^_]+)_([0-9]+)(_category_)?([0-9]+)?/ | /news-category/%text_%id{_category_%categoryId} | App\Controller\NewsController::listingAction | text,id,text2,categoryId | | | 1 | |
116+
| news category | /\\/news-category\\/([^_]+)_([0-9]+)(_category_)?([0-9]+)?/ | /news-category/%text_%id\{_category_%categoryId\} | App\Controller\NewsController::listingAction | text,id,text2,categoryId | | | 1 | |
117117

118118
![Grid with the new route](../../img/Routing_grid2.png)
119119

doc/03_Documents/01_Editables/02_Areablock/02_Bricks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ as registered on the areabrick manager (see below).
9292
| Location | Path |
9393
|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
9494
| global | `templates/areas/<brickId>/` |
95-
| bundle | `<bundlePath>/Resources/views/areas/<brickId>/` for legacy (Symfony <= 4) bundle structure<br/>or<br/>`<bundlePath>/templates/areas/<brickId>/` for modern (Symfony >= 5) bundle structure |
95+
| bundle | `<bundlePath>/Resources/views/areas/<brickId>/` for legacy (Symfony \<= 4) bundle structure<br/>or<br/>`<bundlePath>/templates/areas/<brickId>/` for modern (Symfony >= 5) bundle structure |
9696

9797
Depending on the template location, the following files will be used. You can always completely control locations by
9898
implementing the methods for templates and icon yourself (see `AreabrickInterface`):

doc/03_Documents/01_Editables/02_Areablock/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ And you can see the effect, below:
7070
| `manual` | bool | Forces the manual mode, which enables a complete free implementation for areablocks, for example using real `<table>` elements... example see below |
7171
| `reload` | bool | Set to `true`, to force a reload in editmode after reordering items (default: `false`) |
7272
| `limit` | int | Limit the amount of elements |
73-
| `limits` | array | An array of area-ID's with count to limit the amount of certain elements e.g. {"iframe": 1, "teasers": 2} |
73+
| `limits` | array | An array of area-ID's with count to limit the amount of certain elements e.g. \{"iframe": 1, "teasers": 2\} |
7474
| `areablock_toolbar` | array | Array with option that allows you to configure the toolbar. Possible options are `width`, `buttonWidth` and `buttonMaxCharacters` |
7575
| `controlsAlign` | string | The position of the control button bar. Options are: `top`, `right` and `left`. |
7676
| `controlsTrigger` | string | Options are: `hover`(default) and `fixed` . |

doc/03_Documents/01_Editables/40_WYSIWYG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,5 @@ framework:
5454
```
5555
If you want to adapt this configuration please have a look at the [symfony documentation](https://symfony.com/doc/current/html_sanitizer.html). Add your custom configuration to you project, e.g. to `config/packages/html_sanitizer.yaml`
5656

57-
> Note: When using API to set WYSIWYG data, please pass encoded characters for html entities e.g. <,>, & etc.
58-
> The data is encoded by the sanitizer before persisting into db and the same encoded data will be returned by the API.
57+
> Note: When using API to set WYSIWYG data, please pass encoded characters for html entities e.g. `<`,`>`, `&` etc.
58+
> The data is encoded by the sanitizer before persisting into db and the same encoded data will be returned by the API.

doc/19_Development_Tools_and_Details/07_Logging.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ pimcore:
4444
| 2 | User-ID |
4545
| Pimcore\Bundle\AdminBundle\Controller\Admin\Document\PageController::saveAction | Module\Controller::Action |
4646
| pimcore_admin_document_page_save | Route name |
47-
| {"task":"pub .... | Request Parameters (shortened & censored) |
47+
| \{"task":"pub .... \} | Request Parameters (shortened & censored) |
4848
4949
## redirect.log
5050
Sometimes it's necessary to debug redirects, for example when a redirect ends in an infinite loop.

doc/19_Development_Tools_and_Details/40_Custom_Admin_Login_Entry_Point.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pimcore_admin:
99
```
1010
> Please note:
1111
> custom_admin_path_identifier should be at least 20 characters long
12-
> and must not start with `/admin` if Pimcore version <= 6.0.5 !
12+
> and must not start with `/admin` if Pimcore version \<= 6.0.5 !
1313

1414
Add custom entry for `PimcoreCoreBundle:PublicServices:customAdminEntryPoint` in your routing.yaml:
1515
```yaml

doc/20_Extending_Pimcore/17_Custom_Persistent_Models.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Pimcore provides 2 possible ways of working with custom entities namely Doctrine
1212

1313
## Option 1: Use Doctrine ORM
1414
Pimcore comes already with the Doctrine bundle, so you can easily create your own entities.
15-
Please check <https://symfony.com/doc/current/doctrine.html> for more details.
15+
Please check [https://symfony.com/doc/current/doctrine.html](https://symfony.com/doc/current/doctrine.html) for more details.
1616

1717
## Option 2: Working with Pimcore Data Access Objects (Dao)
1818

doc/21_Deployment/01_Version_Control_Systems.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ Since Pimcore creates lots of temporary files during runtime it's recommended to
44

55
If using Git for your project we recommend the following `.gitignore`:
66

7-
* <https://github.com/pimcore/demo/blob/11.x/.gitignore>
7+
* [https://github.com/pimcore/demo/blob/11.x/.gitignore](https://github.com/pimcore/demo/blob/11.x/.gitignore)

doc/21_Deployment/03_Configuration_Environments.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ or (e.g. in *prod* environments) you can configure everything via real environme
1313

1414
In addition to Symfony configurations, Pimcore also supports environment specific configs for:
1515

16-
* <https://github.com/pimcore/demo/tree/11.x/config/pimcore>
17-
* <https://github.com/pimcore/demo/tree/11.x/var/config>
16+
* [https://github.com/pimcore/demo/tree/11.x/config/pimcore](https://github.com/pimcore/demo/tree/11.x/config/pimcore)
17+
* [https://github.com/pimcore/demo/tree/11.x/var/config](https://github.com/pimcore/demo/tree/11.x/var/config)
1818

1919

2020
## Configuration Storage Locations & Fallbacks

doc/21_Deployment/05_Deployment_Tools.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ All Pimcore configurations are saved as YAML or PHP files on the file system. As
99
[multi environment feature](03_Configuration_Environments.md) different configuration files for different deployment stages
1010
can be defined.
1111

12-
* <https://github.com/pimcore/demo/tree/11.x/config>
13-
* <https://github.com/pimcore/demo/tree/11.x/config/pimcore>
14-
* <https://github.com/pimcore/demo/tree/11.x/var/config>
12+
* [https://github.com/pimcore/demo/tree/11.x/config](https://github.com/pimcore/demo/tree/11.x/config)
13+
* [https://github.com/pimcore/demo/tree/11.x/config/pimcore](https://github.com/pimcore/demo/tree/11.x/config/pimcore)
14+
* [https://github.com/pimcore/demo/tree/11.x/var/config](https://github.com/pimcore/demo/tree/11.x/var/config)
1515

1616

1717
## Pimcore Class Definitions

doc/23_Installation_and_Upgrade/01_System_Requirements.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ For production, we highly recommend a *nix based system.
1616
- Nginx
1717

1818

19-
### PHP >=8.1 <8.3
19+
### PHP >=8.1 \<8.3
2020
Both **mod_php** and **FCGI (FPM)** are supported.
2121

2222
#### Required Settings and Modules & Extensions

doc/23_Installation_and_Upgrade/07_Updating_Pimcore/10_V6_to_V10.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Upgrading Pimcore from Version 6.x to Version 10
22

33
## System Requirement changes
4-
- PHP >=8.0 <8.2
4+
- PHP >=8.0 \<8.2
55
- Apache >= 2.4
66
- Composer >= 2.0
77

8-
> As Pimcore 6.x works only with PHP < 8.0 and Pimcore 10 works only with PHP >=8.0 <8.2, a switch of PHP version is needed during the upgrade process.
8+
> As Pimcore 6.x works only with PHP < 8.0 and Pimcore 10 works only with PHP >=8.0 \<8.2, a switch of PHP version is needed during the upgrade process.
99
1010
## Database Requirement changes
1111
- MariaDB >= 10.3
@@ -163,10 +163,10 @@ mv var/config/custom-logo.* var/admin/custom-logo.image
163163

164164
## SWITCH COMPOSER AND PHP VERSION, AND DO THE UPDATE!
165165
- Ensure Composer is updated to version >= 2.0
166-
- Switch PHP version to PHP >=8.0 <8.2
166+
- Switch PHP version to PHP >=8.0 \<8.2
167167
- Run composer update (`COMPOSER_MEMORY_LIMIT=-1 composer update`)
168168

169-
## CHANGES TO DO AFTER THE UPDATE! (TO DO WITH PHP >=8.0 <8.2)
169+
## CHANGES TO DO AFTER THE UPDATE! (TO DO WITH PHP >=8.0 \<8.2)
170170

171171
### Verify migrations execution
172172
By default, Composer update runs Pimcore migrations automatically, however it is better to check if all migrations are executed for smooth transition.

doc/23_Installation_and_Upgrade/09_Upgrade_Notes/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ The tokens for password reset are now stored in the DB and are one time use only
174174

175175
- Enabled Content Security Policy by default.
176176
- Implemented Symfony HTML sanitizer for WYSIWYG editors. Please make sure to sanitize your persisted data with help of this [script](https://gist.github.com/dvesh3/0e585a16dfbf546bc17a9eef1c5640b3).
177-
Also, when using API to set WYSIWYG data, please pass encoded characters for html entities <,>, & etc.
177+
Also, when using API to set WYSIWYG data, please pass encoded characters for html entities `<`,`>`, `&` etc.
178178
The data is encoded by the sanitizer before persisting into db and the same encoded data will be returned by the API.
179179

180180

lib/Event/Workflow/GlobalActionEvent.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818

1919
use Pimcore\Event\Traits\ArgumentsAwareTrait;
2020
use Pimcore\Workflow\GlobalAction;
21-
use Symfony\Component\Workflow\Workflow;
21+
use Symfony\Component\Workflow\WorkflowInterface;
2222
use Symfony\Contracts\EventDispatcher\Event;
2323

2424
class GlobalActionEvent extends Event
2525
{
2626
use ArgumentsAwareTrait;
2727

28-
protected Workflow $workflow;
28+
protected WorkflowInterface $workflow;
2929

3030
protected mixed $subject = null;
3131

@@ -35,15 +35,19 @@ class GlobalActionEvent extends Event
3535
* DocumentEvent constructor.
3636
*
3737
*/
38-
public function __construct(Workflow $workflow, mixed $subject, GlobalAction $globalAction, array $arguments = [])
38+
public function __construct(
39+
WorkflowInterface $workflow,
40+
mixed $subject,
41+
GlobalAction $globalAction,
42+
array $arguments = [])
3943
{
4044
$this->workflow = $workflow;
4145
$this->subject = $subject;
4246
$this->globalAction = $globalAction;
4347
$this->arguments = $arguments;
4448
}
4549

46-
public function getWorkflow(): Workflow
50+
public function getWorkflow(): WorkflowInterface
4751
{
4852
return $this->workflow;
4953
}

lib/Model/DataObject/ClassDefinition/ClassDefinitionManager.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ class ClassDefinitionManager
2929

3030
/**
3131
* Delete all classes from db
32+
*
33+
* @return list<array{string, string, string}>
3234
*/
3335
public function cleanUpDeletedClassDefinitions(): array
3436
{
@@ -58,16 +60,16 @@ public function cleanUpDeletedClassDefinitions(): array
5860

5961
/**
6062
* Updates all classes from PIMCORE_CLASS_DEFINITION_DIRECTORY
63+
*
64+
* @return list<array{string, string, string}>
6165
*/
6266
public function createOrUpdateClassDefinitions(): array
6367
{
6468
$objectClassesFolders = array_unique([PIMCORE_CLASS_DEFINITION_DIRECTORY, PIMCORE_CUSTOM_CONFIGURATION_CLASS_DEFINITION_DIRECTORY]);
69+
$changes = [];
6570

6671
foreach ($objectClassesFolders as $objectClassesFolder) {
6772
$files = glob($objectClassesFolder.'/*.php');
68-
69-
$changes = [];
70-
7173
foreach ($files as $file) {
7274
$class = include $file;
7375

lib/Templating/Renderer/IncludeRenderer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public function render(mixed $include, array $params = [], bool $editmode = fals
9191
});
9292

9393
// TODO is this enough for cache or should we disable caching completely?
94-
if (method_exists($include, 'getUseTargetGroup') && $include->getUseTargetGroup()) {
94+
if (is_object($include) && method_exists($include, 'getUseTargetGroup') && $include->getUseTargetGroup()) {
9595
$cacheParams['target_group'] = $include->getUseTargetGroup();
9696
}
9797

lib/Tool/Authentication.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,7 @@ public static function verifyPassword(User $user, string $password): bool
160160
return false;
161161
}
162162

163-
$password = self::preparePlainTextPassword($user->getName(), $password);
164-
165-
if (!password_verify($password, $user->getPassword())) {
163+
if (!password_verify(self::preparePlainTextPassword($user->getName(), $password), $user->getPassword())) {
166164
return false;
167165
}
168166

lib/Workflow/GlobalAction.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
use Pimcore\Workflow\Notes\CustomHtmlServiceInterface;
2020
use Pimcore\Workflow\Notes\NotesAwareInterface;
2121
use Pimcore\Workflow\Notes\NotesAwareTrait;
22-
use Symfony\Component\Workflow\Workflow;
22+
use Symfony\Component\Workflow\WorkflowInterface;
2323

2424
class GlobalAction implements NotesAwareInterface
2525
{
@@ -80,7 +80,7 @@ public function getGuard(): ?string
8080
return $this->options['guard'] ?? null;
8181
}
8282

83-
public function isGuardValid(Workflow $workflow, object $subject): bool
83+
public function isGuardValid(WorkflowInterface $workflow, object $subject): bool
8484
{
8585
if (empty($this->getGuard())) {
8686
return true;

lib/Workflow/Manager.php

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
use Symfony\Component\Workflow\Exception\LogicException;
3333
use Symfony\Component\Workflow\Marking;
3434
use Symfony\Component\Workflow\Registry;
35-
use Symfony\Component\Workflow\Workflow;
35+
use Symfony\Component\Workflow\WorkflowInterface;
3636
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
3737

3838
class Manager
@@ -116,7 +116,7 @@ public function getPlaceConfig(string $workflowName, string $place): ?PlaceConfi
116116
*
117117
* @return PlaceConfig[];
118118
*/
119-
public function getOrderedPlaceConfigs(Workflow $workflow, Marking $marking = null): array
119+
public function getOrderedPlaceConfigs(WorkflowInterface $workflow, Marking $marking = null): array
120120
{
121121
if (is_null($marking)) {
122122
return $this->placeConfigs[$workflow->getName()] ?? [];
@@ -170,7 +170,7 @@ public function getWorkflowConfig(string $workflowName): WorkflowConfig
170170

171171
/**
172172
*
173-
* @return Workflow[]
173+
* @return WorkflowInterface[]
174174
*/
175175
public function getAllWorkflowsForSubject(object $subject): array
176176
{
@@ -189,7 +189,7 @@ public function getAllWorkflowsForSubject(object $subject): array
189189
return $workflows;
190190
}
191191

192-
public function getWorkflowIfExists(object $subject, string $workflowName): ?Workflow
192+
public function getWorkflowIfExists(object $subject, string $workflowName): ?WorkflowInterface
193193
{
194194
try {
195195
$workflow = $this->workflowRegistry->get($subject, $workflowName);
@@ -214,8 +214,13 @@ public function getWorkflowByName(string $workflowName): ?object
214214
* @throws ValidationException
215215
* @throws \Exception
216216
*/
217-
public function applyWithAdditionalData(Workflow $workflow, Asset|PageSnippet|Concrete $subject, string $transition, array $additionalData, bool $saveSubject = false): Marking
218-
{
217+
public function applyWithAdditionalData(
218+
WorkflowInterface $workflow,
219+
Asset|PageSnippet|Concrete $subject,
220+
string $transition,
221+
array $additionalData,
222+
bool $saveSubject = false
223+
): Marking {
219224
$this->notesSubscriber->setAdditionalData($additionalData);
220225

221226
$marking = $workflow->apply($subject, $transition, $additionalData);
@@ -241,8 +246,13 @@ public function applyWithAdditionalData(Workflow $workflow, Asset|PageSnippet|Co
241246
*
242247
* @throws \Exception
243248
*/
244-
public function applyGlobalAction(Workflow $workflow, object $subject, string $globalAction, array $additionalData, bool $saveSubject = false): Marking
245-
{
249+
public function applyGlobalAction(
250+
WorkflowInterface $workflow,
251+
object $subject,
252+
string $globalAction,
253+
array $additionalData,
254+
bool $saveSubject = false
255+
): Marking {
246256
$globalActionObj = $this->getGlobalAction($workflow->getName(), $globalAction);
247257
if (!$globalActionObj) {
248258
throw new LogicException(sprintf('global action %s not found', $globalAction));
@@ -345,7 +355,7 @@ public function ensureInitialPlace(string $workflowName, object $subject): bool
345355
return false;
346356
}
347357

348-
public function getInitialPlacesForWorkflow(Workflow $workflow): array
358+
public function getInitialPlacesForWorkflow(WorkflowInterface $workflow): array
349359
{
350360
$definition = $workflow->getDefinition();
351361

0 commit comments

Comments
 (0)