Skip to content

Commit

Permalink
Merge pull request #23 from AOEpeople/feature/TYPO3_12
Browse files Browse the repository at this point in the history
feat: TYPO3 v12 compatibility
  • Loading branch information
aoekrz authored Oct 7, 2024
2 parents 84cdccd + 78fb3c9 commit 12692b1
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 50 deletions.
6 changes: 4 additions & 2 deletions .code-quality/phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ parameters:
paths:
- "../Classes/"

ignoreErrors:
- identifier: missingType.iterableValue
- identifier: missingType.generics

inferPrivatePropertyTypeFromConstructor: true
checkMissingIterableValueType: false
checkGenericClassInNonGenericObjectType: false

services:
-
Expand Down
2 changes: 0 additions & 2 deletions .code-quality/rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -33,7 +32,6 @@
PHPUnitSetList::PHPUNIT_CODE_QUALITY
])
->withSkip([
ChangeAndIfToEarlyReturnRector::class,
TypedPropertyFromStrictSetUpRector::class,
AddMethodCallBasedStrictParamTypeRector::class,
FlipTypeControlToUseExclusiveTypeRector::class,
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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' ]

Expand Down
7 changes: 5 additions & 2 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
build:
nodes:
analysis:
image: default-bionic
environment:
php: 8.3.0
tests:
override:
- php-scrutinizer-run
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion Configuration/Services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ services:
AOE\HappyFeet\Domain\Repository\FootnoteRepository:

AOE\HappyFeet\Typo3\Hook\HappyFeetLinkWizzard:
public: true
public: true
17 changes: 6 additions & 11 deletions Configuration/TCA/tx_happyfeet_domain_model_footnote.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' => [
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)

Expand All @@ -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

Expand Down
4 changes: 2 additions & 2 deletions Tests/Unit/Typo3/Hooks/TcemainTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
18 changes: 8 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@
}
],
"require": {
"php": ">8.0",
"php": "^8.1",
"ext-pdo": "*",
"typo3/cms-core": "^11.5 || ^12.4",
"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": [
Expand Down Expand Up @@ -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"
Expand All @@ -106,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",
Expand Down
4 changes: 2 additions & 2 deletions ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' => [],
Expand Down
4 changes: 0 additions & 4 deletions ext_localconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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;
8 changes: 1 addition & 7 deletions ext_tables.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
<?php
defined('TYPO3') or die();

// configure range of endtime here (and NOT in Configuration/TCA/[tablename].php), because the configuration-data is not cacheable!
$GLOBALS['TCA']['tx_happyfeet_domain_model_footnote']['columns']['endtime']['config']['range'] = [
'upper' => mktime(0, 0, 0, 12, 31, date('Y') + 10),
'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;

0 comments on commit 12692b1

Please sign in to comment.