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

Fix PHP 8.4 deprecation notices #1459

Closed
wants to merge 3 commits into from

Conversation

Hlavtox
Copy link

@Hlavtox Hlavtox commented Nov 20, 2024

Is it possible to do a patch release on 8.x branch after merge? :-) Thanks!

@crynobone
Copy link

Maybe we should update styleci.yml and automate the fixes

@Sephster
Copy link
Member

@Hlavtox is there something blocking you from upgrading to 9?

@crynobone
Copy link

crynobone commented Nov 21, 2024

in .styleci.yml add nullable_type_declarations

preset: psr12

risky: true

enabled:
  - blank_line_before_return
  - fully_qualified_strict_types
  - hash_to_slash_comment
  - include
  - method_separation
  - native_function_casing
  - no_blank_lines_between_uses
  - no_duplicate_semicolons
  - no_multiline_whitespace_before_semicolons
  - no_php4_constructor
  - no_short_bool_cast
  - no_singleline_whitespace_before_semicolons
  - no_trailing_comma_in_singleline_array
  - no_unused_imports
  - no_whitespace_before_comma_in_array
+ - nullable_type_declarations
  - ordered_imports
  - phpdoc_align
  - phpdoc_indent
  - phpdoc_inline_tag
  - phpdoc_no_access
  - phpdoc_no_simplified_null_return
  - phpdoc_property
  - phpdoc_scalar
  - phpdoc_separation
  - phpdoc_to_comment
  - phpdoc_trim
  - phpdoc_type_to_var
  - phpdoc_types
  - phpdoc_var_without_name
  - print_to_echo
  - short_array_syntax
  - single_quote
  - spaces_cast
  - standardize_not_equal
  - trailing_comma_in_multiline_array
  - trim_array_spaces
  - whitespace_after_comma_in_array

@jolelievre
Copy link

Hi @Sephster

we have a dependency on your repository at https://github.com/PrestaShop/PrestaShop that is what motivated this contribution.
But I guess we can try and upgrade to your v9 once the patch for PHP 8.4 is released indeed 😉

Just to anticipate the timing, do you think the next patch that includes this compatibility will be released soon or will we have to wait a few weeks or more?

@Hlavtox
Copy link
Author

Hlavtox commented Nov 22, 2024

Hi @Sephster, I added the config to the linter. :-)

Yes, as @jolelievre said, we wanted to avoid as many major updates as we can. Get it working, stabilized, then get on the major updates if we have time.

@jolelievre
Copy link

Yep, anyway it may still be useful for other projects

@Sephster
Copy link
Member

Happy to merge this but currently failing because of dependencies. Are you able to fix this? If not, I'll see if I can get some time later today. Thank you and thanks for letting me know about PrestaShop. Always nice to hear about down stream systems! Looks a great product

@hafezdivandari
Copy link
Contributor

The roave/security-advisories doesn't allow old laminas/laminas-diactoros versions, and newer versions of laminas/laminas-diactoros doesn't support PHP 7.x. The only way to fix the failing checks is to replace laminas/laminas-diactoros with nyholm/psr7. Let me know if this is what you want. Check this commit: fce9b74

@crynobone
Copy link

We can also consider removing roave/security-advisories on GitHub Actions for PHP 7.x (since it already out of security patches as well).

+     - name: Remove Security Advisories on obsolete PHP versions
+       run: composer remove "roave/security-advisories" --dev --no-update
+.      if: matrix.php <= 7.4

      - name: Install dependencies
        run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress

@wmouwen
Copy link

wmouwen commented Dec 3, 2024

@Hlavtox is there something blocking you from upgrading to 9?

@Sephster There is for us: #1456.

The broken client credentials grant for the Symfony bundle prevents us from upgrading to v9. Upgrading to PHP 8.4 on v8 starts throwing deprecation warnings. Targeting v8 or backporting would help anyone using league/oauth2-server-bundle with client credentials to upgrade their PHP version without these warnings all over.

Best way forward to remove this block would be to have #1456 sorted out, though. That way the Symfony + client credentials applications can upgrade to v9 too.

@crynobone
Copy link

@Hlavtox are you able to continue working on this?

@Hlavtox
Copy link
Author

Hlavtox commented Dec 10, 2024

Hi guys, sorry, but I will close it for now. We upgraded to v9 eventually. 👍

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

Successfully merging this pull request may close these issues.

6 participants