Skip to content

Commit

Permalink
backport some 2.x improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
fritzmg committed Jun 7, 2024
1 parent 5500467 commit 99f238c
Show file tree
Hide file tree
Showing 59 changed files with 298 additions and 360 deletions.
79 changes: 0 additions & 79 deletions .php-cs-fixer.dist.php

This file was deleted.

24 changes: 12 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
}
],
"require": {
"php": ">=7.1",
"php": ">=8.1",
"ext-json": "*",
"contao/core-bundle": "^4.13 || ^5.0",
"contao/calendar-bundle": "^4.13 || ^5.0",
Expand All @@ -32,16 +32,15 @@
"inspiredminds/contao-backend-forms": ">=0.3, <2",
"league/csv": "^9.6",
"ramsey/uuid": "^3.0 || ^4.0",
"symfony/config": "^5.1 || ^6.0",
"symfony/dependency-injection": "^5.1 || ^6.0",
"symfony/http-foundation": "^5.1 || ^6.0",
"symfony/http-kernel": "^5.1 || ^6.0",
"symfony/routing": "^5.1 || ^6.0",
"symfony/security-core": "^5.1 || ^6.0",
"symfony/translation": "^5.1 || ^6.0",
"symfony/config": "^5.4 || ^6.4",
"symfony/dependency-injection": "^5.4 || ^6.4",
"symfony/http-foundation": "^5.4 || ^6.4",
"symfony/http-kernel": "^5.4 || ^6.4",
"symfony/routing": "^5.4 || ^6.4",
"symfony/security-core": "^5.4 || ^6.4",
"symfony/translation": "^5.4 || ^6.4",
"terminal42/contao-node": "^1.3",
"terminal42/notification_center": "^1.5",
"terminal42/service-annotation-bundle": "^1.1",
"symfony/polyfill-php80": "^1.28"
},
"autoload": {
Expand All @@ -53,15 +52,16 @@
"contao-manager-plugin": "InspiredMinds\\ContaoEventRegistration\\ContaoManager\\Plugin"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.0",
"contao/manager-plugin": "^2.11"
"contao/easy-coding-standard": "^6.0",
"contao/rector": "^1.0"
},
"config": {
"allow-plugins": {
"contao-components/installer": true,
"contao-community-alliance/composer-plugin": true,
"contao/manager-plugin": true,
"php-http/discovery": false
"php-http/discovery": false,
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
2 changes: 1 addition & 1 deletion src/Resources/config/routes.yaml → config/routes.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
im_contao_event_registration:
resource: ../../Controller
resource: ../src/Controller
type: annotation
4 changes: 2 additions & 2 deletions src/Resources/config/services.yaml → config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ services:
$bundles: '%kernel.bundles%'

InspiredMinds\ContaoEventRegistration\:
resource: ../../
exclude: ../../{Model,DependencyInjection,Resources}
resource: ../src/
exclude: ../src/{Config,ContaoManager,DependencyInjection,Exception,Model}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* This file is part of the Contao Event Registration extension.
*
* (c) inspiredminds
* (c) INSPIRED MINDS
*
* @license LGPL-3.0-or-later
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* This file is part of the Contao Event Registration extension.
*
* (c) inspiredminds
* (c) INSPIRED MINDS
*
* @license LGPL-3.0-or-later
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* This file is part of the Contao Event Registration extension.
*
* (c) inspiredminds
* (c) INSPIRED MINDS
*
* @license LGPL-3.0-or-later
*/
Expand Down Expand Up @@ -71,7 +71,7 @@
$GLOBALS['TL_DCA']['tl_calendar_events']['subpalettes']['reg_enable'] = 'reg_form,reg_min,reg_max,reg_regEnd,reg_cancelEnd,reg_requireConfirm';

foreach ($GLOBALS['TL_DCA']['tl_calendar_events']['palettes'] as $name => $palette) {
if (!\is_string($palette)) {
if (!is_string($palette)) {
continue;
}

Expand All @@ -84,9 +84,9 @@

$GLOBALS['TL_DCA']['tl_calendar_events']['config']['ctable'][] = 'tl_event_registration';

$GLOBALS['TL_DCA']['tl_calendar_events']['list']['operations'] = \array_slice($GLOBALS['TL_DCA']['tl_calendar_events']['list']['operations'], 0, 6, true) + [
$GLOBALS['TL_DCA']['tl_calendar_events']['list']['operations'] = array_slice($GLOBALS['TL_DCA']['tl_calendar_events']['list']['operations'], 0, 6, true) + [
'registrations' => [
'href' => 'table=tl_event_registration',
'icon' => 'mgroup.svg',
],
] + \array_slice($GLOBALS['TL_DCA']['tl_calendar_events']['list']['operations'], 6, \count($GLOBALS['TL_DCA']['tl_calendar_events']['list']['operations']) - 1, true);
] + array_slice($GLOBALS['TL_DCA']['tl_calendar_events']['list']['operations'], 6, count($GLOBALS['TL_DCA']['tl_calendar_events']['list']['operations']) - 1, true);
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@
/*
* This file is part of the Contao Event Registration extension.
*
* (c) inspiredminds
* (c) INSPIRED MINDS
*
* @license LGPL-3.0-or-later
*/

use Contao\DC_Table;
use InspiredMinds\ContaoEventRegistration\Controller\EventRegistrationExportController;

$GLOBALS['TL_DCA']['tl_event_registration'] = [
'config' => [
'dataContainer' => 'Table',
'dataContainer' => DC_Table::class,
'ptable' => 'tl_calendar_events',
'closed' => true,
'doNotCopyRecords' => true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* This file is part of the Contao Event Registration extension.
*
* (c) inspiredminds
* (c) INSPIRED MINDS
*
* @license LGPL-3.0-or-later
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* This file is part of the Contao Event Registration extension.
*
* (c) inspiredminds
* (c) INSPIRED MINDS
*
* @license LGPL-3.0-or-later
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* This file is part of the Contao Event Registration extension.
*
* (c) inspiredminds
* (c) INSPIRED MINDS
*
* @license LGPL-3.0-or-later
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* This file is part of the Contao Event Registration extension.
*
* (c) inspiredminds
* (c) INSPIRED MINDS
*
* @license LGPL-3.0-or-later
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* This file is part of the Contao Event Registration extension.
*
* (c) inspiredminds
* (c) INSPIRED MINDS
*
* @license LGPL-3.0-or-later
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* This file is part of the Contao Event Registration extension.
*
* (c) inspiredminds
* (c) INSPIRED MINDS
*
* @license LGPL-3.0-or-later
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* This file is part of the Contao Event Registration extension.
*
* (c) inspiredminds
* (c) INSPIRED MINDS
*
* @license LGPL-3.0-or-later
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* This file is part of the Contao Event Registration extension.
*
* (c) inspiredminds
* (c) INSPIRED MINDS
*
* @license LGPL-3.0-or-later
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* This file is part of the Contao Event Registration extension.
*
* (c) inspiredminds
* (c) INSPIRED MINDS
*
* @license LGPL-3.0-or-later
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* This file is part of the Contao Event Registration extension.
*
* (c) inspiredminds
* (c) INSPIRED MINDS
*
* @license LGPL-3.0-or-later
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* This file is part of the Contao Event Registration extension.
*
* (c) inspiredminds
* (c) INSPIRED MINDS
*
* @license LGPL-3.0-or-later
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* This file is part of the Contao Event Registration extension.
*
* (c) inspiredminds
* (c) INSPIRED MINDS
*
* @license LGPL-3.0-or-later
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* This file is part of the Contao Event Registration extension.
*
* (c) inspiredminds
* (c) INSPIRED MINDS
*
* @license LGPL-3.0-or-later
*/
Expand Down
26 changes: 26 additions & 0 deletions ecs.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

declare(strict_types=1);

use Contao\EasyCodingStandard\Fixer\CommentLengthFixer;
use PhpCsFixer\Fixer\Comment\HeaderCommentFixer;
use Symplify\EasyCodingStandard\Config\ECSConfig;

return static function (ECSConfig $ecsConfig): void {
$ecsConfig->sets([__DIR__.'/vendor/contao/easy-coding-standard/config/contao.php']);

$ecsConfig->paths([
__DIR__.'/src',
__DIR__.'/contao',
]);

$ecsConfig->ruleWithConfiguration(HeaderCommentFixer::class, [
'header' => "This file is part of the Contao Event Registration extension.\n\n(c) INSPIRED MINDS\n\n@license LGPL-3.0-or-later",
]);

$ecsConfig->skip([CommentLengthFixer::class]);

$ecsConfig->parallel();
$ecsConfig->lineEnding("\n");
$ecsConfig->cacheDirectory(sys_get_temp_dir().'/ecs_default_cache');
};
File renamed without changes.
20 changes: 20 additions & 0 deletions rector.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\Php81\Rector\Array_\FirstClassCallableRector;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([__DIR__.'/vendor/contao/rector/config/contao.php']);

$rectorConfig->paths([
__DIR__.'/src',
__DIR__.'/contao',
]);

$rectorConfig->skip([FirstClassCallableRector::class]);

$rectorConfig->parallel();
$rectorConfig->cacheDirectory(sys_get_temp_dir().'/rector_cache');
};
Loading

0 comments on commit 99f238c

Please sign in to comment.