From 67de09b26344a0b1326cad7c7e2e092bf786b41f Mon Sep 17 00:00:00 2001 From: Clemens Queissner Date: Mon, 2 Sep 2024 13:01:28 +0200 Subject: [PATCH 1/5] chore: CD-327361 Added TYPO3 12 support, removed some deprecations and fixed code-style --- .code-quality/phpstan.neon | 6 ++++-- .code-quality/rector.php | 2 -- .github/workflows/tests.yml | 2 +- Configuration/Services.yaml | 2 +- Tests/Unit/Typo3/Hooks/TcemainTest.php | 4 ++-- composer.json | 6 ++---- ext_emconf.php | 4 ++-- ext_localconf.php | 4 ---- ext_tables.php | 2 +- 9 files changed, 13 insertions(+), 19 deletions(-) diff --git a/.code-quality/phpstan.neon b/.code-quality/phpstan.neon index 09d8aa9..441fdca 100644 --- a/.code-quality/phpstan.neon +++ b/.code-quality/phpstan.neon @@ -8,9 +8,11 @@ parameters: paths: - "../Classes/" + ignoreErrors: + - identifier: missingType.iterableValue + - identifier: missingType.generics + inferPrivatePropertyTypeFromConstructor: true - checkMissingIterableValueType: false - checkGenericClassInNonGenericObjectType: false services: - diff --git a/.code-quality/rector.php b/.code-quality/rector.php index 44bcb72..f596b03 100644 --- a/.code-quality/rector.php +++ b/.code-quality/rector.php @@ -5,7 +5,6 @@ use Rector\CodeQuality\Rector\Identical\FlipTypeControlToUseExclusiveTypeRector; use Rector\Config\RectorConfig; use Rector\DeadCode\Rector\Property\RemoveUnusedPrivatePropertyRector; -use Rector\EarlyReturn\Rector\If_\ChangeAndIfToEarlyReturnRector; use Rector\Set\ValueObject\SetList; use Rector\PHPUnit\CodeQuality\Rector\Class_\YieldDataProviderRector; use Rector\PHPUnit\Set\PHPUnitSetList; @@ -33,7 +32,6 @@ PHPUnitSetList::PHPUNIT_CODE_QUALITY ]) ->withSkip([ - ChangeAndIfToEarlyReturnRector::class, TypedPropertyFromStrictSetUpRector::class, AddMethodCallBasedStrictParamTypeRector::class, FlipTypeControlToUseExclusiveTypeRector::class, diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7fd0f0d..b879f79 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - typo3: [ ^11.5, ^12.4 ] + typo3: [ ^12.4 ] php: [ '8.1', '8.2', '8.3' ] mysql: [ '5.7' ] diff --git a/Configuration/Services.yaml b/Configuration/Services.yaml index bde78b8..901b7d0 100644 --- a/Configuration/Services.yaml +++ b/Configuration/Services.yaml @@ -16,4 +16,4 @@ services: AOE\HappyFeet\Domain\Repository\FootnoteRepository: AOE\HappyFeet\Typo3\Hook\HappyFeetLinkWizzard: - public: true + public: true \ No newline at end of file diff --git a/Tests/Unit/Typo3/Hooks/TcemainTest.php b/Tests/Unit/Typo3/Hooks/TcemainTest.php index 4351492..4dd5d54 100644 --- a/Tests/Unit/Typo3/Hooks/TcemainTest.php +++ b/Tests/Unit/Typo3/Hooks/TcemainTest.php @@ -47,12 +47,12 @@ class TcemainTest extends UnitTestCase /** * @var DataHandler */ - protected $dataHandler; + protected MockObject $dataHandler; /** * @var FootnoteRepository|MockObject */ - protected $footnoteRepository; + protected MockObject $footnoteRepository; protected function setUp(): void { diff --git a/composer.json b/composer.json index 99edb61..4f427b9 100755 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ "require": { "php": ">8.0", "ext-pdo": "*", - "typo3/cms-core": "^11.5 || ^12.4", + "typo3/cms-core": "^12.4", "typo3/cms-extbase": "*" }, "require-dev": { @@ -82,11 +82,9 @@ "./.Build/bin/phpstan analyse -c .code-quality/phpstan.neon --memory-limit=1G --generate-baseline" ], "code-compatibility": [ - "[ -e ./.Build/vendor/symplify/easy-coding-standard/vendor/squizlabs/php_codesniffer/bin/phpcs ] || composer install", + "[ -e ./.Build/vendor/symplify/easy-coding-standard/vendor/squizlabs/php_codesniffer/bin/phpcs ] || composer update", "[ -d ./reports/php_checkstyle ] || mkdir -p reports/php_checkstyle/", "./.code-quality/configure-checkstyle.sh", - "./.Build/vendor/symplify/easy-coding-standard/vendor/squizlabs/php_codesniffer/bin/phpcs -d memory_limit=1G --standard=PHPCompatibility --colors --ignore=*/.Build/* -p . --runtime-set testVersion 7.4", - "./.Build/vendor/symplify/easy-coding-standard/vendor/squizlabs/php_codesniffer/bin/phpcs -d memory_limit=1G --standard=PHPCompatibility --colors --ignore=*/.Build/* -p . --runtime-set testVersion 8.0", "./.Build/vendor/symplify/easy-coding-standard/vendor/squizlabs/php_codesniffer/bin/phpcs -d memory_limit=1G --standard=PHPCompatibility --colors --ignore=*/.Build/* -p . --runtime-set testVersion 8.1", "./.Build/vendor/symplify/easy-coding-standard/vendor/squizlabs/php_codesniffer/bin/phpcs -d memory_limit=1G --standard=PHPCompatibility --colors --ignore=*/.Build/* -p . --runtime-set testVersion 8.2", "./.Build/vendor/symplify/easy-coding-standard/vendor/squizlabs/php_codesniffer/bin/phpcs -d memory_limit=1G --standard=PHPCompatibility --colors --ignore=*/.Build/* -p . --runtime-set testVersion 8.3" diff --git a/ext_emconf.php b/ext_emconf.php index 0ffdd65..6908d53 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -19,10 +19,10 @@ 'clearCacheOnLoad' => 0, 'lockType' => '', 'author_company' => 'AOE GmbH', - 'version' => '11.3.5', + 'version' => '12.0.0', 'constraints' => [ 'depends' => [ - 'typo3' => '11.5.0-11.5.99', + 'typo3' => '12.4.0-12.4.99', ], 'conflicts' => [], 'suggests' => [], diff --git a/ext_localconf.php b/ext_localconf.php index 87db85a..da722d7 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -2,7 +2,6 @@ use AOE\HappyFeet\Typo3\Hook\LinkHandler; use AOE\HappyFeet\Typo3\Hook\LinkRenderer; -use AOE\HappyFeet\Typo3\Hook\Tcemain; use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; defined('TYPO3') or die(); @@ -15,8 +14,5 @@ "@import 'EXT:happy_feet/Configuration/TsConfig/Page/TceMain.tsconfig'" ); -#$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass']['happy_feet'] = -# Tcemain::class; - $GLOBALS['TYPO3_CONF_VARS']['FE']['typolinkBuilder']['happy_feet'] = LinkRenderer::class; $GLOBALS['TYPO3_CONF_VARS']['SYS']['linkHandler']['happy_feet'] = LinkHandler::class; diff --git a/ext_tables.php b/ext_tables.php index 98022fc..9ab9bef 100644 --- a/ext_tables.php +++ b/ext_tables.php @@ -7,4 +7,4 @@ 'lower' => mktime(0, 0, 0, date('m') - 1, date('d'), date('Y')) ]; -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_happyfeet_domain_model_footnote'); +$GLOBALS['TCA']['tx_happyfeet_domain_model_footnote']['ctrl']['security']['ignorePageTypeRestriction'] = true; \ No newline at end of file From 1d3ad27dc9a003a8f94f70e365dbfa8abd26e3d0 Mon Sep 17 00:00:00 2001 From: Christian Krzeminski Date: Fri, 13 Sep 2024 12:36:07 +0200 Subject: [PATCH 2/5] chore: dependencies --- README.md | 12 ++++++------ composer.json | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 5c35347..414853c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # happy_feet -[![Build Status](https://github.com/AOEpeople/happy_feet/workflows/CI/badge.svg?branch=main)](https://github.com/AOEpeople/happy_feet/actions) +[![Build Status](https://github.com/AOEpeople/happy_feet/actions/workflows/tests.yml/badge.svg)](https://github.com/AOEpeople/happy_feet/actions) [![Code Coverage](https://scrutinizer-ci.com/g/AOEpeople/happy_feet/badges/coverage.png?b=main)](https://scrutinizer-ci.com/g/AOEpeople/happy_feet/?branch=main) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/AOEpeople/happy_feet/badges/quality-score.png?b=main)](https://scrutinizer-ci.com/g/AOEpeople/happy_feet/?branch=main) @@ -20,11 +20,11 @@ The documentation is available online at [docs.typo3.org][2]. ## Versions and Support -| Release | TYPO3 | PHP | Fixes will contain -|---------|----------|---------|--------------------| -| 11.x.y | 11.5 | 7.4-8.3 | Features, Bugfixes, Security Updates -| 8.3.y | 8.7-10.4 | 7.2-7.4 | Security Updates -| 5.x.y | 7.6 | 5.5-5.6 | End of life +| Release | TYPO3 | PHP | Fixes will contain | +|---------|----------|---------|--------------------------------------| +| 12.x.y | 12.4 | 8.1-8.3 | Features, Bugfixes, Security Updates | +| 11.x.y | 11.5 | 7.4-8.0 | Security Updates | +| 8.x.y | 8.7 | 7.2-7.4 | End of life | ## Copyright / License diff --git a/composer.json b/composer.json index 4f427b9..db3cdd3 100755 --- a/composer.json +++ b/composer.json @@ -17,19 +17,19 @@ } ], "require": { - "php": ">8.0", + "php": "^8.1", "ext-pdo": "*", "typo3/cms-core": "^12.4", "typo3/cms-extbase": "*" }, "require-dev": { - "phpunit/phpcov": "^8.0 || ^9.0", - "typo3/testing-framework": "^7.0 || ^8.0", + "phpunit/phpcov": "^9.0", + "typo3/testing-framework": "^8.0", "phpcompatibility/php-compatibility": "^9.3", "phpstan/phpstan": "^1.10", "rector/rector": "^1.0", - "symplify/easy-coding-standard": "12.1.14", - "symplify/phpstan-rules": "12.4.8" + "symplify/easy-coding-standard": "^12.1", + "symplify/phpstan-rules": "^13.0.0" }, "autoload": { "classmap": [ @@ -104,7 +104,7 @@ }, "extra": { "branch-alias": { - "dev-main": "11.1.x-dev" + "dev-main": "12.0.x-dev" }, "typo3/cms": { "cms-package-dir": "{$vendor-dir}/typo3/cms", From bbe1635fec9d95228003c1c08874bb45ee6e7f71 Mon Sep 17 00:00:00 2001 From: Christian Krzeminski Date: Fri, 13 Sep 2024 12:45:27 +0200 Subject: [PATCH 3/5] fix: scrutinizer config --- .scrutinizer.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.scrutinizer.yml b/.scrutinizer.yml index a9b4ede..ed51821 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -1,6 +1,9 @@ build: nodes: analysis: + image: default-bionic + environment: + php: 8.3.0 tests: override: - php-scrutinizer-run @@ -15,14 +18,14 @@ filter: tools: external_code_coverage: - timeout: 700 + timeout: 1200 runs: 1 php_cpd: enabled: true php_code_sniffer: enabled: true config: - standard: TYPO3CMS + standard: PSR2 php_cs_fixer: enabled: true php_hhvm: From b2939685b7f3bfe20dbdafd98542e47511e7c18e Mon Sep 17 00:00:00 2001 From: Christian Krzeminski Date: Tue, 24 Sep 2024 11:25:34 +0200 Subject: [PATCH 4/5] fix: tca config --- .../TCA/tx_happyfeet_domain_model_footnote.php | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/Configuration/TCA/tx_happyfeet_domain_model_footnote.php b/Configuration/TCA/tx_happyfeet_domain_model_footnote.php index 3219cef..60ca84f 100644 --- a/Configuration/TCA/tx_happyfeet_domain_model_footnote.php +++ b/Configuration/TCA/tx_happyfeet_domain_model_footnote.php @@ -70,25 +70,20 @@ 'exclude' => 1, 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.starttime', 'config' => [ - 'type' => 'input', - 'renderType' => 'datetime', - 'size' => '8', - 'eval' => 'date', + 'type' => 'datetime', + 'format' => 'date', + 'size' => '20', 'default' => '0', - 'checkbox' => '0' ] ], 'endtime' => [ 'exclude' => 1, 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.endtime', 'config' => [ - 'type' => 'input', - 'renderType' => 'datetime', - 'size' => '8', - 'eval' => 'date', - 'checkbox' => '0', + 'type' => 'datetime', + 'format' => 'date', + 'size' => '20', 'default' => '0', - 'range' => 'must be configured in ext_tables.php, behause the configuration-data is not cacheable!' ] ], 'index_number' => [ From 78fb3c9c263722ef969d875ddf63fe79e459c66f Mon Sep 17 00:00:00 2001 From: Christian Krzeminski Date: Tue, 24 Sep 2024 13:36:00 +0200 Subject: [PATCH 5/5] fix: broken range config --- ext_tables.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/ext_tables.php b/ext_tables.php index 9ab9bef..bf008f2 100644 --- a/ext_tables.php +++ b/ext_tables.php @@ -1,10 +1,4 @@ mktime(0, 0, 0, 12, 31, date('Y') + 10), - 'lower' => mktime(0, 0, 0, date('m') - 1, date('d'), date('Y')) -]; - -$GLOBALS['TCA']['tx_happyfeet_domain_model_footnote']['ctrl']['security']['ignorePageTypeRestriction'] = true; \ No newline at end of file +$GLOBALS['TCA']['tx_happyfeet_domain_model_footnote']['ctrl']['security']['ignorePageTypeRestriction'] = true;