From fad1882d52b24b698f0ff5e96f2eabafe116525b Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 13 Oct 2023 17:25:17 +0900 Subject: [PATCH 1/6] Change $minPhpVersion to 8.1 --- public/index.php | 2 +- spark | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/index.php b/public/index.php index 826966179eec..8cf5ce347c82 100644 --- a/public/index.php +++ b/public/index.php @@ -1,7 +1,7 @@ Date: Fri, 13 Oct 2023 17:26:26 +0900 Subject: [PATCH 2/6] chore: require ^8.1 in composer.json --- admin/framework/composer.json | 2 +- admin/starter/composer.json | 2 +- composer.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/admin/framework/composer.json b/admin/framework/composer.json index 132932acc25d..44fbb67591c0 100644 --- a/admin/framework/composer.json +++ b/admin/framework/composer.json @@ -10,7 +10,7 @@ "slack": "https://codeigniterchat.slack.com" }, "require": { - "php": "^8.0", + "php": "^8.1", "ext-intl": "*", "ext-json": "*", "ext-mbstring": "*", diff --git a/admin/starter/composer.json b/admin/starter/composer.json index 35b791c3f050..27b4efc5903b 100644 --- a/admin/starter/composer.json +++ b/admin/starter/composer.json @@ -10,7 +10,7 @@ "slack": "https://codeigniterchat.slack.com" }, "require": { - "php": "^8.0", + "php": "^8.1", "codeigniter4/framework": "^4.0" }, "require-dev": { diff --git a/composer.json b/composer.json index c20c5a2e5b41..6510a6872599 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ "slack": "https://codeigniterchat.slack.com" }, "require": { - "php": "^8.0", + "php": "^8.1", "ext-intl": "*", "ext-json": "*", "ext-mbstring": "*", From f0919838cbf00c420db9c09975e19f6c45a3153a Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 13 Oct 2023 17:27:27 +0900 Subject: [PATCH 3/6] chore: drop PHP 8.0 in github workflows --- .github/workflows/deploy-userguide-latest.yml | 2 +- .github/workflows/reusable-phpunit-test.yml | 2 +- .github/workflows/test-coding-standards.yml | 4 ++-- .github/workflows/test-phpcpd.yml | 2 +- .github/workflows/test-phpunit.yml | 6 +----- .github/workflows/test-rector.yml | 2 +- admin/starter/.github/workflows/phpunit.yml | 2 +- 7 files changed, 8 insertions(+), 12 deletions(-) diff --git a/.github/workflows/deploy-userguide-latest.yml b/.github/workflows/deploy-userguide-latest.yml index ab366268e5ee..69d9b2903c84 100644 --- a/.github/workflows/deploy-userguide-latest.yml +++ b/.github/workflows/deploy-userguide-latest.yml @@ -30,7 +30,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.0' + php-version: '8.1' coverage: none # Build the latest User Guide diff --git a/.github/workflows/reusable-phpunit-test.yml b/.github/workflows/reusable-phpunit-test.yml index 0963f5865242..3f75e2e73043 100644 --- a/.github/workflows/reusable-phpunit-test.yml +++ b/.github/workflows/reusable-phpunit-test.yml @@ -66,7 +66,7 @@ jobs: # Service containers cannot be extracted to caller workflows yet services: mysql: - image: mysql:${{ inputs.mysql-version || '8.0' }} + image: mysql:${{ inputs.mysql-version || '8.1' }} env: MYSQL_ALLOW_EMPTY_PASSWORD: yes MYSQL_DATABASE: test diff --git a/.github/workflows/test-coding-standards.yml b/.github/workflows/test-coding-standards.yml index cd79e13b243e..75d2f80850ff 100644 --- a/.github/workflows/test-coding-standards.yml +++ b/.github/workflows/test-coding-standards.yml @@ -28,8 +28,8 @@ jobs: fail-fast: false matrix: php-version: - - '8.0' - - '8.2' + - '8.1' + - '8.3' steps: - name: Checkout diff --git a/.github/workflows/test-phpcpd.yml b/.github/workflows/test-phpcpd.yml index 53daa8ebab95..146fd31bb7b2 100644 --- a/.github/workflows/test-phpcpd.yml +++ b/.github/workflows/test-phpcpd.yml @@ -41,7 +41,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.0' + php-version: '8.1' tools: phpcpd extensions: dom, mbstring diff --git a/.github/workflows/test-phpunit.yml b/.github/workflows/test-phpunit.yml index 9beee1b3aa09..349504b51e86 100644 --- a/.github/workflows/test-phpunit.yml +++ b/.github/workflows/test-phpunit.yml @@ -55,7 +55,6 @@ jobs: strategy: matrix: php-version: - - '8.0' - '8.1' - '8.2' - '8.3' @@ -84,7 +83,6 @@ jobs: fail-fast: false matrix: php-version: - - '8.0' - '8.1' - '8.2' - '8.3' @@ -97,7 +95,7 @@ jobs: mysql-version: - '5.7' include: - - php-version: '8.0' + - php-version: '8.1' db-platform: MySQLi mysql-version: '8.0' - php-version: '8.3' @@ -125,7 +123,6 @@ jobs: strategy: matrix: php-version: - - '8.0' - '8.1' - '8.2' - '8.3' @@ -153,7 +150,6 @@ jobs: strategy: matrix: php-version: - - '8.0' - '8.1' - '8.2' - '8.3' diff --git a/.github/workflows/test-rector.yml b/.github/workflows/test-rector.yml index e29ee6ba64e7..0c70dd91ecdc 100644 --- a/.github/workflows/test-rector.yml +++ b/.github/workflows/test-rector.yml @@ -45,7 +45,7 @@ jobs: strategy: fail-fast: false matrix: - php-versions: ['8.0', '8.2'] + php-versions: ['8.1', '8.3'] paths: - app - system diff --git a/admin/starter/.github/workflows/phpunit.yml b/admin/starter/.github/workflows/phpunit.yml index 0489a9376466..f43435df9765 100644 --- a/admin/starter/.github/workflows/phpunit.yml +++ b/admin/starter/.github/workflows/phpunit.yml @@ -11,7 +11,7 @@ jobs: strategy: matrix: - php-versions: ['8.0', '8.2'] + php-versions: ['8.1', '8.3'] runs-on: ubuntu-latest From 4cab531f0d4e78d566ac120556f2ce669ea95cfb Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 13 Oct 2023 17:28:37 +0900 Subject: [PATCH 4/6] docs: require min PHP version 8.1 --- README.md | 2 +- admin/framework/README.md | 2 +- admin/starter/README.md | 2 +- contributing/pull_request.md | 2 +- user_guide_src/source/changelogs/v4.5.0.rst | 2 +- user_guide_src/source/installation/installing_composer.rst | 2 +- user_guide_src/source/installation/upgrade_4xx.rst | 2 +- user_guide_src/source/intro/requirements.rst | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index d5f8ec34dd51..c109cc9f566f 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,7 @@ Made with [contrib.rocks](https://contrib.rocks). ## Server Requirements -PHP version 8.0 or higher is required, with the following extensions installed: +PHP version 8.1 or higher is required, with the following extensions installed: - [intl](http://php.net/manual/en/intl.requirements.php) - [mbstring](http://php.net/manual/en/mbstring.installation.php) diff --git a/admin/framework/README.md b/admin/framework/README.md index f6f81cd65184..58a9f0a45b09 100644 --- a/admin/framework/README.md +++ b/admin/framework/README.md @@ -42,7 +42,7 @@ Please read the [*Contributing to CodeIgniter*](https://github.com/codeigniter4/ ## Server Requirements -PHP version 8.0 or higher is required, with the following extensions installed: +PHP version 8.1 or higher is required, with the following extensions installed: - [intl](http://php.net/manual/en/intl.requirements.php) - [mbstring](http://php.net/manual/en/mbstring.installation.php) diff --git a/admin/starter/README.md b/admin/starter/README.md index fc8f69b5eb1d..5fc426b6c8f7 100644 --- a/admin/starter/README.md +++ b/admin/starter/README.md @@ -50,7 +50,7 @@ Problems with it can be raised on our forum, or as issues in the main repository ## Server Requirements -PHP version 8.0 or higher is required, with the following extensions installed: +PHP version 8.1 or higher is required, with the following extensions installed: - [intl](http://php.net/manual/en/intl.requirements.php) - [mbstring](http://php.net/manual/en/mbstring.installation.php) diff --git a/contributing/pull_request.md b/contributing/pull_request.md index 8e5a489bb519..6ac917c30041 100644 --- a/contributing/pull_request.md +++ b/contributing/pull_request.md @@ -136,7 +136,7 @@ See [Contribution CSS](./css.md). ### Compatibility -CodeIgniter4 requires [PHP 8.0](https://php.net/releases/8_0_0.php). +CodeIgniter4 requires [PHP 8.1](https://php.net/releases/8_1_0.php). ### Backwards Compatibility diff --git a/user_guide_src/source/changelogs/v4.5.0.rst b/user_guide_src/source/changelogs/v4.5.0.rst index 89910fa84f3d..e7587a312a39 100644 --- a/user_guide_src/source/changelogs/v4.5.0.rst +++ b/user_guide_src/source/changelogs/v4.5.0.rst @@ -12,7 +12,7 @@ Release Date: Unreleased Highlights ********** -- Update minimal PHP requirement to 8.0. +- Update minimal PHP requirement to 8.1. - TBD BREAKING diff --git a/user_guide_src/source/installation/installing_composer.rst b/user_guide_src/source/installation/installing_composer.rst index c3f8bec85fd7..5310b00963f8 100644 --- a/user_guide_src/source/installation/installing_composer.rst +++ b/user_guide_src/source/installation/installing_composer.rst @@ -142,7 +142,7 @@ edit **composer.json** manually. If you try the ``4.6`` branch, change the version to ``4.6.x-dev``:: "require": { - "php": "^8.0", + "php": "^8.1", "codeigniter4/codeigniter4": "4.6.x-dev" }, diff --git a/user_guide_src/source/installation/upgrade_4xx.rst b/user_guide_src/source/installation/upgrade_4xx.rst index f452fc247f2a..9f9fdd259b16 100644 --- a/user_guide_src/source/installation/upgrade_4xx.rst +++ b/user_guide_src/source/installation/upgrade_4xx.rst @@ -41,7 +41,7 @@ Downloads Namespaces ========== -- CI4 is built for PHP 8.0+, and everything in the framework is namespaced, +- CI4 is built for PHP 8.1+, and everything in the framework is namespaced, except for the helper and lang files. Application Structure diff --git a/user_guide_src/source/intro/requirements.rst b/user_guide_src/source/intro/requirements.rst index 17154a952563..607022bd82fe 100644 --- a/user_guide_src/source/intro/requirements.rst +++ b/user_guide_src/source/intro/requirements.rst @@ -10,7 +10,7 @@ Server Requirements PHP and Required Extensions *************************** -`PHP `_ version 8.0 or newer is required, with the following PHP extensions are enabled: +`PHP `_ version 8.1 or newer is required, with the following PHP extensions are enabled: - `intl `_ - `mbstring `_ From 8d5ec54cf886a3e7781586de3bfa9d67190d2d87 Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 13 Oct 2023 17:38:42 +0900 Subject: [PATCH 5/6] refactor: add return types to __toString() See https://psalm.dev/docs/running_psalm/issues/MethodSignatureMustProvideReturnType/ --- system/Cookie/Cookie.php | 2 +- system/View/Cells/Cell.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/system/Cookie/Cookie.php b/system/Cookie/Cookie.php index 69e40017bb65..68a748cb30eb 100644 --- a/system/Cookie/Cookie.php +++ b/system/Cookie/Cookie.php @@ -633,7 +633,7 @@ public function toHeaderString(): string /** * {@inheritDoc} */ - public function __toString() + public function __toString(): string { $cookieHeader = []; diff --git a/system/View/Cells/Cell.php b/system/View/Cells/Cell.php index dc97fd996544..328bae1f8953 100644 --- a/system/View/Cells/Cell.php +++ b/system/View/Cells/Cell.php @@ -118,7 +118,7 @@ final protected function view(?string $view, array $data = []): string /** * Provides capability to render on string casting. */ - public function __toString() + public function __toString(): string { return $this->render(); } From 188c9677515d828fa477652ba471f178177c58f0 Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 13 Oct 2023 17:41:07 +0900 Subject: [PATCH 6/6] chore: drop PHP 8.3 for php-cs-fixer Run vendor/bin/php-cs-fixer fix --verbose --ansi --dry-run --config=.php-cs-fixer.no-header.php --using-cache=no --diff PHP needs to be a minimum version of PHP 7.4.0 and maximum version of PHP 8.2.*. Current PHP version: 8.3.0-dev. To ignore this requirement please set `PHP_CS_FIXER_IGNORE_ENV`. If you use PHP version higher than supported, you may experience code modified in a wrong way. Please report such cases at https://github.com/PHP-CS-Fixer/PHP-CS-Fixer . Error: Process completed with exit code 1. --- .github/workflows/test-coding-standards.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-coding-standards.yml b/.github/workflows/test-coding-standards.yml index 75d2f80850ff..733bbc570e5a 100644 --- a/.github/workflows/test-coding-standards.yml +++ b/.github/workflows/test-coding-standards.yml @@ -29,7 +29,7 @@ jobs: matrix: php-version: - '8.1' - - '8.3' + - '8.2' steps: - name: Checkout