Skip to content

Commit

Permalink
run rector
Browse files Browse the repository at this point in the history
  • Loading branch information
koertho committed Oct 25, 2024
1 parent 81581f7 commit e174adb
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 19 deletions.
3 changes: 0 additions & 3 deletions src/Controller/FrontendModule/WatchlistModuleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,10 @@

namespace HeimrichHannot\WatchlistBundle\Controller\FrontendModule;

use Contao\CoreBundle\ServiceAnnotation\FrontendModule;
use Contao\Environment;
use Contao\FrontendTemplate;
use Contao\ModuleModel;
use Contao\System;
use Contao\Template;
use HeimrichHannot\EncoreBundle\Asset\FrontendAsset;
use HeimrichHannot\EncoreContracts\PageAssetsTrait;
use HeimrichHannot\UtilsBundle\Database\DatabaseUtil;
use HeimrichHannot\UtilsBundle\File\FileUtil;
Expand Down
4 changes: 3 additions & 1 deletion src/DataContainer/WatchlistItemContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

namespace HeimrichHannot\WatchlistBundle\DataContainer;

use Contao\Date;
use Contao\Config;
use Contao\CoreBundle\Framework\ContaoFramework;
use Contao\DataContainer;
use Contao\System;
Expand Down Expand Up @@ -82,7 +84,7 @@ public function listChildren(array $row)
}

return '<div class="tl_content_left">'.$label.' <span style="color:#b3b3b3; padding-left:3px">['.
\Contao\Date::parse(\Contao\Config::get('datimFormat'), trim($row['dateAdded'])).']</span></div>';
Date::parse(Config::get('datimFormat'), trim($row['dateAdded'])).']</span></div>';
}

/**
Expand Down
1 change: 0 additions & 1 deletion src/EventListener/Contao/LoadDataContainerListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

namespace HeimrichHannot\WatchlistBundle\EventListener\Contao;

use Contao\CoreBundle\ServiceAnnotation\Hook;
use HeimrichHannot\UtilsBundle\Dca\DcaUtil;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
use HeimrichHannot\UtilsBundle\Model\ModelUtil;
use HeimrichHannot\WatchlistBundle\Util\WatchlistUtil;
use Symfony\Component\HttpFoundation\RequestStack;
use Terminal42\ServiceAnnotationBundle\Annotation\ServiceTag;

/**
* ServiceTag("kernel.event_listener", event="huh.list.event.list_modify_query_builder_for_count")
Expand Down
2 changes: 0 additions & 2 deletions src/EventListener/ReaderModifyQueryBuilderEventListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@
namespace HeimrichHannot\WatchlistBundle\EventListener;

use HeimrichHannot\ReaderBundle\Event\ReaderModifyQueryBuilderEvent;
use HeimrichHannot\RequestBundle\Component\HttpFoundation\Request;
use HeimrichHannot\UtilsBundle\Database\DatabaseUtil;
use HeimrichHannot\UtilsBundle\Model\ModelUtil;
use HeimrichHannot\WatchlistBundle\Util\WatchlistUtil;
use Symfony\Component\HttpFoundation\RequestStack;
use Terminal42\ServiceAnnotationBundle\Annotation\ServiceTag;

/**
* ServiceTag("kernel.event_listener", event="huh.reader.event.reader_modify_query_builder")
Expand Down
7 changes: 5 additions & 2 deletions src/Resources/contao/dca/tl_module.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?php

use HeimrichHannot\WatchlistBundle\Controller\FrontendModule\WatchlistModuleController;
use HeimrichHannot\WatchlistBundle\Controller\FrontendModule\ShareListModuleController;

/*
* Copyright (c) 2021 Heimrich & Hannot GmbH
*
Expand All @@ -11,8 +14,8 @@
/*
* Palettes
*/
$dca['palettes'][\HeimrichHannot\WatchlistBundle\Controller\FrontendModule\WatchlistModuleController::TYPE] =
$dca['palettes'][WatchlistModuleController::TYPE] =
'{title_legend},name,headline,type;{config_legend},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space';

$dca['palettes'][\HeimrichHannot\WatchlistBundle\Controller\FrontendModule\ShareListModuleController::TYPE] =
$dca['palettes'][ShareListModuleController::TYPE] =
'{title_legend},name,headline,type;{image_legend},imgSize;{config_legend},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space';
5 changes: 3 additions & 2 deletions src/Resources/contao/dca/tl_watchlist_config.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
*
* @license LGPL-3.0-or-later
*/

use Contao\System;
use Contao\BackendUser;
use HeimrichHannot\WatchlistBundle\DataContainer\WatchlistConfigContainer;

$GLOBALS['TL_DCA']['tl_watchlist_config'] = [
Expand Down Expand Up @@ -118,7 +119,7 @@
'inputType' => 'imageSize',
'reference' => &$GLOBALS['TL_LANG']['MSC'],
'eval' => ['rgxp' => 'natural', 'includeBlankOption' => true, 'nospace' => true, 'helpwizard' => true, 'tl_class' => 'w50'],
'options_callback' => static fn() => Contao\System::getContainer()->get('contao.image.image_sizes')->getOptionsForUser(Contao\BackendUser::getInstance()),
'options_callback' => static fn() => System::getContainer()->get('contao.image.image_sizes')->getOptionsForUser(BackendUser::getInstance()),
'sql' => "varchar(128) NOT NULL default ''",
],
'addShare' => [
Expand Down
11 changes: 7 additions & 4 deletions src/Resources/contao/languages/de/modules.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?php

use HeimrichHannot\WatchlistBundle\Controller\FrontendModule\WatchlistModuleController;
use HeimrichHannot\WatchlistBundle\Controller\FrontendModule\ShareListModuleController;

/*
* Copyright (c) 2021 Heimrich & Hannot GmbH
*
Expand All @@ -15,8 +18,8 @@
/*
* Frontend modules
*/
$GLOBALS['TL_LANG']['FMD'][\HeimrichHannot\WatchlistBundle\Controller\FrontendModule\WatchlistModuleController::TYPE][0] = 'Merkliste';
$GLOBALS['TL_LANG']['FMD'][\HeimrichHannot\WatchlistBundle\Controller\FrontendModule\WatchlistModuleController::TYPE][1] = 'Fügt eine Merkliste samt Schaltfläche zum Öffnen derselbigen hinzu.';
$GLOBALS['TL_LANG']['FMD'][WatchlistModuleController::TYPE][0] = 'Merkliste';
$GLOBALS['TL_LANG']['FMD'][WatchlistModuleController::TYPE][1] = 'Fügt eine Merkliste samt Schaltfläche zum Öffnen derselbigen hinzu.';

$GLOBALS['TL_LANG']['FMD'][\HeimrichHannot\WatchlistBundle\Controller\FrontendModule\ShareListModuleController::TYPE][0] = 'Teilen-Liste (Merkliste)';
$GLOBALS['TL_LANG']['FMD'][\HeimrichHannot\WatchlistBundle\Controller\FrontendModule\ShareListModuleController::TYPE][1] = 'Zeigt öffentlich die Einträge einer Merkliste an, die per GET-Parameter übergeben wird.';
$GLOBALS['TL_LANG']['FMD'][ShareListModuleController::TYPE][0] = 'Teilen-Liste (Merkliste)';
$GLOBALS['TL_LANG']['FMD'][ShareListModuleController::TYPE][1] = 'Zeigt öffentlich die Einträge einer Merkliste an, die per GET-Parameter übergeben wird.';
4 changes: 3 additions & 1 deletion src/Resources/contao/languages/de/tl_watchlist_config.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

use HeimrichHannot\WatchlistBundle\Controller\FrontendModule\ShareListModuleController;

/*
* Copyright (c) 2021 Heimrich & Hannot GmbH
*
Expand Down Expand Up @@ -29,7 +31,7 @@
$lang['addShare'][1] = 'Wählen Sie diese Option, um das Teilen von Merklisten zu erlauben.';

$lang['shareJumpTo'][0] = 'Weiterleitungsseite';
$lang['shareJumpTo'][1] = 'Wählen Sie hier die Basisseite für die Teilen-Links aus. Diese Seite muss ein Modul vom Typ "'.$GLOBALS['TL_LANG']['FMD'][\HeimrichHannot\WatchlistBundle\Controller\FrontendModule\ShareListModuleController::TYPE][0].'" enthalten.';
$lang['shareJumpTo'][1] = 'Wählen Sie hier die Basisseite für die Teilen-Links aus. Diese Seite muss ein Modul vom Typ "'.$GLOBALS['TL_LANG']['FMD'][ShareListModuleController::TYPE][0].'" enthalten.';

/*
* Legends
Expand Down
6 changes: 4 additions & 2 deletions src/Resources/contao/languages/de/tl_watchlist_item.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

use HeimrichHannot\WatchlistBundle\DataContainer\WatchlistItemContainer;

/*
* Copyright (c) 2021 Heimrich & Hannot GmbH
*
Expand Down Expand Up @@ -51,8 +53,8 @@
* Reference
*/
$lang['reference'] = [
\HeimrichHannot\WatchlistBundle\DataContainer\WatchlistItemContainer::TYPE_FILE => 'Datei',
\HeimrichHannot\WatchlistBundle\DataContainer\WatchlistItemContainer::TYPE_ENTITY => 'Datenbank-Entität',
WatchlistItemContainer::TYPE_FILE => 'Datei',
WatchlistItemContainer::TYPE_ENTITY => 'Datenbank-Entität',
];

/*
Expand Down
3 changes: 3 additions & 0 deletions tools/rector/rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@
])
// uncomment to reach your current PHP version
// ->withPhpSets()
->withImportNames(true, true,false, true)
// ->withCodeQualityLevel()
->withRules([
AddVoidReturnTypeWhereNoReturnRector::class,
// \Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictConstructorRector::class,
])
->withSets([
SetList::PHP_74,
Expand Down

0 comments on commit e174adb

Please sign in to comment.