Skip to content

Commit 760dbf4

Browse files
authored
Merge pull request #7924 from kenjis/drop-php-7.4-CI45
Drop PHP 7.4 support
2 parents e6015fa + 83865ae commit 760dbf4

File tree

23 files changed

+38
-66
lines changed

23 files changed

+38
-66
lines changed

.github/workflows/test-coding-standards.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ jobs:
2828
fail-fast: false
2929
matrix:
3030
php-version:
31-
- '7.4'
3231
- '8.0'
32+
- '8.2'
3333

3434
steps:
3535
- name: Checkout

.github/workflows/test-phpunit.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ jobs:
5555
strategy:
5656
matrix:
5757
php-version:
58-
- '7.4'
5958
- '8.0'
6059
- '8.1'
6160
- '8.2'
@@ -85,7 +84,6 @@ jobs:
8584
fail-fast: false
8685
matrix:
8786
php-version:
88-
- '7.4'
8987
- '8.0'
9088
- '8.1'
9189
- '8.2'
@@ -99,7 +97,7 @@ jobs:
9997
mysql-version:
10098
- '5.7'
10199
include:
102-
- php-version: '7.4'
100+
- php-version: '8.0'
103101
db-platform: MySQLi
104102
mysql-version: '8.0'
105103
- php-version: '8.3'
@@ -127,7 +125,6 @@ jobs:
127125
strategy:
128126
matrix:
129127
php-version:
130-
- '7.4'
131128
- '8.0'
132129
- '8.1'
133130
- '8.2'
@@ -156,7 +153,6 @@ jobs:
156153
strategy:
157154
matrix:
158155
php-version:
159-
- '7.4'
160156
- '8.0'
161157
- '8.1'
162158
- '8.2'

.github/workflows/test-rector.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
strategy:
4646
fail-fast: false
4747
matrix:
48-
php-versions: ['7.4', '8.0']
48+
php-versions: ['8.0', '8.2']
4949
paths:
5050
- app
5151
- system

.php-cs-fixer.dist.php

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,10 @@
8080
8181
);
8282

83-
// @TODO: remove this check when support for PHP 7.4 is dropped
84-
if (PHP_VERSION_ID >= 80000) {
85-
$config
86-
->registerCustomFixers(FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'))
87-
->setRules(array_merge($config->getRules(), [
88-
NoCodeSeparatorCommentFixer::name() => true,
89-
]));
90-
}
83+
$config
84+
->registerCustomFixers(FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'))
85+
->setRules(array_merge($config->getRules(), [
86+
NoCodeSeparatorCommentFixer::name() => true,
87+
]));
9188

9289
return $config;

.php-cs-fixer.no-header.php

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,10 @@
6262

6363
$config = Factory::create(new CodeIgniter4(), $overrides, $options)->forProjects();
6464

65-
// @TODO: remove this check when support for PHP 7.4 is dropped
66-
if (PHP_VERSION_ID >= 80000) {
67-
$config
68-
->registerCustomFixers(FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'))
69-
->setRules(array_merge($config->getRules(), [
70-
NoCodeSeparatorCommentFixer::name() => true,
71-
]));
72-
}
65+
$config
66+
->registerCustomFixers(FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'))
67+
->setRules(array_merge($config->getRules(), [
68+
NoCodeSeparatorCommentFixer::name() => true,
69+
]));
7370

7471
return $config;

.php-cs-fixer.user-guide.php

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,10 @@
6767

6868
$config = Factory::create(new CodeIgniter4(), $overrides, $options)->forProjects();
6969

70-
// @TODO: remove this check when support for PHP 7.4 is dropped
71-
if (PHP_VERSION_ID >= 80000) {
72-
$config
73-
->registerCustomFixers(FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'))
74-
->setRules(array_merge($config->getRules(), [
75-
NoCodeSeparatorCommentFixer::name() => true,
76-
]));
77-
}
70+
$config
71+
->registerCustomFixers(FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'))
72+
->setRules(array_merge($config->getRules(), [
73+
NoCodeSeparatorCommentFixer::name() => true,
74+
]));
7875

7976
return $config;

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Made with [contrib.rocks](https://contrib.rocks).
8686

8787
## Server Requirements
8888

89-
PHP version 7.4 or higher is required, with the following extensions installed:
89+
PHP version 8.0 or higher is required, with the following extensions installed:
9090

9191
- [intl](http://php.net/manual/en/intl.requirements.php)
9292
- [mbstring](http://php.net/manual/en/mbstring.installation.php)

admin/framework/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Please read the [*Contributing to CodeIgniter*](https://github.com/codeigniter4/
4242

4343
## Server Requirements
4444

45-
PHP version 7.4 or higher is required, with the following extensions installed:
45+
PHP version 8.0 or higher is required, with the following extensions installed:
4646

4747
- [intl](http://php.net/manual/en/intl.requirements.php)
4848
- [mbstring](http://php.net/manual/en/mbstring.installation.php)

admin/framework/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"slack": "https://codeigniterchat.slack.com"
1111
},
1212
"require": {
13-
"php": "^7.4 || ^8.0",
13+
"php": "^8.0",
1414
"ext-intl": "*",
1515
"ext-json": "*",
1616
"ext-mbstring": "*",

admin/starter/.github/workflows/phpunit.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: PHPUnit
22

33
on:
44
pull_request:
5-
branches:
5+
branches:
66
- develop
77

88
jobs:
@@ -11,7 +11,7 @@ jobs:
1111

1212
strategy:
1313
matrix:
14-
php-versions: ['7.4', '8.0']
14+
php-versions: ['8.0', '8.2']
1515

1616
runs-on: ubuntu-latest
1717

admin/starter/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Problems with it can be raised on our forum, or as issues in the main repository
5050

5151
## Server Requirements
5252

53-
PHP version 7.4 or higher is required, with the following extensions installed:
53+
PHP version 8.0 or higher is required, with the following extensions installed:
5454

5555
- [intl](http://php.net/manual/en/intl.requirements.php)
5656
- [mbstring](http://php.net/manual/en/mbstring.installation.php)

admin/starter/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"slack": "https://codeigniterchat.slack.com"
1111
},
1212
"require": {
13-
"php": "^7.4 || ^8.0",
13+
"php": "^8.0",
1414
"codeigniter4/framework": "^4.0"
1515
},
1616
"require-dev": {

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"slack": "https://codeigniterchat.slack.com"
1111
},
1212
"require": {
13-
"php": "^7.4 || ^8.0",
13+
"php": "^8.0",
1414
"ext-intl": "*",
1515
"ext-json": "*",
1616
"ext-mbstring": "*",

contributing/pull_request.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ See [Contribution CSS](./css.md).
136136

137137
### Compatibility
138138

139-
CodeIgniter4 requires [PHP 7.4](https://php.net/releases/7_4_0.php).
139+
CodeIgniter4 requires [PHP 8.0](https://php.net/releases/8_0_0.php).
140140

141141
### Backwards Compatibility
142142

public/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
// Check PHP version.
4-
$minPhpVersion = '7.4'; // If you update this, don't forget to update `spark`.
4+
$minPhpVersion = '8.0'; // If you update this, don't forget to update `spark`.
55
if (version_compare(PHP_VERSION, $minPhpVersion, '<')) {
66
$message = sprintf(
77
'Your PHP version must be %s or higher to run CodeIgniter. Current version: %s',

spark

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ if (strpos(PHP_SAPI, 'cgi') === 0) {
2727
}
2828

2929
// Check PHP version.
30-
$minPhpVersion = '7.4'; // If you update this, don't forget to update `public/index.php`.
30+
$minPhpVersion = '8.0'; // If you update this, don't forget to update `public/index.php`.
3131
if (version_compare(PHP_VERSION, $minPhpVersion, '<')) {
3232
$message = sprintf(
3333
'Your PHP version must be %s or higher to run CodeIgniter. Current version: %s',

system/Autoloader/Autoloader.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -343,11 +343,7 @@ public function sanitizeFilename(string $filename): string
343343
);
344344
}
345345
if ($result === false) {
346-
if (version_compare(PHP_VERSION, '8.0.0', '>=')) {
347-
$message = preg_last_error_msg();
348-
} else {
349-
$message = 'Regex error. error code: ' . preg_last_error();
350-
}
346+
$message = preg_last_error_msg();
351347

352348
throw new RuntimeException($message . '. filename: "' . $filename . '"');
353349
}

tests/system/Debug/TimerTest.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
use ArgumentCountError;
1515
use CodeIgniter\Test\CIUnitTestCase;
16-
use ErrorException;
1716
use RuntimeException;
1817

1918
/**
@@ -172,11 +171,7 @@ public function testRecordThrowsException(): void
172171

173172
public function testRecordThrowsErrorOnCallableWithParams(): void
174173
{
175-
if (PHP_VERSION_ID >= 80000) {
176-
$this->expectException(ArgumentCountError::class);
177-
} else {
178-
$this->expectException(ErrorException::class);
179-
}
174+
$this->expectException(ArgumentCountError::class);
180175

181176
$timer = new Timer();
182177
$timer->record('error', 'strlen');

tests/system/Helpers/ArrayHelperTest.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace CodeIgniter\Helpers;
1313

1414
use CodeIgniter\Test\CIUnitTestCase;
15-
use ErrorException;
1615
use ValueError;
1716

1817
/**
@@ -303,13 +302,7 @@ public function testArraySortByMultipleKeysFailsEmptyParameter(array $data, arra
303302
*/
304303
public function testArraySortByMultipleKeysFailsInconsistentArraySizes($data): void
305304
{
306-
// PHP 8 changes this error type
307-
if (PHP_VERSION_ID >= 80000) {
308-
$this->expectException(ValueError::class);
309-
} else {
310-
$this->expectException(ErrorException::class);
311-
}
312-
305+
$this->expectException(ValueError::class);
313306
$this->expectExceptionMessage('Array sizes are inconsistent');
314307

315308
$sortColumns = [

user_guide_src/source/changelogs/v4.5.0.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Release Date: Unreleased
1212
Highlights
1313
**********
1414

15+
- Update minimal PHP requirement to 8.0.
1516
- TBD
1617

1718
BREAKING

user_guide_src/source/installation/installing_composer.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,11 @@ Next Minor Version
139139
If you want to use the next minor version branch, after using the ``builds`` command
140140
edit **composer.json** manually.
141141

142-
If you try the ``4.4`` branch, change the version to ``4.4.x-dev``::
142+
If you try the ``4.6`` branch, change the version to ``4.6.x-dev``::
143143

144144
"require": {
145-
"php": "^7.4 || ^8.0",
146-
"codeigniter4/codeigniter4": "4.4.x-dev"
145+
"php": "^8.0",
146+
"codeigniter4/codeigniter4": "4.6.x-dev"
147147
},
148148

149149
And run ``composer update`` to sync your vendor

user_guide_src/source/installation/upgrade_4xx.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Downloads
4141
Namespaces
4242
==========
4343

44-
- CI4 is built for PHP 7.4+, and everything in the framework is namespaced,
44+
- CI4 is built for PHP 8.0+, and everything in the framework is namespaced,
4545
except for the helper and lang files.
4646

4747
Application Structure

user_guide_src/source/intro/requirements.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Server Requirements
1010
PHP and Required Extensions
1111
***************************
1212

13-
`PHP <https://www.php.net/>`_ version 7.4 or newer is required, with the following PHP extensions are enabled:
13+
`PHP <https://www.php.net/>`_ version 8.0 or newer is required, with the following PHP extensions are enabled:
1414

1515
- `intl <https://www.php.net/manual/en/intl.requirements.php>`_
1616
- `mbstring <https://www.php.net/manual/en/mbstring.requirements.php>`_

0 commit comments

Comments
 (0)