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

Upgrades, min PHP 7.4 #3

Merged
merged 13 commits into from
Mar 15, 2025
Merged

Upgrades, min PHP 7.4 #3

merged 13 commits into from
Mar 15, 2025

Conversation

jtojnar
Copy link
Member

@jtojnar jtojnar commented Mar 15, 2025

No description provided.

jtojnar added 10 commits March 15, 2025 16:44
We do not use `flake` direnv feature since flakes currently copy the whole repo into Nix store, so we need to watch the files manually.
This allows developer to create their own own config file, e.g. for setting `editorUrl`:
https://phpstan.org/user-guide/output-format#opening-file-in-an-editor
It has isolated dependencies nowadays and it will be helpful for other developers, who probably expect it to be installed that way and do not want to use Nix.

Do the same with PHP-CS-Fixer.
Flake lock file updates:

• Updated input 'phps':
    'github:fossar/nix-phps/181dee32f3d47312674462cff30fcca661c6c643' (2023-03-05)
  → 'github:fossar/nix-phps/e48727edd2dbbbd7b9181bd284569554f6e4e5a6' (2025-03-10)
• Updated input 'phps/flake-compat':
    'github:edolstra/flake-compat/35bb57c0c8d8b62bbfd284272c928ceb64ddbde9' (2023-01-17)
  → 'github:edolstra/flake-compat/ff81ac966bb2cae68946d5ed5fc4994f96d0ffec' (2024-12-04)
• Updated input 'phps/nixpkgs':
    'github:NixOS/nixpkgs/f5ffd5787786dde3a8bf648c7a1b5f78c4e01abb' (2023-03-03)
  → 'github:NixOS/nixpkgs/de0fe301211c267807afd11b12613f5511ff7433' (2025-03-07)
• Updated input 'phps/utils':
    'github:numtide/flake-utils/3db36a8b464d0c4532ba1c7dda728f4576d6d073' (2023-02-13)
  → 'github:numtide/flake-utils/11707dc2f618dd54ca8739b309ec4fc024de578b' (2024-11-13)
• Added input 'phps/utils/systems':
    'github:nix-systems/default/da67096a3b9bf56a91d16901293e51ba5b49a27e' (2023-04-09)
This is a Language Server Provider for PHP.
Without this, the Iconv tests on CI started to fail in `setLocale` invocation:

    PHPUnit\Framework\Exception: The locale functionality is not implemented on your platform, the specified locale does not exist or the category name is invalid.

    /home/runner/work/transcoder/transcoder/tests/IconvTranscoderTest.php:25
jtojnar added 3 commits March 15, 2025 16:54
https://www.php.net/releases/7_3_0.php
https://www.php.net/releases/7_4_0.php

This installed a newer version of CS Fixer

 - friendsofphp/php-cs-fixer updated from v3.4.0 to v3.72.0 minor
   See changes: PHP-CS-Fixer/PHP-CS-Fixer@FriendsOfPHP:v3.4.0...PHP-CS-Fixer:v3.72.0
   Release notes: https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/releases/tag/v3.72.0

   - `no_superfluous_phpdoc_tags` removes `inheritdoc`.
   - `phpdoc_to_param_type` did its thing in one place.

As a result, I had to fix some rules:

- Disable `phpdoc_to_param_type` since it now tries to use union type in a param type hint, which is only supported on PHP 8.0.

Also enable PHP 7.3 migration in PHP-CS-Fixer, although there was nothing to do.
Not a BC break since all of them are private.

Had to change an initialization check in `MbTranscoder::__construct`, since PHPStan figured out it is not nullable.
 - phpstan/phpstan updated from 1.12.21 to 2.1.8 major
   See changes: phpstan/phpstan@1.12.21...2.1.8
   Release notes

   Had to remove redundant assertion. Not clear when false can actually occur on PHP ≥ 8.0 – on PHP 7.4, it can happen when passing an invalid target encoding but on PHP 8.0, it just throws a `ValueError`.
@jtojnar jtojnar changed the title Upgrades, min PHP 7.4 # Upgrades, min PHP 7.4 Mar 15, 2025
@jtojnar jtojnar merged commit b4f8126 into master Mar 15, 2025
12 checks passed
@jtojnar jtojnar deleted the bump branch March 15, 2025 16:19
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.

1 participant