Skip to content

Commit d074e73

Browse files
author
Marc Reimann
committed
Fix deprecations
1 parent 4bebdc0 commit d074e73

51 files changed

Lines changed: 184 additions & 177 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
},
9393
"extra": {
9494
"branch-alias": {
95-
"dev-release/2.4.0": "2.4.x-dev"
95+
"dev-feature/symfony-7": "2.5.x-dev"
9696
},
9797
"contao-manager-plugin": "ContaoCommunityAlliance\\DcGeneral\\ContaoManager\\Plugin"
9898
}

src/Cache/Http/InvalidateCacheTags.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class InvalidateCacheTags implements InvalidateCacheTagsInterface
7575
public function __construct(
7676
string $namespace,
7777
EventDispatcherInterface $dispatcher,
78-
CacheInvalidator $cacheManager = null
78+
?CacheInvalidator $cacheManager = null
7979
) {
8080
$this->namespace = $namespace;
8181
$this->dispatcher = $dispatcher;

src/Contao/Compatibility/DcCompat.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class DcCompat extends General
6161
* @param ModelInterface|null $model The model within scope (optional).
6262
* @param string|null $propertyName The name of the property within scope (optional).
6363
*/
64-
public function __construct(EnvironmentInterface $environment, ModelInterface $model = null, $propertyName = null)
64+
public function __construct(EnvironmentInterface $environment, ?ModelInterface $model = null, ?string $propertyName = null)
6565
{
6666
// Prevent "Recoverable error: Argument X passed to SomClass::someMethod() must be an instance of DataContainer,
6767
// instance of ContaoCommunityAlliance\DcGeneral\Contao\Compatibility\DcCompat given" in callbacks.

src/Contao/Dca/Builder/Legacy/LegacyDcaDataDefinitionBuilder.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,6 +1203,10 @@ protected function parseModelOperations(Contao2BackendViewDefinitionInterface $v
12031203
$collection = $view->getModelCommands();
12041204

12051205
foreach ($operationsDca as $operationName => $operationDca) {
1206+
if (is_string($operationDca)) {
1207+
continue;
1208+
}
1209+
assert(is_array($operationDca));
12061210
$command = $this->createCommand($operationName, $operationDca);
12071211
$collection->addCommand($command);
12081212
}

src/Contao/Picker/AbstractAwarePickerProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ protected function getUser()
156156
*
157157
* @return array
158158
*/
159-
abstract protected function getRouteParameters(PickerConfig $config = null);
159+
abstract protected function getRouteParameters(?PickerConfig $config = null);
160160

161161
/**
162162
* Generates the URL for the picker.

src/Contao/Picker/PagePickerProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public function supportsValue(PickerConfig $config): bool
108108
/**
109109
* {@inheritdoc}
110110
*/
111-
public function getDcaTable(PickerConfig $config = null): string
111+
public function getDcaTable(?PickerConfig $config = null): string
112112
{
113113
return 'tl_page';
114114
}

src/Contao/Picker/TreePickerProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public function convertDcaValue(PickerConfig $config, mixed $value): int|string
110110
/**
111111
* {@inheritdoc}
112112
*/
113-
protected function getRouteParameters(PickerConfig $config = null)
113+
protected function getRouteParameters(?PickerConfig $config = null)
114114
{
115115
return ['do' => 'tree'];
116116
}

src/Contao/Subscriber/FormatModelLabelSubscriber.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public function handleFormatModelLabel(FormatModelLabelEvent $event)
110110
*
111111
* @return string
112112
*/
113-
private function getFirstSorting(GroupAndSortingDefinitionInterface $sortingDefinition = null)
113+
private function getFirstSorting(?GroupAndSortingDefinitionInterface $sortingDefinition = null)
114114
{
115115
if (null === $sortingDefinition) {
116116
return '';

src/Contao/View/Contao2BackendView/ActionHandler/MultipleHandler/OverrideAllHandler.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ private function process(Action $action, EnvironmentInterface $environment)
157157
* @SuppressWarnings(PHPMD.LongVariable)
158158
*/
159159
protected function handleInvalidPropertyValueBag(
160-
PropertyValueBagInterface $propertyValueBag = null,
161-
ModelInterface $model = null,
160+
?PropertyValueBagInterface $propertyValueBag,
161+
?ModelInterface $model,
162162
EnvironmentInterface $environment
163163
) {
164164
// @codingStandardsIgnoreStart
@@ -208,17 +208,17 @@ protected function handleInvalidPropertyValueBag(
208208
/**
209209
* Handle override of model collection.
210210
*
211-
* @param Action $action The action.
212-
* @param \ArrayObject $renderInformation The render information.
213-
* @param PropertyValueBagInterface $propertyValues The property values.
214-
* @param EnvironmentInterface $environment The environment.
211+
* @param Action $action The action.
212+
* @param \ArrayObject $renderInformation The render information.
213+
* @param PropertyValueBagInterface|null $propertyValues The property values.
214+
* @param EnvironmentInterface $environment The environment.
215215
*
216216
* @return void
217217
*/
218218
private function handleOverrideCollection(
219219
Action $action,
220220
\ArrayObject $renderInformation,
221-
PropertyValueBagInterface $propertyValues = null,
221+
?PropertyValueBagInterface $propertyValues,
222222
EnvironmentInterface $environment
223223
) {
224224
if (!$propertyValues) {

src/Contao/View/Contao2BackendView/ActionHandler/ToggleHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public function handleEvent(ActionEvent $event)
112112
protected function process(
113113
EnvironmentInterface $environment,
114114
ToggleCommandInterface $operation,
115-
ModelIdInterface $modelId = null
115+
?ModelIdInterface $modelId = null
116116
) {
117117
$dataProvider = $environment->getDataProvider();
118118
assert($dataProvider instanceof DataProviderInterface);

0 commit comments

Comments
 (0)