Skip to content

Commit

Permalink
Any fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
e-spin committed Oct 25, 2023
1 parent bf20104 commit e535b41
Show file tree
Hide file tree
Showing 221 changed files with 5,979 additions and 3,288 deletions.
8 changes: 5 additions & 3 deletions .composer-require-checker.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"symbol-whitelist": [
"array", "bool", "false", "int", "mixed", "null", "self", "static", "parent", "string", "true", "void",
"ContaoTwigInitializeEvent",
"ContaoCommunityAlliance\\Contao\\EventDispatcher\\CcaEventDispatcherBundle",
"ContaoCommunityAlliance\\DcGeneral\\Contao\\View\\Contao2BackendView\\Exception\\EditOnlyModeException",
"ContaoCommunityAlliance\\DcGeneral\\Contao\\View\\Contao2BackendView\\Exception\\NotCreatableException",
"ContaoCommunityAlliance\\DcGeneral\\Contao\\View\\Contao2BackendView\\Exception\\NotDeletableException",
"ContaoCommunityAlliance\\Contao\\EventDispatcher\\CcaEventDispatcherBundle",
"ContaoCommunityAlliance\\DcGeneral\\DataDefinition\\Palette\\Condition\\Property\\PropertyBooleanConditionTrait",
"ContaoTwigInitializeEvent",
"Contao\\Calendar",
"Contao\\CalendarEventsModel",
"Contao\\CalendarModel",
Expand All @@ -18,6 +19,7 @@
"Contao\\NewsArchiveModel",
"Contao\\NewsModel",
"FOS\\HttpCache\\CacheInvalidator",
"MenAtWork\\MultiColumnWizardBundle\\Event\\GetOptionsEvent"
"MenAtWork\\MultiColumnWizardBundle\\Event\\GetOptionsEvent",
"Symfony\\Cmf\\Component\\Routing\\ChainRouterInterface"
]
}
2 changes: 1 addition & 1 deletion .github/workflows/diagnostics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [ '7.4', '8.0', '8.1', '8.2' ]
php: [ '8.1', '8.2' ]
contao: [ '~4.13.0' ]
phpcq_install: [ 'update' ]
output: [ '-o github-action -o default' ]
Expand Down
1 change: 1 addition & 0 deletions .phpcq.yaml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ phpcq:
# phpmd
- 0F9684B8B16B7AB0
- A4E55EA12C7C085C
- 9093F8B32E4815AA
# composer-require-checker
- 033E5F8D801A2F8D

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"source": "https://github.com/contao-community-alliance/dc-general"
},
"require": {
"php": "^7.4 || ^8.0",
"php": "^8.1",
"ext-json": "*",
"ext-pdo": "*",
"contao-community-alliance/events-contao-bindings": "^4.13",
Expand Down
2 changes: 1 addition & 1 deletion src/Clipboard/ClipboardInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public function hasId(ModelIdInterface $modelId);
*
* @param FilterInterface $filter An item filter.
*
* @return ItemInterface[]
* @return list<ItemInterface>
*/
public function fetch(FilterInterface $filter);

Expand Down
70 changes: 35 additions & 35 deletions src/Clipboard/Filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

namespace ContaoCommunityAlliance\DcGeneral\Clipboard;

use ContaoCommunityAlliance\DcGeneral\Data\ModelId;
use ContaoCommunityAlliance\DcGeneral\Data\ModelIdInterface;
use Symfony\Component\ExpressionLanguage\ExpressionLanguage;

use function count;
Expand Down Expand Up @@ -252,11 +252,11 @@ private function modelIsNotFromProvider($conjunction, $modelProviderName)
/**
* And model is.
*
* @param ModelId $modelId The model id.
* @param ModelIdInterface $modelId The model id.
*
* @return static
*/
public function andModelIs(ModelId $modelId)
public function andModelIs(ModelIdInterface $modelId)
{
$this->modelIs('and', $modelId);

Expand All @@ -266,11 +266,11 @@ public function andModelIs(ModelId $modelId)
/**
* Or model is.
*
* @param ModelId $modelId The model id.
* @param ModelIdInterface $modelId The model id.
*
* @return static
*/
public function orModelIs(ModelId $modelId)
public function orModelIs(ModelIdInterface $modelId)
{
$this->modelIs('or', $modelId);

Expand All @@ -280,12 +280,12 @@ public function orModelIs(ModelId $modelId)
/**
* Add model is.
*
* @param string $conjunction AND or OR.
* @param ModelId $modelId The model id.
* @param string $conjunction AND or OR.
* @param ModelIdInterface $modelId The model id.
*
* @return static
*/
private function modelIs($conjunction, ModelId $modelId)
private function modelIs($conjunction, ModelIdInterface $modelId)
{
if (!empty($this->expression)) {
$this->expression[] = $conjunction;
Expand All @@ -302,11 +302,11 @@ private function modelIs($conjunction, ModelId $modelId)
/**
* And model is not.
*
* @param ModelId $modelId The model id.
* @param ModelIdInterface $modelId The model id.
*
* @return static
*/
public function andModelIsNot(ModelId $modelId)
public function andModelIsNot(ModelIdInterface $modelId)
{
$this->modelIsNot('and', $modelId);

Expand All @@ -316,11 +316,11 @@ public function andModelIsNot(ModelId $modelId)
/**
* Or model is not.
*
* @param ModelId $modelId The model id.
* @param ModelIdInterface $modelId The model id.
*
* @return static
*/
public function orModelIsNot(ModelId $modelId)
public function orModelIsNot(ModelIdInterface $modelId)
{
$this->modelIsNot('or', $modelId);

Expand All @@ -330,12 +330,12 @@ public function orModelIsNot(ModelId $modelId)
/**
* Add model is not.
*
* @param string $conjunction AND or OR.
* @param ModelId $modelId The model id.
* @param string $conjunction AND or OR.
* @param ModelIdInterface $modelId The model id.
*
* @return static
*/
private function modelIsNot($conjunction, ModelId $modelId)
private function modelIsNot($conjunction, ModelIdInterface $modelId)
{
if (!empty($this->expression)) {
$this->expression[] = $conjunction;
Expand Down Expand Up @@ -495,11 +495,11 @@ private function hasNoParent($conjunction)
/**
* And parent is.
*
* @param ModelId $parentModelId The parent id.
* @param ModelIdInterface $parentModelId The parent id.
*
* @return static
*/
public function andParentIs(ModelId $parentModelId)
public function andParentIs(ModelIdInterface $parentModelId)
{
$this->parentIs('and', $parentModelId);

Expand All @@ -509,11 +509,11 @@ public function andParentIs(ModelId $parentModelId)
/**
* Or parent is.
*
* @param ModelId $parentModelId The parent id.
* @param ModelIdInterface $parentModelId The parent id.
*
* @return static
*/
public function orParentIs(ModelId $parentModelId)
public function orParentIs(ModelIdInterface $parentModelId)
{
$this->parentIs('or', $parentModelId);

Expand All @@ -523,12 +523,12 @@ public function orParentIs(ModelId $parentModelId)
/**
* Add parent is.
*
* @param string $conjunction AND or OR.
* @param ModelId $parentModelId The parent id.
* @param string $conjunction AND or OR.
* @param ModelIdInterface $parentModelId The parent id.
*
* @return static
*/
private function parentIs($conjunction, ModelId $parentModelId)
private function parentIs($conjunction, ModelIdInterface $parentModelId)
{
if (!empty($this->expression)) {
$this->expression[] = $conjunction;
Expand All @@ -545,7 +545,7 @@ private function parentIs($conjunction, ModelId $parentModelId)
/**
* And parent is in.
*
* @param array|ModelId[] $parentModelIds The parent ids.
* @param array|ModelIdInterface[] $parentModelIds The parent ids.
*
* @return static
*/
Expand All @@ -559,7 +559,7 @@ public function andParentIsIn(array $parentModelIds)
/**
* Or parent is in.
*
* @param array|ModelId[] $parentModelIds The parent ids.
* @param array|ModelIdInterface[] $parentModelIds The parent ids.
*
* @return static
*/
Expand All @@ -574,7 +574,7 @@ public function orParentIsIn(array $parentModelIds)
* Add parent is in.
*
* @param string $conjunction AND or OR.
* @param array|ModelId[] $parentModelIds The parent ids.
* @param array|ModelIdInterface[] $parentModelIds The parent ids.
*
* @return static
*/
Expand All @@ -599,11 +599,11 @@ private function parentIsIn($conjunction, array $parentModelIds)
/**
* And parent is not.
*
* @param ModelId $parentModelId The parent id.
* @param ModelIdInterface $parentModelId The parent id.
*
* @return static
*/
public function andParentIsNot(ModelId $parentModelId)
public function andParentIsNot(ModelIdInterface $parentModelId)
{
$this->parentIsNot('and', $parentModelId);

Expand All @@ -613,11 +613,11 @@ public function andParentIsNot(ModelId $parentModelId)
/**
* Or parent is not.
*
* @param ModelId $parentModelId The parent id.
* @param ModelIdInterface $parentModelId The parent id.
*
* @return static
*/
public function orParentIsNot(ModelId $parentModelId)
public function orParentIsNot(ModelIdInterface $parentModelId)
{
$this->parentIsNot('and', $parentModelId);

Expand All @@ -627,12 +627,12 @@ public function orParentIsNot(ModelId $parentModelId)
/**
* Add parent is not.
*
* @param string $conjunction AND or OR.
* @param ModelId $parentModelId The parent id.
* @param string $conjunction AND or OR.
* @param ModelIdInterface $parentModelId The parent id.
*
* @return static
*/
private function parentIsNot($conjunction, ModelId $parentModelId)
private function parentIsNot($conjunction, ModelIdInterface $parentModelId)
{
if (!empty($this->expression)) {
$this->expression[] = $conjunction;
Expand All @@ -649,7 +649,7 @@ private function parentIsNot($conjunction, ModelId $parentModelId)
/**
* And parent is not in.
*
* @param array|ModelId[] $parentModelIds The parent ids.
* @param array|ModelIdInterface[] $parentModelIds The parent ids.
*
* @return static
*/
Expand All @@ -663,7 +663,7 @@ public function andParentIsNotIn(array $parentModelIds)
/**
* Or parent is not in.
*
* @param array|ModelId[] $parentModelIds The parent ids.
* @param array|ModelIdInterface[] $parentModelIds The parent ids.
*
* @return static
*/
Expand All @@ -678,7 +678,7 @@ public function orParentIsNotIn(array $parentModelIds)
* Add parent is not in.
*
* @param string $conjunction AND or OR.
* @param array|ModelId[] $parentModelIds The parent ids.
* @param array|ModelIdInterface[] $parentModelIds The parent ids.
*
* @return static
*/
Expand Down
7 changes: 4 additions & 3 deletions src/Contao/Callback/ModelLabelCallbackListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public function update($event, $value)
if (!\is_array($value)) {
return;
}
/** @var list<string> $value */

$this->updateTableMode($event, $value);
}
Expand Down Expand Up @@ -102,12 +103,12 @@ private function updateNonTableMode(ModelToLabelEvent $event, ?string $value): v
/**
* Set the value in the event.
*
* @param ModelToLabelEvent $event The event being emitted.
* @param array $arguments The label arguments.
* @param ModelToLabelEvent $event The event being emitted.
* @param string|list<string> $arguments The label arguments.
*
* @return void
*/
private function updateTableMode(ModelToLabelEvent $event, array $arguments): void
private function updateTableMode(ModelToLabelEvent $event, array|string $arguments): void
{
if (empty($arguments)) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* This file is part of contao-community-alliance/dc-general.
*
* (c) 2013-2020 Contao Community Alliance.
* (c) 2013-2023 Contao Community Alliance.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -14,13 +14,15 @@
* @author Christian Schiffler <[email protected]>
* @author Tristan Lins <[email protected]>
* @author Sven Baumann <[email protected]>
* @copyright 2013-2020 Contao Community Alliance.
* @author Ingolf Steinhardt <[email protected]>
* @copyright 2013-2023 Contao Community Alliance.
* @license https://github.com/contao-community-alliance/dc-general/blob/master/LICENSE LGPL-3.0-or-later
* @filesource
*/

namespace ContaoCommunityAlliance\DcGeneral\Contao\Callback;

use Contao\Widget;
use ContaoCommunityAlliance\DcGeneral\Contao\Compatibility\DcCompat;
use ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\Event\BuildWidgetEvent;

Expand Down Expand Up @@ -50,6 +52,9 @@ public function getArgs($event)
*/
public function update($event, $value)
{
$event->getWidget()->wizard .= $value;
$widget = $event->getWidget();
if ($widget instanceof Widget) {
$widget->wizard .= $value;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* This file is part of contao-community-alliance/dc-general.
*
* (c) 2013-2020 Contao Community Alliance.
* (c) 2013-2023 Contao Community Alliance.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -13,13 +13,15 @@
* @package contao-community-alliance/dc-general
* @author Christian Schiffler <[email protected]>
* @author Sven Baumann <[email protected]>
* @copyright 2013-2020 Contao Community Alliance.
* @author Ingolf Steinhardt <[email protected]>
* @copyright 2013-2023 Contao Community Alliance.
* @license https://github.com/contao-community-alliance/dc-general/blob/master/LICENSE LGPL-3.0-or-later
* @filesource
*/

namespace ContaoCommunityAlliance\DcGeneral\Contao\Callback;

use Contao\Widget;
use ContaoCommunityAlliance\DcGeneral\Contao\Compatibility\DcCompat;
use ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\Event\BuildWidgetEvent;

Expand Down Expand Up @@ -49,6 +51,9 @@ public function getArgs($event)
*/
public function update($event, $value)
{
$event->getWidget()->xlabel .= $value;
$widget = $event->getWidget();
if ($widget instanceof Widget) {
$widget->wizard .= $value;
}
}
}
Loading

0 comments on commit e535b41

Please sign in to comment.