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
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
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 @@ -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
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
4 changes: 2 additions & 2 deletions src/MetaModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ class MetaModel implements IMetaModel
*/
public function __construct(
$arrData,
EventDispatcherInterface $dispatcher = null,
Connection $connection = null
?EventDispatcherInterface $dispatcher = null,
?Connection $connection = null
) {
foreach ($arrData as $strKey => $varValue) {
$this->arrData[$strKey] = $this->tryUnserialize($varValue);
Expand Down
6 changes: 3 additions & 3 deletions src/Render/Setting/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public function __construct(
array $arrInformation,
EventDispatcherInterface $dispatcher,
IFilterSettingFactory $filterFactory,
FilterUrlBuilder $filterUrlBuilder = null
?FilterUrlBuilder $filterUrlBuilder = null
) {
$this->metaModel = $metaModel;
$this->dispatcher = $dispatcher;
Expand Down Expand Up @@ -281,7 +281,7 @@ private function determineJumpToInformation(): array
*
* @return array
*/
private function lookupJumpTo(bool $translated, string $desired = null, string $fallback = null): array
private function lookupJumpTo(bool $translated, ?string $desired = null, ?string $fallback = null): array
{
$jumpToPageId = '';
$filterSettingId = '';
Expand Down Expand Up @@ -322,7 +322,7 @@ private function lookupJumpTo(bool $translated, string $desired = null, string $
* {@inheritdoc}
*/
#[\Override]
public function buildJumpToUrlFor(IItem $item /**, ?int $referenceType */)
public function buildJumpToUrlFor(IItem $item, ?int $referenceType = null)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unsure about this change here if this is a bc break.

{
$information = $this->determineJumpToInformation();
if (empty($information['pageDetails'])) {
Expand Down
6 changes: 3 additions & 3 deletions src/Render/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ public function __call($strMethod, $arrArgs)
*/
public function __construct(
$strTemplate = '',
Adapter $templateLoader = null,
RequestScopeDeterminator $scopeDeterminator = null
?Adapter $templateLoader = null,
?RequestScopeDeterminator $scopeDeterminator = null
) {
$this->strTemplate = $strTemplate;

Expand Down Expand Up @@ -638,7 +638,7 @@ public function endblock()
*
* @return void
*/
public function insert($strName, array $arrData = null)
public function insert($strName, ?array $arrData = null)
{
if ($this->scopeDeterminator->currentScopeIsBackend()) {
$objTemplate = new BackendTemplate($strName);
Expand Down
Loading