diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 1f6dc36b395d..1f67ebe082f5 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -25,10 +25,10 @@ body: description: Which PHP versions did you run your code? multiple: true options: - - '8.1' - '8.2' - '8.3' - '8.4' + - '8.5' validations: required: true diff --git a/.github/workflows/deploy-apidocs.yml b/.github/workflows/deploy-apidocs.yml index 08ddb313a991..4b3efe828ba4 100644 --- a/.github/workflows/deploy-apidocs.yml +++ b/.github/workflows/deploy-apidocs.yml @@ -43,7 +43,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.1' + php-version: '8.2' tools: phive coverage: none diff --git a/.github/workflows/deploy-userguide-latest.yml b/.github/workflows/deploy-userguide-latest.yml index 39c1c92833b1..4b6a4579d40c 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.1' + php-version: '8.2' coverage: none - name: Setup Python diff --git a/.github/workflows/reusable-phpunit-test.yml b/.github/workflows/reusable-phpunit-test.yml index 013990fd2e68..37aeeef4a83f 100644 --- a/.github/workflows/reusable-phpunit-test.yml +++ b/.github/workflows/reusable-phpunit-test.yml @@ -170,7 +170,7 @@ jobs: - name: Setup global environment variables run: | echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV - echo "ARTIFACT_NAME=${{ inputs.job-id || github.job }}-php-${{ inputs.php-version }}-db-${{ inputs.db-platform || 'none' }}" >> $GITHUB_ENV + echo "ARTIFACT_NAME=${{ inputs.job-id || github.job }}-php-${{ inputs.php-version }}-db-${{ inputs.db-platform || 'none' }}${{ inputs.mysql-version || '' }}" >> $GITHUB_ENV - name: Cache dependencies uses: actions/cache@v4 diff --git a/.github/workflows/test-autoreview.yml b/.github/workflows/test-autoreview.yml index a3b9a6e11409..4d452edd24ed 100644 --- a/.github/workflows/test-autoreview.yml +++ b/.github/workflows/test-autoreview.yml @@ -26,8 +26,8 @@ jobs: name: Automatic Code Review uses: ./.github/workflows/reusable-serviceless-phpunit-test.yml # @TODO Extract to codeigniter4/.github repo with: - job-name: PHP 8.1 - php-version: '8.1' + job-name: PHP 8.2 + php-version: '8.2' job-id: auto-review-tests group-name: AutoReview @@ -47,7 +47,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.1' + php-version: '8.2' - name: Install dependencies run: composer update diff --git a/.github/workflows/test-coding-standards.yml b/.github/workflows/test-coding-standards.yml index 391ecd418a1c..31f28bdeed8f 100644 --- a/.github/workflows/test-coding-standards.yml +++ b/.github/workflows/test-coding-standards.yml @@ -28,7 +28,7 @@ jobs: fail-fast: false matrix: php-version: - - '8.1' + - '8.2' include: - php-version: '8.5' composer-option: '--ignore-platform-req=php' diff --git a/.github/workflows/test-deptrac.yml b/.github/workflows/test-deptrac.yml index 7ce0052a2732..7a5dea0c3164 100644 --- a/.github/workflows/test-deptrac.yml +++ b/.github/workflows/test-deptrac.yml @@ -48,7 +48,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.1' + php-version: '8.2' tools: composer extensions: intl, json, mbstring, gd, mysqlnd, xdebug, xml, sqlite3 diff --git a/.github/workflows/test-phpstan.yml b/.github/workflows/test-phpstan.yml index eeb0793c182e..a7a0047ec8be 100644 --- a/.github/workflows/test-phpstan.yml +++ b/.github/workflows/test-phpstan.yml @@ -57,7 +57,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.1' + php-version: '8.2' extensions: intl coverage: none diff --git a/.github/workflows/test-phpunit.yml b/.github/workflows/test-phpunit.yml index 045570cb27ad..b9a8666cbcb4 100644 --- a/.github/workflows/test-phpunit.yml +++ b/.github/workflows/test-phpunit.yml @@ -56,7 +56,6 @@ jobs: strategy: matrix: php-version: - - '8.1' - '8.2' - '8.3' - '8.4' @@ -86,7 +85,6 @@ jobs: fail-fast: false matrix: php-version: - - '8.1' - '8.2' - '8.3' - '8.4' @@ -100,7 +98,7 @@ jobs: mysql-version: - '8.0' include: - - php-version: '8.1' + - php-version: '8.2' db-platform: MySQLi mysql-version: '5.7' - php-version: '8.5' @@ -129,7 +127,6 @@ jobs: strategy: matrix: php-version: - - '8.1' - '8.2' - '8.3' - '8.4' @@ -158,7 +155,6 @@ jobs: strategy: matrix: php-version: - - '8.1' - '8.2' - '8.3' - '8.4' diff --git a/.github/workflows/test-psalm.yml b/.github/workflows/test-psalm.yml index cc6c3afaade4..d46170fc8487 100644 --- a/.github/workflows/test-psalm.yml +++ b/.github/workflows/test-psalm.yml @@ -29,7 +29,7 @@ jobs: fail-fast: false matrix: php-version: - - '8.1' + - '8.2' steps: - name: Checkout base branch for PR diff --git a/.github/workflows/test-rector.yml b/.github/workflows/test-rector.yml index 3a9f6d649470..d780a9763f09 100644 --- a/.github/workflows/test-rector.yml +++ b/.github/workflows/test-rector.yml @@ -46,7 +46,7 @@ jobs: fail-fast: false matrix: php-version: - - '8.1' + - '8.2' include: - php-version: '8.5' composer-option: '--ignore-platform-req=php' diff --git a/README.md b/README.md index 77419c2a2348..d7d633ac28b7 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ Made with [contrib.rocks](https://contrib.rocks). ## Server Requirements -PHP version 8.1 or higher is required, with the following extensions installed: +PHP version 8.2 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) @@ -95,8 +95,9 @@ PHP version 8.1 or higher is required, with the following extensions installed: > [!WARNING] > - The end of life date for PHP 7.4 was November 28, 2022. > - The end of life date for PHP 8.0 was November 26, 2023. -> - If you are still using PHP 7.4 or 8.0, you should upgrade immediately. -> - The end of life date for PHP 8.1 will be December 31, 2025. +> - The end of life date for PHP 8.1 was December 31, 2025. +> - If you are still using below PHP 8.2, you should upgrade immediately. +> - The end of life date for PHP 8.2 will be December 31, 2026. Additionally, make sure that the following extensions are enabled in your PHP: diff --git a/admin/framework/README.md b/admin/framework/README.md index a23783ac316a..dd39ef950968 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.1 or higher is required, with the following extensions installed: +PHP version 8.2 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) @@ -50,8 +50,9 @@ PHP version 8.1 or higher is required, with the following extensions installed: > [!WARNING] > - The end of life date for PHP 7.4 was November 28, 2022. > - The end of life date for PHP 8.0 was November 26, 2023. -> - If you are still using PHP 7.4 or 8.0, you should upgrade immediately. -> - The end of life date for PHP 8.1 will be December 31, 2025. +> - The end of life date for PHP 8.1 was December 31, 2025. +> - If you are still using below PHP 8.2, you should upgrade immediately. +> - The end of life date for PHP 8.2 will be December 31, 2026. Additionally, make sure that the following extensions are enabled in your PHP: diff --git a/admin/framework/composer.json b/admin/framework/composer.json index 499a97eae337..aef544f51126 100644 --- a/admin/framework/composer.json +++ b/admin/framework/composer.json @@ -10,7 +10,7 @@ "slack": "https://codeigniterchat.slack.com" }, "require": { - "php": "^8.1", + "php": "^8.2", "ext-intl": "*", "ext-mbstring": "*", "laminas/laminas-escaper": "^2.17", diff --git a/admin/starter/.github/workflows/phpunit.yml b/admin/starter/.github/workflows/phpunit.yml index 2be22ec16095..fb5e3a2cb7e0 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.1', '8.3'] + php-versions: ['8.2', '8.4'] runs-on: ubuntu-latest diff --git a/admin/starter/README.md b/admin/starter/README.md index d14b4c9c804c..45f98af6033e 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.1 or higher is required, with the following extensions installed: +PHP version 8.2 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) @@ -58,8 +58,9 @@ PHP version 8.1 or higher is required, with the following extensions installed: > [!WARNING] > - The end of life date for PHP 7.4 was November 28, 2022. > - The end of life date for PHP 8.0 was November 26, 2023. -> - If you are still using PHP 7.4 or 8.0, you should upgrade immediately. -> - The end of life date for PHP 8.1 will be December 31, 2025. +> - The end of life date for PHP 8.1 was December 31, 2025. +> - If you are still using below PHP 8.2, you should upgrade immediately. +> - The end of life date for PHP 8.2 will be December 31, 2026. Additionally, make sure that the following extensions are enabled in your PHP: diff --git a/admin/starter/composer.json b/admin/starter/composer.json index 38a51e29fb64..d47149e0287f 100644 --- a/admin/starter/composer.json +++ b/admin/starter/composer.json @@ -10,8 +10,8 @@ "slack": "https://codeigniterchat.slack.com" }, "require": { - "php": "^8.1", - "codeigniter4/framework": "^4.0" + "php": "^8.2", + "codeigniter4/framework": "^4.7" }, "require-dev": { "fakerphp/faker": "^1.9", diff --git a/composer.json b/composer.json index f5fdcd0d0420..599720cb1d73 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ "slack": "https://codeigniterchat.slack.com" }, "require": { - "php": "^8.1", + "php": "^8.2", "ext-intl": "*", "ext-mbstring": "*", "laminas/laminas-escaper": "^2.17", diff --git a/contributing/pull_request.md b/contributing/pull_request.md index 8e3b5ed9f419..8ad9491fc6bf 100644 --- a/contributing/pull_request.md +++ b/contributing/pull_request.md @@ -158,7 +158,7 @@ See [Contribution CSS](./css.md). ### Compatibility -CodeIgniter4 requires [PHP 8.1](https://php.net/releases/8_1_0.php). +CodeIgniter4 requires [PHP 8.2](https://php.net/releases/8_2_0.php). ### Backwards Compatibility diff --git a/phpstan.neon.dist b/phpstan.neon.dist index e6cc288cc678..f0d8a8b691b8 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -2,7 +2,7 @@ includes: - utils/phpstan-baseline/loader.neon parameters: - phpVersion: 80100 + phpVersion: 80200 tmpDir: build/phpstan level: 6 bootstrapFiles: diff --git a/public/index.php b/public/index.php index a0a20db43dbf..8e834f2c863d 100644 --- a/public/index.php +++ b/public/index.php @@ -9,7 +9,7 @@ *--------------------------------------------------------------- */ -$minPhpVersion = '8.1'; // If you update this, don't forget to update `spark`. +$minPhpVersion = '8.2'; // If you update this, don't forget to update `spark`. if (version_compare(PHP_VERSION, $minPhpVersion, '<')) { $message = sprintf( 'Your PHP version must be %s or higher to run CodeIgniter. Current version: %s', diff --git a/rector.php b/rector.php index 4d06cad5598f..67941d76bcc2 100644 --- a/rector.php +++ b/rector.php @@ -54,7 +54,7 @@ use Utils\Rector\UnderscoreToCamelCaseVariableNameRector; return RectorConfig::configure() - ->withPhpSets(php81: true) + ->withPhpSets(php82: true) ->withPreparedSets(deadCode: true, instanceOf: true, strictBooleans: true, phpunitCodeQuality: true) ->withComposerBased(phpunit: true) ->withParallel(120, 8, 10) diff --git a/spark b/spark index e7871ea8e682..61bc572b9759 100755 --- a/spark +++ b/spark @@ -38,7 +38,7 @@ if (str_starts_with(PHP_SAPI, 'cgi')) { *--------------------------------------------------------------- */ -$minPhpVersion = '8.1'; // If you update this, don't forget to update `public/index.php`. +$minPhpVersion = '8.2'; // If you update this, don't forget to update `public/index.php`. if (version_compare(PHP_VERSION, $minPhpVersion, '<')) { $message = sprintf( 'Your PHP version must be %s or higher to run CodeIgniter. Current version: %s', diff --git a/system/Cache/FactoriesCache.php b/system/Cache/FactoriesCache.php index 6e49996c5d45..7f0293b62d9e 100644 --- a/system/Cache/FactoriesCache.php +++ b/system/Cache/FactoriesCache.php @@ -16,9 +16,9 @@ use CodeIgniter\Cache\FactoriesCache\FileVarExportHandler; use CodeIgniter\Config\Factories; -final class FactoriesCache +final readonly class FactoriesCache { - private readonly CacheInterface|FileVarExportHandler $cache; + private CacheInterface|FileVarExportHandler $cache; public function __construct(CacheInterface|FileVarExportHandler|null $cache = null) { diff --git a/system/Commands/Utilities/Routes/AutoRouteCollector.php b/system/Commands/Utilities/Routes/AutoRouteCollector.php index 3b91d365ac80..3c8eb44279c7 100644 --- a/system/Commands/Utilities/Routes/AutoRouteCollector.php +++ b/system/Commands/Utilities/Routes/AutoRouteCollector.php @@ -18,12 +18,12 @@ * * @see \CodeIgniter\Commands\Utilities\Routes\AutoRouteCollectorTest */ -final class AutoRouteCollector +final readonly class AutoRouteCollector { /** * @param string $namespace namespace to search */ - public function __construct(private readonly string $namespace, private readonly string $defaultController, private readonly string $defaultMethod) + public function __construct(private string $namespace, private string $defaultController, private string $defaultMethod) { } diff --git a/system/Commands/Utilities/Routes/AutoRouterImproved/AutoRouteCollector.php b/system/Commands/Utilities/Routes/AutoRouterImproved/AutoRouteCollector.php index f4a5204fb49b..e723317431b6 100644 --- a/system/Commands/Utilities/Routes/AutoRouterImproved/AutoRouteCollector.php +++ b/system/Commands/Utilities/Routes/AutoRouterImproved/AutoRouteCollector.php @@ -21,7 +21,7 @@ * * @see \CodeIgniter\Commands\Utilities\Routes\AutoRouterImproved\AutoRouteCollectorTest */ -final class AutoRouteCollector +final readonly class AutoRouteCollector { /** * @param string $namespace namespace to search @@ -31,12 +31,12 @@ final class AutoRouteCollector * @param string $prefix URI prefix for Module Routing */ public function __construct( - private readonly string $namespace, - private readonly string $defaultController, - private readonly string $defaultMethod, - private readonly array $httpMethods, - private readonly array $protectedControllers, - private readonly string $prefix = '', + private string $namespace, + private string $defaultController, + private string $defaultMethod, + private array $httpMethods, + private array $protectedControllers, + private string $prefix = '', ) { } diff --git a/system/Commands/Utilities/Routes/AutoRouterImproved/ControllerMethodReader.php b/system/Commands/Utilities/Routes/AutoRouterImproved/ControllerMethodReader.php index a0a98afc829a..599e90f4d2f3 100644 --- a/system/Commands/Utilities/Routes/AutoRouterImproved/ControllerMethodReader.php +++ b/system/Commands/Utilities/Routes/AutoRouterImproved/ControllerMethodReader.php @@ -22,18 +22,18 @@ * * @see \CodeIgniter\Commands\Utilities\Routes\AutoRouterImproved\ControllerMethodReaderTest */ -final class ControllerMethodReader +final readonly class ControllerMethodReader { - private readonly bool $translateURIDashes; - private readonly bool $translateUriToCamelCase; + private bool $translateURIDashes; + private bool $translateUriToCamelCase; /** * @param string $namespace the default namespace * @param list $httpMethods */ public function __construct( - private readonly string $namespace, - private readonly array $httpMethods, + private string $namespace, + private array $httpMethods, ) { $config = config(Routing::class); $this->translateURIDashes = $config->translateURIDashes; diff --git a/system/Commands/Utilities/Routes/ControllerFinder.php b/system/Commands/Utilities/Routes/ControllerFinder.php index 400e30e82d2e..103a7846ab52 100644 --- a/system/Commands/Utilities/Routes/ControllerFinder.php +++ b/system/Commands/Utilities/Routes/ControllerFinder.php @@ -20,15 +20,15 @@ * * @see \CodeIgniter\Commands\Utilities\Routes\ControllerFinderTest */ -final class ControllerFinder +final readonly class ControllerFinder { - private readonly FileLocatorInterface $locator; + private FileLocatorInterface $locator; /** * @param string $namespace namespace to search */ public function __construct( - private readonly string $namespace, + private string $namespace, ) { $this->locator = service('locator'); } diff --git a/system/Commands/Utilities/Routes/ControllerMethodReader.php b/system/Commands/Utilities/Routes/ControllerMethodReader.php index cd47085932bb..7c8faffd16be 100644 --- a/system/Commands/Utilities/Routes/ControllerMethodReader.php +++ b/system/Commands/Utilities/Routes/ControllerMethodReader.php @@ -21,12 +21,12 @@ * * @see \CodeIgniter\Commands\Utilities\Routes\ControllerMethodReaderTest */ -final class ControllerMethodReader +final readonly class ControllerMethodReader { /** * @param string $namespace the default namespace */ - public function __construct(private readonly string $namespace) + public function __construct(private string $namespace) { } diff --git a/system/Commands/Utilities/Routes/FilterCollector.php b/system/Commands/Utilities/Routes/FilterCollector.php index 052884a644b7..ec1219debe1a 100644 --- a/system/Commands/Utilities/Routes/FilterCollector.php +++ b/system/Commands/Utilities/Routes/FilterCollector.php @@ -24,7 +24,7 @@ * * @see \CodeIgniter\Commands\Utilities\Routes\FilterCollectorTest */ -final class FilterCollector +final readonly class FilterCollector { public function __construct( /** @@ -32,7 +32,7 @@ public function __construct( * * If set to true, route filters are not found. */ - private readonly bool $resetRoutes = false, + private bool $resetRoutes = false, ) { } diff --git a/system/Commands/Utilities/Routes/FilterFinder.php b/system/Commands/Utilities/Routes/FilterFinder.php index f34ea26aa702..849a1cdb59c9 100644 --- a/system/Commands/Utilities/Routes/FilterFinder.php +++ b/system/Commands/Utilities/Routes/FilterFinder.php @@ -25,10 +25,10 @@ * * @see \CodeIgniter\Commands\Utilities\Routes\FilterFinderTest */ -final class FilterFinder +final readonly class FilterFinder { - private readonly Router $router; - private readonly Filters $filters; + private Router $router; + private Filters $filters; public function __construct(?Router $router = null, ?Filters $filters = null) { diff --git a/system/DataConverter/DataConverter.php b/system/DataConverter/DataConverter.php index fa8353e83abd..4895ec4127d2 100644 --- a/system/DataConverter/DataConverter.php +++ b/system/DataConverter/DataConverter.php @@ -24,12 +24,12 @@ * * @see \CodeIgniter\DataConverter\DataConverterTest */ -final class DataConverter +final readonly class DataConverter { /** * The data caster. */ - private readonly DataCaster $dataCaster; + private DataCaster $dataCaster; /** * @param array $castHandlers Custom convert handlers @@ -42,26 +42,26 @@ public function __construct( * * @var array [column => type] */ - private readonly array $types, + private array $types, array $castHandlers = [], /** * Helper object. */ - private readonly ?object $helper = null, + private ?object $helper = null, /** * Static reconstruct method name or closure to reconstruct an object. * Used by reconstruct(). * * @var (Closure(array): TEntity)|string|null */ - private readonly Closure|string|null $reconstructor = 'reconstruct', + private Closure|string|null $reconstructor = 'reconstruct', /** * Extract method name or closure to extract data from an object. * Used by extract(). * * @var (Closure(TEntity, bool, bool): array)|string|null */ - private readonly Closure|string|null $extractor = null, + private Closure|string|null $extractor = null, ) { $this->dataCaster = new DataCaster($castHandlers, $types, $this->helper); } diff --git a/system/Database/ConnectionInterface.php b/system/Database/ConnectionInterface.php index 8e4834486261..3c43b173fc4e 100644 --- a/system/Database/ConnectionInterface.php +++ b/system/Database/ConnectionInterface.php @@ -17,8 +17,8 @@ * @template TConnection * @template TResult * - * @property false|object|resource $connID * @property-read string $DBDriver + * @property false|object|resource $connID */ interface ConnectionInterface { diff --git a/system/Database/Database.php b/system/Database/Database.php index 80e902d5ab58..3cc0cb8fa1b9 100644 --- a/system/Database/Database.php +++ b/system/Database/Database.php @@ -65,6 +65,8 @@ public function load(array $params = [], string $alias = '') /** * Creates a Forge instance for the current database type. + * + * @param BaseConnection $db */ public function loadForge(ConnectionInterface $db): Forge { @@ -77,6 +79,8 @@ public function loadForge(ConnectionInterface $db): Forge /** * Creates an instance of Utils for the current database type. + * + * @param BaseConnection $db */ public function loadUtils(ConnectionInterface $db): BaseUtils { diff --git a/system/Debug/Exceptions.php b/system/Debug/Exceptions.php index 04c4429fd783..6bf914c785bb 100644 --- a/system/Debug/Exceptions.php +++ b/system/Debug/Exceptions.php @@ -84,17 +84,6 @@ public function __construct(ExceptionsConfig $config) $this->viewPath = rtrim($config->errorViewPath, '\\/ ') . DIRECTORY_SEPARATOR; $this->config = $config; - - // workaround for upgraded users - // This causes "Deprecated: Creation of dynamic property" in PHP 8.2. - // @TODO remove this after dropping PHP 8.1 support. - if (! isset($this->config->sensitiveDataInTrace)) { - $this->config->sensitiveDataInTrace = []; - } - if (! isset($this->config->logDeprecations, $this->config->deprecationLogLevel)) { - $this->config->logDeprecations = false; - $this->config->deprecationLogLevel = LogLevel::WARNING; - } } /** diff --git a/system/HTTP/SiteURIFactory.php b/system/HTTP/SiteURIFactory.php index 483c3ded5779..73cc9fe84ee4 100644 --- a/system/HTTP/SiteURIFactory.php +++ b/system/HTTP/SiteURIFactory.php @@ -24,9 +24,9 @@ * * @see \CodeIgniter\HTTP\SiteURIFactoryTest */ -final class SiteURIFactory +final readonly class SiteURIFactory { - public function __construct(private readonly App $appConfig, private readonly Superglobals $superglobals) + public function __construct(private App $appConfig, private Superglobals $superglobals) { } diff --git a/system/Router/DefinedRouteCollector.php b/system/Router/DefinedRouteCollector.php index 0aa4fdd063d8..c66e25c03349 100644 --- a/system/Router/DefinedRouteCollector.php +++ b/system/Router/DefinedRouteCollector.php @@ -21,9 +21,9 @@ * * @see \CodeIgniter\Router\DefinedRouteCollectorTest */ -final class DefinedRouteCollector +final readonly class DefinedRouteCollector { - public function __construct(private readonly RouteCollectionInterface $routeCollection) + public function __construct(private RouteCollectionInterface $routeCollection) { } diff --git a/user_guide_src/source/changelogs/v4.7.0.rst b/user_guide_src/source/changelogs/v4.7.0.rst index 1070eb9380cd..7defca8f03e7 100644 --- a/user_guide_src/source/changelogs/v4.7.0.rst +++ b/user_guide_src/source/changelogs/v4.7.0.rst @@ -14,7 +14,7 @@ Release Date: Unreleased Highlights ********** -- TBD +- Update minimal PHP requirement to ``8.2``. ******** BREAKING diff --git a/user_guide_src/source/installation/installing_composer.rst b/user_guide_src/source/installation/installing_composer.rst index 3dd4c2a6a1b7..1f12d5321fef 100644 --- a/user_guide_src/source/installation/installing_composer.rst +++ b/user_guide_src/source/installation/installing_composer.rst @@ -191,11 +191,11 @@ Next Minor Version If you want to use the next minor version branch, after using the ``builds`` command edit **composer.json** manually. -If you try the ``4.6`` branch, change the version to ``4.6.x-dev``:: +If you try the ``4.7`` branch, change the version to ``4.7.x-dev``:: "require": { - "php": "^8.1", - "codeigniter4/codeigniter4": "4.6.x-dev" + "php": "^8.2", + "codeigniter4/codeigniter4": "4.7.x-dev" }, And run ``composer update`` to sync your vendor diff --git a/user_guide_src/source/intro/requirements.rst b/user_guide_src/source/intro/requirements.rst index c90cb9c8a7eb..4c956e631f0e 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.1 or newer is required, with the following PHP extensions are enabled: +`PHP `_ version 8.2 or newer is required, with the following PHP extensions are enabled: - `intl `_ - `mbstring `_ @@ -19,10 +19,12 @@ PHP and Required Extensions .. warning:: - The end of life date for PHP 7.4 was November 28, 2022. - The end of life date for PHP 8.0 was November 26, 2023. - - **If you are still using PHP 7.4 or 8.0, you should upgrade immediately.** - - The end of life date for PHP 8.1 will be December 31, 2025. + - The end of life date for PHP 8.1 was December 31, 2025. + - **If you are still using below PHP 8.2, you should upgrade immediately.** + - The end of life date for PHP 8.2 will be December 31, 2026. .. note:: + - PHP 8.5 requires CodeIgniter 4.7.0 or later. - PHP 8.4 requires CodeIgniter 4.6.0 or later. - PHP 8.3 requires CodeIgniter 4.4.4 or later. - PHP 8.2 requires CodeIgniter 4.2.11 or later. diff --git a/utils/composer.json b/utils/composer.json index 4c9ae87b3021..d8d707a48c1e 100644 --- a/utils/composer.json +++ b/utils/composer.json @@ -1,6 +1,6 @@ { "require": { - "php": "^8.1", + "php": "^8.2", "codeigniter/coding-standard": "^1.7", "ergebnis/composer-normalize": "^2.28", "friendsofphp/php-cs-fixer": "^3.76", diff --git a/utils/phpstan-baseline/booleanNot.exprNotBoolean.neon b/utils/phpstan-baseline/booleanNot.exprNotBoolean.neon new file mode 100644 index 000000000000..1a6537ef488d --- /dev/null +++ b/utils/phpstan-baseline/booleanNot.exprNotBoolean.neon @@ -0,0 +1,8 @@ +# total 2 errors + +parameters: + ignoreErrors: + - + message: '#^Only booleans are allowed in a negated boolean, mixed given\.$#' + count: 2 + path: ../../system/Database/Database.php diff --git a/utils/phpstan-baseline/loader.neon b/utils/phpstan-baseline/loader.neon index f54427206516..0a8697aa66d6 100644 --- a/utils/phpstan-baseline/loader.neon +++ b/utils/phpstan-baseline/loader.neon @@ -1,7 +1,8 @@ -# total 2816 errors +# total 2824 errors includes: - argument.type.neon - assign.propertyType.neon + - booleanNot.exprNotBoolean.neon - codeigniter.getReassignArray.neon - codeigniter.modelArgumentType.neon - codeigniter.superglobalAccess.neon diff --git a/utils/phpstan-baseline/property.notFound.neon b/utils/phpstan-baseline/property.notFound.neon index 282a9234fddd..10dac94f71dd 100644 --- a/utils/phpstan-baseline/property.notFound.neon +++ b/utils/phpstan-baseline/property.notFound.neon @@ -1,4 +1,4 @@ -# total 59 errors +# total 65 errors parameters: ignoreErrors: @@ -17,6 +17,21 @@ parameters: count: 14 path: ../../system/Database/SQLSRV/Forge.php + - + message: '#^Access to an undefined property CodeIgniter\\Debug\\ExceptionHandler\:\:\$stringAsHtml\.$#' + count: 1 + path: ../../system/Debug/ExceptionHandler.php + + - + message: '#^Access to an undefined property CodeIgniter\\Debug\\Exceptions\:\:\$stringAsHtml\.$#' + count: 1 + path: ../../system/Debug/Exceptions.php + + - + message: '#^Access to an undefined property CodeIgniter\\RESTful\\ResourceController\:\:\$stringAsHtml\.$#' + count: 1 + path: ../../system/RESTful/ResourceController.php + - message: '#^Access to an undefined property Config\\Session\:\:\$lockAttempts\.$#' count: 1 @@ -27,6 +42,21 @@ parameters: count: 1 path: ../../system/Session/Handlers/RedisHandler.php + - + message: '#^Access to an undefined property CodeIgniter\\Test\\Mock\\MockResourcePresenter\:\:\$stringAsHtml\.$#' + count: 1 + path: ../../system/Test/Mock/MockResourcePresenter.php + + - + message: '#^Access to an undefined property class@anonymous/tests/system/API/ResponseTraitTest\.php\:123\:\:\$stringAsHtml\.$#' + count: 1 + path: ../../tests/system/API/ResponseTraitTest.php + + - + message: '#^Access to an undefined property class@anonymous/tests/system/API/ResponseTraitTest\.php\:621\:\:\$stringAsHtml\.$#' + count: 1 + path: ../../tests/system/API/ResponseTraitTest.php + - message: '#^Access to an undefined property Tests\\Support\\Commands\\AppInfo\:\:\$foobar\.$#' count: 2 diff --git a/utils/src/Rector/UnderscoreToCamelCaseVariableNameRector.php b/utils/src/Rector/UnderscoreToCamelCaseVariableNameRector.php index 4471bdb7167c..4302dbd0b79e 100644 --- a/utils/src/Rector/UnderscoreToCamelCaseVariableNameRector.php +++ b/utils/src/Rector/UnderscoreToCamelCaseVariableNameRector.php @@ -93,7 +93,7 @@ public function refactor(Node $node): ?Node $this->traverseNodesWithCallable( $node->stmts, - function (Node $subNode) { + function (Node $subNode): null { if ($subNode instanceof Variable || $subNode instanceof ClassMethod || $subNode instanceof Function_ || $subNode instanceof Closure) { $this->processRenameVariable($subNode); }