From 70a76f7a76c35ba446ff358ba89947cd95dd2828 Mon Sep 17 00:00:00 2001
From: Daniel Siepmann <coding@daniel-siepmann.de>
Date: Mon, 3 Feb 2025 12:27:27 +0100
Subject: [PATCH] [!!!][TASK] Drop support for PHP < 8.1 (#1576)

As this is not supported by current TYPO3 LTS versions.

Resolves: #1566
---
 .github/workflows/ci.yml                      | 26 -------------------
 .../pipeline/jobs/func-php7.4-v11-highest.yml | 14 ----------
 .../pipeline/jobs/func-php7.4-v11-lowest.yml  | 14 ----------
 .../pipeline/jobs/func-php8.0-v11-highest.yml | 14 ----------
 .../pipeline/jobs/func-php8.0-v11-lowest.yml  | 14 ----------
 .gitlab/pipeline/jobs/php-lint-php7.4.yml     |  7 -----
 .gitlab/pipeline/jobs/php-lint-php8.0.yml     |  7 -----
 .../pipeline/jobs/unit-php7.4-v11-highest.yml | 12 ---------
 .../pipeline/jobs/unit-php7.4-v11-lowest.yml  | 12 ---------
 .../pipeline/jobs/unit-php8.0-v11-highest.yml | 12 ---------
 .../pipeline/jobs/unit-php8.0-v11-lowest.yml  | 12 ---------
 Build/Scripts/runTests.sh                     |  6 ++---
 composer.json                                 |  2 +-
 ext_emconf.php                                |  2 +-
 rector.php                                    |  2 +-
 15 files changed, 5 insertions(+), 151 deletions(-)
 delete mode 100644 .gitlab/pipeline/jobs/func-php7.4-v11-highest.yml
 delete mode 100644 .gitlab/pipeline/jobs/func-php7.4-v11-lowest.yml
 delete mode 100644 .gitlab/pipeline/jobs/func-php8.0-v11-highest.yml
 delete mode 100644 .gitlab/pipeline/jobs/func-php8.0-v11-lowest.yml
 delete mode 100644 .gitlab/pipeline/jobs/php-lint-php7.4.yml
 delete mode 100644 .gitlab/pipeline/jobs/php-lint-php8.0.yml
 delete mode 100644 .gitlab/pipeline/jobs/unit-php7.4-v11-highest.yml
 delete mode 100644 .gitlab/pipeline/jobs/unit-php7.4-v11-lowest.yml
 delete mode 100644 .gitlab/pipeline/jobs/unit-php8.0-v11-highest.yml
 delete mode 100644 .gitlab/pipeline/jobs/unit-php8.0-v11-lowest.yml

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index e59e02a..762d36b 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -41,8 +41,6 @@ jobs:
       fail-fast: false
       matrix:
         php-version:
-          - "7.4"
-          - "8.0"
           - "8.1"
           - "8.2"
           - "8.3"
@@ -159,18 +157,6 @@ jobs:
       fail-fast: false
       matrix:
         include:
-          - typo3-version: "^11.5"
-            php-version: "7.4"
-            composer-dependencies: lowest
-          - typo3-version: "^11.5"
-            php-version: "7.4"
-            composer-dependencies: highest
-          - typo3-version: "^11.5"
-            php-version: "8.0"
-            composer-dependencies: lowest
-          - typo3-version: "^11.5"
-            php-version: "8.0"
-            composer-dependencies: highest
           - typo3-version: "^11.5"
             php-version: "8.1"
             composer-dependencies: lowest
@@ -266,18 +252,6 @@ jobs:
       fail-fast: false
       matrix:
         include:
-          - typo3-version: "^11.5"
-            php-version: "7.4"
-            composer-dependencies: lowest
-          - typo3-version: "^11.5"
-            php-version: "7.4"
-            composer-dependencies: highest
-          - typo3-version: "^11.5"
-            php-version: "8.0"
-            composer-dependencies: lowest
-          - typo3-version: "^11.5"
-            php-version: "8.0"
-            composer-dependencies: highest
           - typo3-version: "^11.5"
             php-version: "8.1"
             composer-dependencies: lowest
diff --git a/.gitlab/pipeline/jobs/func-php7.4-v11-highest.yml b/.gitlab/pipeline/jobs/func-php7.4-v11-highest.yml
deleted file mode 100644
index 68f6353..0000000
--- a/.gitlab/pipeline/jobs/func-php7.4-v11-highest.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-func-php7.4-v11-highest:
-  extends: .default
-  image: ghcr.io/typo3/core-testing-php74:latest
-  services:
-    - mariadb:10
-  stage: test
-  needs:
-    - build-composer-dependencies
-    - php-lint-php7.4
-  script:
-    - echo "Job ${CI_JOB_NAME}"
-    - composer require --no-ansi --no-interaction --no-progress --no-install typo3/cms-core:"^11.5"
-    - composer update --no-ansi --no-interaction --no-progress --with-dependencies
-    - composer ci:tests:functional
diff --git a/.gitlab/pipeline/jobs/func-php7.4-v11-lowest.yml b/.gitlab/pipeline/jobs/func-php7.4-v11-lowest.yml
deleted file mode 100644
index d87b592..0000000
--- a/.gitlab/pipeline/jobs/func-php7.4-v11-lowest.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-func-php7.4-v11-lowest:
-  extends: .default
-  image: ghcr.io/typo3/core-testing-php74:latest
-  services:
-    - mariadb:10
-  stage: test
-  needs:
-    - build-composer-dependencies
-    - php-lint-php7.4
-  script:
-    - echo "Job ${CI_JOB_NAME}"
-    - composer require --no-ansi --no-interaction --no-progress --no-install typo3/cms-core:"^11.5"
-    - composer update --no-ansi --no-interaction --no-progress --with-dependencies --prefer-lowest
-    - composer ci:tests:functional
diff --git a/.gitlab/pipeline/jobs/func-php8.0-v11-highest.yml b/.gitlab/pipeline/jobs/func-php8.0-v11-highest.yml
deleted file mode 100644
index 4b819fd..0000000
--- a/.gitlab/pipeline/jobs/func-php8.0-v11-highest.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-func-php8.0-v11-highest:
-  extends: .default
-  image: ghcr.io/typo3/core-testing-php80:latest
-  services:
-    - mariadb:10
-  stage: test
-  needs:
-    - build-composer-dependencies
-    - php-lint-php8.0
-  script:
-    - echo "Job ${CI_JOB_NAME}"
-    - composer require --no-ansi --no-interaction --no-progress --no-install typo3/cms-core:"^11.5"
-    - composer update --no-ansi --no-interaction --no-progress --with-dependencies
-    - composer ci:tests:functional
diff --git a/.gitlab/pipeline/jobs/func-php8.0-v11-lowest.yml b/.gitlab/pipeline/jobs/func-php8.0-v11-lowest.yml
deleted file mode 100644
index 14b0571..0000000
--- a/.gitlab/pipeline/jobs/func-php8.0-v11-lowest.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-func-php8.0-v11-lowest:
-  extends: .default
-  image: ghcr.io/typo3/core-testing-php80:latest
-  services:
-    - mariadb:10
-  stage: test
-  needs:
-    - build-composer-dependencies
-    - php-lint-php8.0
-  script:
-    - echo "Job ${CI_JOB_NAME}"
-    - composer require --no-ansi --no-interaction --no-progress --no-install typo3/cms-core:"^11.5"
-    - composer update --no-ansi --no-interaction --no-progress --with-dependencies --prefer-lowest
-    - composer ci:tests:functional
diff --git a/.gitlab/pipeline/jobs/php-lint-php7.4.yml b/.gitlab/pipeline/jobs/php-lint-php7.4.yml
deleted file mode 100644
index 03bff54..0000000
--- a/.gitlab/pipeline/jobs/php-lint-php7.4.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-php-lint-php7.4:
-  extends: .composer-update
-  image: ghcr.io/typo3/core-testing-php74:latest
-  stage: lint
-  needs: [ ]
-  script:
-    - composer ci:php:lint
diff --git a/.gitlab/pipeline/jobs/php-lint-php8.0.yml b/.gitlab/pipeline/jobs/php-lint-php8.0.yml
deleted file mode 100644
index bb24279..0000000
--- a/.gitlab/pipeline/jobs/php-lint-php8.0.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-php-lint-php8.0:
-  extends: .composer-update
-  image: ghcr.io/typo3/core-testing-php80:latest
-  stage: lint
-  needs: [ ]
-  script:
-    - composer ci:php:lint
diff --git a/.gitlab/pipeline/jobs/unit-php7.4-v11-highest.yml b/.gitlab/pipeline/jobs/unit-php7.4-v11-highest.yml
deleted file mode 100644
index e440b26..0000000
--- a/.gitlab/pipeline/jobs/unit-php7.4-v11-highest.yml
+++ /dev/null
@@ -1,12 +0,0 @@
-unit-php7.4-v11-highest:
-  extends: .default
-  image: ghcr.io/typo3/core-testing-php74:latest
-  stage: test
-  needs:
-    - build-composer-dependencies
-    - php-lint-php7.4
-  script:
-    - echo "Job ${CI_JOB_NAME}"
-    - composer require --no-ansi --no-interaction --no-progress --no-install typo3/cms-core:"^11.5"
-    - composer update --no-ansi --no-interaction --no-progress --with-dependencies
-    - composer ci:tests:unit
diff --git a/.gitlab/pipeline/jobs/unit-php7.4-v11-lowest.yml b/.gitlab/pipeline/jobs/unit-php7.4-v11-lowest.yml
deleted file mode 100644
index 1408415..0000000
--- a/.gitlab/pipeline/jobs/unit-php7.4-v11-lowest.yml
+++ /dev/null
@@ -1,12 +0,0 @@
-unit-php7.4-v11-lowest:
-  extends: .default
-  image: ghcr.io/typo3/core-testing-php74:latest
-  stage: test
-  needs:
-    - build-composer-dependencies
-    - php-lint-php7.4
-  script:
-    - echo "Job ${CI_JOB_NAME}"
-    - composer require --no-ansi --no-interaction --no-progress --no-install typo3/cms-core:"^11.5"
-    - composer update --no-ansi --no-interaction --no-progress --with-dependencies --prefer-lowest
-    - composer ci:tests:unit
diff --git a/.gitlab/pipeline/jobs/unit-php8.0-v11-highest.yml b/.gitlab/pipeline/jobs/unit-php8.0-v11-highest.yml
deleted file mode 100644
index fe68ecb..0000000
--- a/.gitlab/pipeline/jobs/unit-php8.0-v11-highest.yml
+++ /dev/null
@@ -1,12 +0,0 @@
-unit-php8.0-v11-highest:
-  extends: .default
-  image: ghcr.io/typo3/core-testing-php80:latest
-  stage: test
-  needs:
-    - build-composer-dependencies
-    - php-lint-php8.0
-  script:
-    - echo "Job ${CI_JOB_NAME}"
-    - composer require --no-ansi --no-interaction --no-progress --no-install typo3/cms-core:"^11.5"
-    - composer update --no-ansi --no-interaction --no-progress --with-dependencies
-    - composer ci:tests:unit
diff --git a/.gitlab/pipeline/jobs/unit-php8.0-v11-lowest.yml b/.gitlab/pipeline/jobs/unit-php8.0-v11-lowest.yml
deleted file mode 100644
index 0293c3f..0000000
--- a/.gitlab/pipeline/jobs/unit-php8.0-v11-lowest.yml
+++ /dev/null
@@ -1,12 +0,0 @@
-unit-php8.0-v11-lowest:
-  extends: .default
-  image: ghcr.io/typo3/core-testing-php80:latest
-  stage: test
-  needs:
-    - build-composer-dependencies
-    - php-lint-php8.0
-  script:
-    - echo "Job ${CI_JOB_NAME}"
-    - composer require --no-ansi --no-interaction --no-progress --no-install typo3/cms-core:"^11.5"
-    - composer update --no-ansi --no-interaction --no-progress --with-dependencies --prefer-lowest
-    - composer ci:tests:unit
diff --git a/Build/Scripts/runTests.sh b/Build/Scripts/runTests.sh
index e16be97..ed3879f 100755
--- a/Build/Scripts/runTests.sh
+++ b/Build/Scripts/runTests.sh
@@ -229,10 +229,8 @@ Options:
             - 11.5: use TYPO3 v11 with typo3/cms-composer-installers ^3
             - 12.4: (default) use TYPO3 v12 with typo3/cms-composer-installers ^5
 
-    -p <7.4|8.0|8.1|8.2|8.3|8.4>
+    -p <8.1|8.2|8.3|8.4>
         Specifies the PHP minor version to be used
-            - 7.4: use PHP 7.4
-            - 8.0: use PHP 8.0
             - 8.1: use PHP 8.1
             - 8.2: use PHP 8.2
             - 8.3: (default) use PHP 8.3
@@ -367,7 +365,7 @@ while getopts "a:b:s:d:i:p:e:t:xy:o:nhu" OPT; do
             ;;
         p)
             PHP_VERSION=${OPTARG}
-            if ! [[ ${PHP_VERSION} =~ ^(7.4|8.0|8.1|8.2|8.3|8.4)$ ]]; then
+            if ! [[ ${PHP_VERSION} =~ ^(8.1|8.2|8.3|8.4)$ ]]; then
                 INVALID_OPTIONS+=("-p ${OPTARG}")
             fi
             ;;
diff --git a/composer.json b/composer.json
index 66d7faf..d5cf2ed 100644
--- a/composer.json
+++ b/composer.json
@@ -39,7 +39,7 @@
 		"docs": "https://docs.typo3.org/p/ttn/tea/main/en-us/"
 	},
 	"require": {
-		"php": "~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0",
+		"php": "~8.1.0 || ~8.2.0 || ~8.3.0",
 		"psr/http-message": "^1.0.1",
 		"typo3/cms-core": "^11.5.41 || ^12.4.26",
 		"typo3/cms-extbase": "^11.5.41 || ^12.4.26",
diff --git a/ext_emconf.php b/ext_emconf.php
index 18559e1..b41745f 100644
--- a/ext_emconf.php
+++ b/ext_emconf.php
@@ -7,7 +7,7 @@ $EM_CONF[$_EXTKEY] = [
     'category' => 'example',
     'constraints' => [
         'depends' => [
-            'php' => '7.4.0-8.3.99',
+            'php' => '8.1.0-8.3.99',
             'typo3' => '11.5.41-12.4.99',
             'extbase' => '11.5.41-12.4.99',
             'fluid' => '11.5.41-12.4.99',
diff --git a/rector.php b/rector.php
index f75a11b..aaaf1b0 100644
--- a/rector.php
+++ b/rector.php
@@ -95,7 +95,7 @@ return RectorConfig::configure()
     ])
     ->withImportNames(true, true, false)
     ->withConfiguredRule(ExtEmConfRector::class, [
-        ExtEmConfRector::PHP_VERSION_CONSTRAINT => '7.4.0-8.3.99',
+        ExtEmConfRector::PHP_VERSION_CONSTRAINT => '8.1.0-8.3.99',
         ExtEmConfRector::TYPO3_VERSION_CONSTRAINT => '11.5.41-12.4.99',
         ExtEmConfRector::ADDITIONAL_VALUES_TO_BE_REMOVED => [],
     ])