Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
"source": "https://github.com/MetaModels/core"
},
"require": {
"php": "^8.2",
"php": "^8.4",
"ext-dom": "*",
"contao-community-alliance/dc-general": "^2.4.2",
"contao-community-alliance/events-contao-bindings": "^5.0",
"contao-community-alliance/meta-palettes": "^2.0.10",
"contao-community-alliance/dc-general": "^2.5@dev",
"contao-community-alliance/events-contao-bindings": "^5.7@dev",
"contao-community-alliance/meta-palettes": "^2.1",
"contao-community-alliance/translator": "^2.5",
"contao-community-alliance/url-builder": "^2.0",
"contao/core-bundle": "^5.7",
Expand Down
4 changes: 2 additions & 2 deletions src/Attribute/BaseSimple.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ class BaseSimple extends Base implements ISimple
public function __construct(
IMetaModel $objMetaModel,
$arrData = [],
Connection $connection = null,
TableManipulator $tableManipulator = null
?Connection $connection = null,
?TableManipulator $tableManipulator = null
) {
parent::__construct($objMetaModel, $arrData);

Expand Down
2 changes: 1 addition & 1 deletion src/Attribute/TranslatedReference.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ abstract class TranslatedReference extends BaseComplex implements ITranslated
* classes for information what values are understood.
* @param Connection|null $connection Database connection.
*/
public function __construct(IMetaModel $objMetaModel, $arrData = [], Connection $connection = null)
public function __construct(IMetaModel $objMetaModel, $arrData = [], ?Connection $connection = null)
{
parent::__construct($objMetaModel, $arrData);

Expand Down
2 changes: 0 additions & 2 deletions src/CoreBundle/BackendHelp/CustomSqlHelpTextProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
use ContaoCommunityAlliance\DcGeneral\BackendHelp\BackendHelpProviderInterface;
use ContaoCommunityAlliance\DcGeneral\BackendHelp\HelpText;

use function array_key_exists;

final readonly class CustomSqlHelpTextProvider implements BackendHelpProviderInterface
{
public function __construct(
Expand Down
2 changes: 0 additions & 2 deletions src/CoreBundle/BackendHelp/PanelLayoutHelpTextProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
use ContaoCommunityAlliance\DcGeneral\BackendHelp\BackendHelpProviderInterface;
use ContaoCommunityAlliance\DcGeneral\BackendHelp\HelpText;

use function array_key_exists;

final readonly class PanelLayoutHelpTextProvider implements BackendHelpProviderInterface
{
public function __construct(
Expand Down
2 changes: 0 additions & 2 deletions src/CoreBundle/BackendHelp/TlClassHelpTextProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
use ContaoCommunityAlliance\DcGeneral\BackendHelp\BackendHelpProviderInterface;
use ContaoCommunityAlliance\DcGeneral\BackendHelp\HelpText;

use function array_key_exists;

final readonly class TlClassHelpTextProvider implements BackendHelpProviderInterface
{
public function __construct(
Expand Down
2 changes: 0 additions & 2 deletions src/CoreBundle/BackendHelp/TypeHelpTextProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
use ContaoCommunityAlliance\DcGeneral\BackendHelp\BackendHelpProviderInterface;
use ContaoCommunityAlliance\DcGeneral\BackendHelp\HelpText;

use function array_key_exists;

final readonly class TypeHelpTextProvider implements BackendHelpProviderInterface
{
public function __construct(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ protected function buildFilterParamsFor(DC_Table $dataContainer, $elementName)
*
* @return string|null
*/
public function saveCallback(string $value = null)
public function saveCallback(?string $value = null)
{
return ('--null--' === $value || null === $value) ? null : base64_decode($value);
}
Expand All @@ -382,7 +382,7 @@ public function saveCallback(string $value = null)
*
* @return string|null
*/
public function loadCallback(string $value = null)
public function loadCallback(?string $value = null)
{
return null === $value ? '--null--' : trim(base64_encode($value), '=');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

namespace MetaModels\CoreBundle\Controller\Backend;

use Contao\CoreBundle\Controller\AbstractBackendController;
use Contao\CoreBundle\Controller\Backend\AbstractBackendController;
use Contao\CoreBundle\Csrf\ContaoCsrfTokenManager;
use Contao\CoreBundle\Framework\Adapter;
use Contao\System;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

namespace MetaModels\CoreBundle\Controller\Backend;

use Contao\CoreBundle\Controller\AbstractBackendController;
use Contao\CoreBundle\Controller\Backend\AbstractBackendController;
use Contao\CoreBundle\Framework\ContaoFramework;
use ContaoCommunityAlliance\DcGeneral\Factory\DcGeneralFactoryService;
use ContaoCommunityAlliance\Translator\TranslatorInterface;
Expand Down
2 changes: 1 addition & 1 deletion src/CoreBundle/Controller/Backend/MetaModelController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

namespace MetaModels\CoreBundle\Controller\Backend;

use Contao\CoreBundle\Controller\AbstractBackendController;
use Contao\CoreBundle\Controller\Backend\AbstractBackendController;
use Contao\CoreBundle\Exception\AccessDeniedException;
use Contao\CoreBundle\Framework\ContaoFramework;
use Contao\CoreBundle\Menu\BackendMenuBuilder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

namespace MetaModels\CoreBundle\Controller\Backend;

use Contao\CoreBundle\Controller\AbstractBackendController;
use Contao\CoreBundle\Controller\Backend\AbstractBackendController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Contracts\Translation\TranslatorInterface;
use Twig\Environment as TwigEnvironment;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ public function __invoke(
Request $request,
ContentModel $model,
string $section,
array $classes = null,
PageModel $pageModel = null
?array $classes = null,
?PageModel $pageModel = null
): Response {
if ($this->scopeMatcher->isBackendRequest($request)) {
return $this->getBackendWildcard($model);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ public function __invoke(
Request $request,
ModuleModel $model,
string $section,
array $classes = null,
PageModel $pageModel = null
?array $classes = null,
?PageModel $pageModel = null
): Response {
if ($this->scopeMatcher->isBackendRequest($request)) {
return $this->getBackendWildcard($model);
Expand Down
6 changes: 3 additions & 3 deletions src/CoreBundle/Controller/ListControllerTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ public function __construct(
IRenderSettingFactory $renderSettingFactory,
EventDispatcherInterface $eventDispatcher,
FilterUrlBuilder $filterUrlBuilder,
TranslatorInterface $translator = null,
RouterInterface $router = null,
ScopeMatcher $scopeMatcher = null
?TranslatorInterface $translator = null,
?RouterInterface $router = null,
?ScopeMatcher $scopeMatcher = null
) {
$this->factory = $factory;
$this->filterFactory = $filterFactory;
Expand Down
4 changes: 2 additions & 2 deletions src/CoreBundle/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class Configuration implements ConfigurationInterface
* @param bool $debug The debug flag.
* @param string $rootDir The root directory.
*/
public function __construct($debug, $rootDir)
public function __construct(bool $debug, string $rootDir)
{
$this->debug = $debug;
$this->rootDir = $rootDir;
Expand All @@ -65,7 +65,7 @@ public function __construct($debug, $rootDir)
* @psalm-suppress UndefinedMethod
*/
#[\Override]
public function getConfigTreeBuilder()
public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder('metamodels');
$treeBuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ private function createProperty(
PropertyInterface $property,
string $propertyName,
bool $variantHandling,
ConditionInterface $condition = null,
ConditionInterface $legendCondition = null
?ConditionInterface $condition = null,
?ConditionInterface $legendCondition = null
): Property {
$paletteProperty = new Property($propertyName);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ protected function build(IMetaModelDataDefinition $container)
// Create a new panel container.
$panel = $view->getPanelLayout();
$panelRows = $panel->getRows();

foreach ($arrRows as $rowNo => $rowElements) {
// Get the row, if we have one or create a new one.
if ($panelRows->getRowCount() < ((int) $rowNo + 1)) {
Expand Down Expand Up @@ -156,7 +155,7 @@ private function ensureSubmitElement(PanelRowCollectionInterface $panelRows): vo
// If not add a submit.
if (!$hasSubmit && $panelRows->getRowCount()) {
$row = $panelRows->getRow($panelRows->getRowCount() - 1);
$row->addElement(new DefaultSubmitElementInformation(), 0);
$row->addElement(new DefaultSubmitElementInformation(), -1);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ protected function getMetaModelByModelPid(ModelInterface $model)
*
* @throws \InvalidArgumentException When the MetaModel could not be retrieved.
*/
protected function createAttributeInstance(ModelInterface $model = null)
protected function createAttributeInstance(?ModelInterface $model = null)
{
if (null === $model) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ private function buildUrlsForItems(
*
* @return UrlBuilder
*/
private function getBaseUrl(array $pageDetails, string $path = null): UrlBuilder
private function getBaseUrl(array $pageDetails, ?string $path = null): UrlBuilder
{
$url = new UrlBuilder();
// Set the domain (see contao/core#6421)
Expand Down
2 changes: 1 addition & 1 deletion src/CoreBundle/EventListener/InsertTagsListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public function __construct(
IFactory $factory,
IRenderSettingFactory $renderSettingFactory,
IFilterSettingFactory $filterSettingFactory,
LoggerInterface $logger = null
?LoggerInterface $logger = null
) {
$this->connection = $connection;
$this->factory = $factory;
Expand Down
5 changes: 5 additions & 0 deletions src/CoreBundle/Resources/views/Backend/be_base.html.twig
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
{% extends "@Contao/be_main" %}

{%- set bodyAttributes = attrs(attributes|default)
.set('data-turbo', 'false')
.mergeWith(bodyAttributes|default)
-%}
4 changes: 0 additions & 4 deletions src/CoreBundle/Resources/views/Backend/be_config.html.twig
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{% extends "@MetaModelsCore/Backend/be_base.html.twig" %}

{% block main_headline %}
{{ headline }}
{% endblock %}

{% block error %}
{%- if error is defined -%}
{{- error -}}
Expand Down
4 changes: 2 additions & 2 deletions src/Filter/FilterUrlBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public function generate(FilterUrl $filterUrl): string
*
* @return FilterUrl
*/
public function getCurrentFilterUrl(array $options = null): FilterUrl
public function getCurrentFilterUrl(?array $options = null): FilterUrl
{
$this->addFromCurrentRequest($filterUrl = new FilterUrl(), $options);

Expand All @@ -155,7 +155,7 @@ public function getCurrentFilterUrl(array $options = null): FilterUrl
*
* @return void
*/
public function addFromCurrentRequest(FilterUrl $filterUrl, array $options = null): void
public function addFromCurrentRequest(FilterUrl $filterUrl, ?array $options = null): void
{
if (null === $options) {
$options = [
Expand Down
6 changes: 3 additions & 3 deletions src/Filter/Setting/Simple.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ abstract class Simple implements ISimple
public function __construct(
$collection,
$data,
EventDispatcherInterface $eventDispatcher = null,
FilterUrlBuilder $filterUrlBuilder = null,
TranslatorInterface $translator = null
?EventDispatcherInterface $eventDispatcher = null,
?FilterUrlBuilder $filterUrlBuilder = null,
?TranslatorInterface $translator = null
) {
$this->collection = $collection;
$this->data = $data;
Expand Down
2 changes: 0 additions & 2 deletions src/Filter/Setting/SimpleLookup.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
namespace MetaModels\Filter\Setting;

use Contao\StringUtil;
use Contao\System;
use MetaModels\Attribute\IAttribute;
use MetaModels\FrontendIntegration\FrontendFilterOptions;
use MetaModels\IItem;
Expand All @@ -34,7 +33,6 @@
use MetaModels\IMetaModel;
use MetaModels\ITranslatedMetaModel;
use MetaModels\Render\Setting\ICollection as IRenderSettings;
use Symfony\Contracts\Translation\TranslatorInterface;

/**
* Filter setting implementation performing a search for a value on a configured attribute.
Expand Down
12 changes: 6 additions & 6 deletions src/FrontendIntegration/FrontendFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,14 @@ class FrontendFilter
/**
* FrontendFilter constructor.
*
* @param Connection|null $connection Database connection.
* @param FilterUrlBuilder|null $filterUrlBuilder The filter URL builder.
* @param TranslatorInterface $translator The translator.
* @param Connection|null $connection Database connection.
* @param FilterUrlBuilder|null $filterUrlBuilder The filter URL builder.
* @param TranslatorInterface|null $translator The translator.
*/
public function __construct(
Connection $connection = null,
FilterUrlBuilder $filterUrlBuilder = null,
TranslatorInterface $translator = null
?Connection $connection = null,
?FilterUrlBuilder $filterUrlBuilder = null,
?TranslatorInterface $translator = null
) {
if (null === $connection) {
// @codingStandardsIgnoreStart
Expand Down
10 changes: 5 additions & 5 deletions src/Helper/ToolboxFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,11 @@ class ToolboxFile
* @SuppressWarnings(PHPMD.NPathComplexity)
*/
public function __construct(
ImageFactoryInterface|EventDispatcherInterface $imageFactory = null,
string $rootDir = null,
ContextInterface $filesContext = null,
PictureFactoryInterface $pictureFactory = null,
RequestStack $requestStack = null
ImageFactoryInterface|EventDispatcherInterface|null $imageFactory = null,
?string $rootDir = null,
?ContextInterface $filesContext = null,
?PictureFactoryInterface $pictureFactory = null,
?RequestStack $requestStack = null
) {
switch (true) {
case ($imageFactory instanceof ImageFactoryInterface) && (null !== $rootDir):
Expand Down
2 changes: 1 addition & 1 deletion src/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class Item implements IItem
* @param array|null $arrData The initial data that shall be injected into the new instance.
* @param EventDispatcherInterface|null $dispatcher The event dispatcher.
*/
public function __construct(IMetaModel $objMetaModel, $arrData, EventDispatcherInterface $dispatcher = null)
public function __construct(IMetaModel $objMetaModel, $arrData, ?EventDispatcherInterface $dispatcher = null)
{
$this->metaModel = $objMetaModel;
$this->dispatcher = $dispatcher;
Expand Down
25 changes: 12 additions & 13 deletions src/ItemList.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
use function func_num_args;
use function in_array;
use function is_int;
use function is_object;
use function sprintf;
use function strtoupper;
use function trigger_error;
Expand Down Expand Up @@ -221,16 +220,16 @@ class ItemList
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
public function __construct(
IFactory $factory = null,
IFilterSettingFactory $filterFactory = null,
IRenderSettingFactory $renderSettingFactory = null,
EventDispatcherInterface $eventDispatcher = null,
FilterUrlBuilder $filterUrlBuilder = null,
string $pageParam = 'page',
string $paramType = 'get',
int $maxPaginationLinks = 0,
string $paginationTemplate = 'mm_pagination',
string $paginationFragment = ''
?IFactory $factory = null,
?IFilterSettingFactory $filterFactory = null,
?IRenderSettingFactory $renderSettingFactory = null,
?EventDispatcherInterface $eventDispatcher = null,
?FilterUrlBuilder $filterUrlBuilder = null,
string $pageParam = 'page',
string $paramType = 'get',
int $maxPaginationLinks = 0,
string $paginationTemplate = 'mm_pagination',
string $paginationFragment = ''
) {
$this->paginationLimitCalculator = new PaginationLimitCalculator(
$filterUrlBuilder,
Expand Down Expand Up @@ -500,7 +499,7 @@ public function setSorting(string $sortBy, string $sortDirection = 'ASC'): self
*
* @return ItemList
*/
public function overrideOutputFormat(string $outputFormat = null): self
public function overrideOutputFormat(?string $outputFormat = null): self
{
$outputFormat = (string) $outputFormat;
if ('' !== $outputFormat) {
Expand Down Expand Up @@ -1259,7 +1258,7 @@ public function setSortingLinkGenerator(SortingLinkGenerator $generator): self
*
* @psalm-suppress UndefinedMagicPropertyAssignment
*/
public function render(bool $isNoNativeParsing, object $caller = null): string
public function render(bool $isNoNativeParsing, ?object $caller = null): string
{
if (func_num_args() > 1) {
trigger_error('Passing $objCaller as second argument is deprecated', E_USER_DEPRECATED);
Expand Down
Loading
Loading