Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 8.4 support (after 21 November) #331

Open
2 tasks
GuySartorelli opened this issue Nov 15, 2024 · 3 comments
Open
2 tasks

PHP 8.4 support (after 21 November) #331

GuySartorelli opened this issue Nov 15, 2024 · 3 comments

Comments

@GuySartorelli
Copy link
Member

GuySartorelli commented Nov 15, 2024

PHP 8.4 releases on 21 November.

The major release policy states

At launch, a Silverstripe CMS major release supports all PHP versions in full support.

And
> Following the initial launch of a Silverstripe CMS major release, the development team aims to add forward compatibility for the next PHP release. e.g: Silverstripe CMS 5 at launch will support PHP 8.1 and PHP 8.2. CMS 5 should receive official support for an eventual PHP 8.3 in early 2024.

Acceptance criteria

  • All CMS 6 supported modules are compatible with PHP 8.4 with no deprecation warnings
  • All CMS 5.4 supported modules are compatible with PHP 8.4 with no deprecation warnings

CI PRs

After merging CI PRs, re-trigger with force push PRs below to get PHP 8.4 jobs in matrix

Kitchen sink CI

PRs

@GuySartorelli
Copy link
Member Author

GuySartorelli commented Nov 18, 2024

@emteknetnz We don't add PHP 8.4 support to CMS 5. The quote you added is about adding PHP 8.3 support to CMS 5.
Specifically:

the development team aims to add forward compatibility for the next PHP release

Similarly we'll add 8.5 to CMS 6 when it releases, and not 8.6 to CMS 6.

Similarly for CMS 4 we added PHP 8.1 support but not 8.2 or 8.3

@emteknetnz
Copy link
Member

Have updated description to remove from CMS 5

@emteknetnz emteknetnz self-assigned this Nov 27, 2024
This was referenced Nov 28, 2024
@emteknetnz
Copy link
Member

emteknetnz commented Nov 28, 2024

The following .php-cs-fixer.php script was used to make changes to nullable parameters using php-cs-fixer and then running vendor/bin/php-cs-fixer fix

<?php

include 'vendor/autoload.php';

use PhpCsFixer\Config;
use PhpCsFixer\Finder;

# https://github.com/silverstripe/supported-modules/blob/44e741b156b6ab8aeed2db6d1093dc5c48a06cc8/repositories.json
$json = json_decode(file_get_contents('repositories.json'), true);

$modules = [];

foreach ($json["supportedModules"] as $module) {
    [$vendor, $dir] = explode('/', $module["packagist"]);
    $supported = isset($module["majorVersionMapping"]["6"]);
    $modules[$vendor] ??= [];
    $modules[$vendor][$dir] = $supported;
}

$vendors = [
    'silverstripe',
    'symbiote',
    'tractorcow',
    'dnadesign',
    'colymba',
];

$in = [];
foreach ($vendors as $vendor) {
    $dirs = scandir(__DIR__ . '/vendor/' . $vendor);
    foreach ($dirs as $dir) {
        if (in_array($dir, ['.', '..'])) {
            continue;
        }
        $path = __DIR__ . '/vendor/' . $vendor . '/' . $dir;
        if (str_contains($path, 'recipe-kitchen-sink')) {
            continue;
        }
        // skip explicitly unsupported modules, excluding a few exceptions
        if (isset($modules[$vendor][$dir]) && !$modules[$vendor][$dir]) {
            if (!str_contains($path, 'silverstripe/blog')
                && !str_contains($path, 'silverstripe/subsites')
                && !str_contains($path, 'silverstripe/crontask')
                && !str_contains($path, 'silverstripe/webauthn-authenticator')
            ) {
                continue;
            }
        } 
        $in[] = $path;
    }
}

$finder = Finder::create()
    ->in($in)
    ->name('*.php');

return (new Config())
    ->setFinder($finder)
    ->setRules([
        'nullable_type_declaration_for_default_null_value' => true,
    ]);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants