-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
33 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,22 @@ | ||
<?xml version="1.0"?> | ||
<psalm | ||
errorLevel="3" | ||
resolveFromConfigFile="true" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns="https://getpsalm.org/schema/config" | ||
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd" | ||
errorLevel="3" | ||
resolveFromConfigFile="true" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns="https://getpsalm.org/schema/config" | ||
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd" | ||
> | ||
<projectFiles> | ||
<directory name="src"/> | ||
<ignoreFiles> | ||
<directory name="src/Resources"/> | ||
</ignoreFiles> | ||
</projectFiles> | ||
<projectFiles> | ||
<directory name="src"/> | ||
<ignoreFiles> | ||
<directory name="src/Resources"/> | ||
</ignoreFiles> | ||
</projectFiles> | ||
<issueHandlers> | ||
<TooManyArguments> | ||
<errorLevel type="suppress"> | ||
<referencedFunction name="Doctrine\DBAL\Query\QueryBuilder::select"/> | ||
</errorLevel> | ||
</TooManyArguments> | ||
</issueHandlers> | ||
</psalm> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
/** | ||
* This file is part of contao-community-alliance/dc-general-contao-frontend. | ||
* | ||
* (c) 2015-2023 Contao Community Alliance. | ||
* (c) 2015-2024 Contao Community Alliance. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
|
@@ -15,7 +15,7 @@ | |
* @author Richard Henkenjohann <[email protected]> | ||
* @author Sven Baumann <[email protected]> | ||
* @author Ingolf Steinhardt <[email protected]> | ||
* @copyright 2015-2023 Contao Community Alliance. | ||
* @copyright 2015-2024 Contao Community Alliance. | ||
* @license https://github.com/contao-community-alliance/dc-general-contao-frontend/blob/master/LICENSE LGPL-3.0 | ||
* @filesource | ||
*/ | ||
|
@@ -28,6 +28,7 @@ | |
use ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\Event\GetEditModeButtonsEvent; | ||
use ContaoCommunityAlliance\DcGeneral\Controller\ControllerInterface; | ||
use ContaoCommunityAlliance\DcGeneral\DataDefinition\ContainerInterface; | ||
use ContaoCommunityAlliance\DcGeneral\DataDefinition\DataProviderInformationInterface; | ||
use ContaoCommunityAlliance\DcGeneral\DataDefinition\Definition\PropertiesDefinitionInterface; | ||
use ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PaletteInterface; | ||
use ContaoCommunityAlliance\DcGeneral\Data\DataProviderInterface; | ||
|
@@ -86,9 +87,9 @@ class EditMask | |
/** | ||
* The data provider of the model being edited. | ||
* | ||
* @var DataProviderInterface | ||
* @var DataProviderInformationInterface | ||
*/ | ||
private DataProviderInterface $modelProvider; | ||
private DataProviderInformationInterface $modelProvider; | ||
|
||
/** | ||
* The model to be manipulated. | ||
|
@@ -156,7 +157,6 @@ public function __construct($environment, $model, $originalModel, $preFunction, | |
* @return string | ||
* | ||
* @throws DcGeneralRuntimeException If the data container is not editable, closed. | ||
* | ||
* @throws DcGeneralInvalidArgumentException If an unknown property is encountered in the palette. | ||
*/ | ||
public function execute() | ||
|
@@ -177,8 +177,7 @@ public function execute() | |
$palette = $palettesDefinition->findPalette($this->model); | ||
|
||
$propertyValues = $this->processInput($widgetManager); | ||
assert($propertyValues instanceof PropertyValueBag); | ||
if ($isSubmitted) { | ||
if ($isSubmitted && null !== $propertyValues) { | ||
// Pass 2: Determine the real palette we want to work on if we have some data submitted. | ||
$palette = $palettesDefinition->findPalette($this->model, $propertyValues); | ||
|
||
|
@@ -365,9 +364,9 @@ private function getEditButtons(): array | |
/** | ||
* Build the field sets. | ||
* | ||
* @param WidgetManager $widgetManager The widget manager in use. | ||
* @param PaletteInterface $palette The palette to use. | ||
* @param PropertyValueBag $propertyValues The property values. | ||
* @param WidgetManager $widgetManager The widget manager in use. | ||
* @param PaletteInterface $palette The palette to use. | ||
* @param PropertyValueBag|null $propertyValues The property values. | ||
* | ||
* @return array | ||
* | ||
|
@@ -379,7 +378,7 @@ private function getEditButtons(): array | |
private function buildFieldSet( | ||
WidgetManager $widgetManager, | ||
PaletteInterface $palette, | ||
PropertyValueBag $propertyValues | ||
?PropertyValueBag $propertyValues | ||
): array { | ||
$propertyDefinitions = $this->definition->getPropertiesDefinition(); | ||
|
||
|
@@ -470,7 +469,7 @@ private function ensurePropertyExists(string $property, PropertiesDefinitionInte | |
*/ | ||
private function storeVersion(ModelInterface $model): void | ||
{ | ||
if (!$this->modelProvider->isVersioningEnabled() || null === $model) { | ||
if (!$this->modelProvider->isVersioningEnabled()) { | ||
return; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
/** | ||
* This file is part of contao-community-alliance/dc-general-contao-frontend. | ||
* | ||
* (c) 2015-2023 Contao Community Alliance. | ||
* (c) 2015-2024 Contao Community Alliance. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
|
@@ -14,7 +14,7 @@ | |
* @author Christian Schiffler <[email protected]> | ||
* @author Richard Henkenjohann <[email protected]> | ||
* @author Ingolf Steinhardt <[email protected]> | ||
* @copyright 2015-2023 Contao Community Alliance. | ||
* @copyright 2015-2024 Contao Community Alliance. | ||
* @license https://github.com/contao-community-alliance/dc-general-contao-frontend/blob/master/LICENSE LGPL-3.0 | ||
* @filesource | ||
*/ | ||
|
@@ -27,6 +27,7 @@ | |
use ContaoCommunityAlliance\DcGeneral\ContaoFrontend\Event\BuildWidgetEvent; | ||
use ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\Event\EncodePropertyValueFromWidgetEvent; | ||
use ContaoCommunityAlliance\DcGeneral\ContaoFrontend\Event\DcGeneralFrontendEvents; | ||
use ContaoCommunityAlliance\DcGeneral\Controller\ControllerInterface; | ||
use ContaoCommunityAlliance\DcGeneral\Data\ModelInterface; | ||
use ContaoCommunityAlliance\DcGeneral\Data\PropertyValueBag; | ||
use ContaoCommunityAlliance\DcGeneral\DataDefinition\ContainerInterface; | ||
|
@@ -104,7 +105,7 @@ public function getWidget($property, PropertyValueBag $valueBag = null) | |
$values = new PropertyValueBag($valueBag->getArrayCopy()); | ||
|
||
$controller = $this->environment->getController(); | ||
assert($controller instanceof ContainerInterface); | ||
assert($controller instanceof ControllerInterface); | ||
|
||
$controller->updateModelFromPropertyBag($model, $values); | ||
} | ||
|