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

Problems with PHP 8.4 #1103

Open
smileBeda opened this issue Jan 6, 2025 · 2 comments
Open

Problems with PHP 8.4 #1103

smileBeda opened this issue Jan 6, 2025 · 2 comments

Comments

@smileBeda
Copy link

smileBeda commented Jan 6, 2025

I am running several composer libs locally:

composer global show -t
Changed current directory to /Users/***/.composer
humbug/php-scoper 0.18.15 Prefixes all PHP namespaces in a file or directory.
├──fidry/console ^0.6.10
│  ├──php ^8.2
│  ├──psr/log ^3.0
│  │  └──php >=8.0.0
│  ├──symfony/console ^6.4 || ^7.0
│  │  ├──php >=8.2
│  │  ├──symfony/polyfill-mbstring ~1.0
│  │  │  └──php >=7.2
│  │  ├──symfony/service-contracts ^2.5|^3
│  │  │  ├──php >=8.1
│  │  │  ├──psr/container ^1.1|^2.0
│  │  │  │  └──php >=7.4.0
│  │  │  └──symfony/deprecation-contracts ^2.5|^3
│  │  │     └──php >=8.1
│  │  └──symfony/string ^6.4|^7.0
│  │     ├──php >=8.2
│  │     ├──symfony/polyfill-ctype ~1.8
│  │     │  └──php >=7.2
│  │     ├──symfony/polyfill-intl-grapheme ~1.0
│  │     │  └──php >=7.2
│  │     ├──symfony/polyfill-intl-normalizer ~1.0
│  │     │  └──php >=7.2
│  │     └──symfony/polyfill-mbstring ~1.0
│  │        └──php >=7.2
│  ├──symfony/deprecation-contracts ^3.4
│  │  └──php >=8.1
│  ├──symfony/event-dispatcher-contracts ^2.5 || ^3.0
│  │  ├──php >=8.1
│  │  └──psr/event-dispatcher ^1
│  │     └──php >=7.2.0
│  ├──symfony/service-contracts ^2.5 || ^3.0
│  │  ├──php >=8.1
│  │  ├──psr/container ^1.1|^2.0
│  │  │  └──php >=7.4.0
│  │  └──symfony/deprecation-contracts ^2.5|^3
│  │     └──php >=8.1
│  ├──thecodingmachine/safe ^2.0
│  │  └──php ^8.0
│  └──webmozart/assert ^1.11
│     ├──ext-ctype *
│     │  └──php >=7.2
│     └──php ^7.2 || ^8.0
├──fidry/filesystem ^1.1
│  ├──php ^8.1
│  ├──symfony/filesystem ^6.4 || ^7.0
│  │  ├──php >=8.2
│  │  ├──symfony/polyfill-ctype ~1.8
│  │  │  └──php >=7.2
│  │  └──symfony/polyfill-mbstring ~1.8
│  │     └──php >=7.2
│  └──thecodingmachine/safe ^2.0
│     └──php ^8.0
├──jetbrains/phpstorm-stubs ^2024.1
├──nikic/php-parser ^5.0
│  ├──ext-ctype *
│  │  └──php >=7.2
│  ├──ext-json *
│  ├──ext-tokenizer *
│  └──php >=7.4
├──php ^8.2
├──symfony/console ^6.4 || ^7.0
│  ├──php >=8.2
│  ├──symfony/polyfill-mbstring ~1.0
│  │  └──php >=7.2
│  ├──symfony/service-contracts ^2.5|^3
│  │  ├──php >=8.1
│  │  ├──psr/container ^1.1|^2.0
│  │  │  └──php >=7.4.0
│  │  └──symfony/deprecation-contracts ^2.5|^3
│  │     └──php >=8.1
│  └──symfony/string ^6.4|^7.0
│     ├──php >=8.2
│     ├──symfony/polyfill-ctype ~1.8
│     │  └──php >=7.2
│     ├──symfony/polyfill-intl-grapheme ~1.0
│     │  └──php >=7.2
│     ├──symfony/polyfill-intl-normalizer ~1.0
│     │  └──php >=7.2
│     └──symfony/polyfill-mbstring ~1.0
│        └──php >=7.2
├──symfony/filesystem ^6.4 || ^7.0
│  ├──php >=8.2
│  ├──symfony/polyfill-ctype ~1.8
│  │  └──php >=7.2
│  └──symfony/polyfill-mbstring ~1.8
│     └──php >=7.2
├──symfony/finder ^6.4 || ^7.0
│  └──php >=8.2
├──symfony/var-dumper ^7.1
│  ├──php >=8.2
│  └──symfony/polyfill-mbstring ~1.0
│     └──php >=7.2
└──thecodingmachine/safe ^2.0
   └──php ^8.0
wp-coding-standards/wpcs 3.1.0 PHP_CodeSniffer rules (sniffs) to enforce WordPress coding conventions
├──ext-filter *
├──ext-libxml *
├──ext-tokenizer *
├──ext-xmlreader *
├──php >=5.4
├──phpcsstandards/phpcsextra ^1.2.1
│  ├──php >=5.4
│  ├──phpcsstandards/phpcsutils ^1.0.9
│  │  ├──dealerdirect/phpcodesniffer-composer-installer ^0.4.1 || ^0.5 || ^0.6.2 || ^0.7 || ^1.0
│  │  │  ├──composer-plugin-api ^1.0 || ^2.0
│  │  │  ├──php >=5.4
│  │  │  └──squizlabs/php_codesniffer ^2.0 || ^3.1.0 || ^4.0
│  │  │     ├──ext-simplexml *
│  │  │     ├──ext-tokenizer *
│  │  │     ├──ext-xmlwriter *
│  │  │     └──php >=5.4.0
│  │  ├──php >=5.4
│  │  └──squizlabs/php_codesniffer ^3.10.0 || 4.0.x-dev@dev
│  │     ├──ext-simplexml *
│  │     ├──ext-tokenizer *
│  │     ├──ext-xmlwriter *
│  │     └──php >=5.4.0
│  └──squizlabs/php_codesniffer ^3.8.0
│     ├──ext-simplexml *
│     ├──ext-tokenizer *
│     ├──ext-xmlwriter *
│     └──php >=5.4.0
├──phpcsstandards/phpcsutils ^1.0.10
│  ├──dealerdirect/phpcodesniffer-composer-installer ^0.4.1 || ^0.5 || ^0.6.2 || ^0.7 || ^1.0
│  │  ├──composer-plugin-api ^1.0 || ^2.0
│  │  ├──php >=5.4
│  │  └──squizlabs/php_codesniffer ^2.0 || ^3.1.0 || ^4.0
│  │     ├──ext-simplexml *
│  │     ├──ext-tokenizer *
│  │     ├──ext-xmlwriter *
│  │     └──php >=5.4.0
│  ├──php >=5.4
│  └──squizlabs/php_codesniffer ^3.10.0 || 4.0.x-dev@dev
│     ├──ext-simplexml *
│     ├──ext-tokenizer *
│     ├──ext-xmlwriter *
│     └──php >=5.4.0
└──squizlabs/php_codesniffer ^3.9.0
   ├──ext-simplexml *
   ├──ext-tokenizer *
   ├──ext-xmlwriter *
   └──php >=5.4.0

When I run WPCS in my Visual Code editor since a while it fails and throws:

Deprecated: Safe\gmdate(): Implicitly marking parameter $timestamp as nullable is deprecated, the explicit nullable type must be used instead in /Users/***/.composer/vendor/thecodingmachine/safe/deprecated/datetime.php on line 24 

(and other similar ones)

I narrowed down that the lib thecodingmachine is used only by PHP Scoper and PHP 8.4
When I run PHP 8.3 locally all is fine.

Is this known, and is it even the right place to report it? I figured I start here and work my pat up or downstream depending on the feedback I get...
Fact is that under current circumstances the PHP Scoper isn't compatible with latest stable PHP.

@smileBeda smileBeda changed the title PHP 8.1 seems unsupported? Problems with PHP 8.4 Jan 6, 2025
@sebastianbergmann
Copy link
Contributor

Is this known, and is it even the right place to report it?

Yes, this is known: #1092.

@blizzz
Copy link

blizzz commented Jan 21, 2025

Faced the same issue. Our CI workflows will fail hard on deprecations.

My workaround for now is patching the dependency: nextcloud/sharepoint@d968737

Two patches are from upstream, but the third one i created against the generated files, because i could not get regeneration with their utils working.

Apart of that, I'd argue about the usefulness of safe. It makes the core functions maybe nicer to use, but now you are, well, so dependent on it, and i guess it's sort of a chore to rip it out again. While it is mostly lipstick, isn't it? Would keep dependencies to the necessary minimum.

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

No branches or pull requests

3 participants