minkphp / Mink

PHP web browser emulator abstraction
https://mink.behat.org/
MIT License
1.6k stars 278 forks source link

Fix PHP RFC: Deprecate implicitly nullable parameter types #869

Open andypost opened 4 months ago

andypost commented 4 months ago

It will be a blocker for Drupal 11

Links

aik099 commented 4 months ago

It will be a blocker for Drupal 11

@andypost , please explain how Mink method signatures are affecting/blocking Drupal?

andypost commented 4 months ago

Deprecation warnings affects tests so they fail. In production you can disable this warnings

For example this pipeline

Testing Drupal\FunctionalJavascriptTests\Tests\JSWebAssertTest
    E                                                                   1 / 1
    (100%)
    Deprecated: Behat\Mink\Exception\ElementHtmlException::__construct():
    Implicitly marking parameter $exception as nullable is deprecated, the
    explicit nullable type must be used instead in
    /builds/issue/drupal-3427903/vendor/behat/mink/src/Exception/ElementHtmlException.php
    on line 39

    Time: 00:14.711, Memory: 8.00 MB

    There was 1 error:

    1) Drupal\FunctionalJavascriptTests\Tests\JSWebAssertTest::testJsWebAssert
    This test printed output: 
    Deprecated: Behat\Mink\Exception\ElementHtmlException::__construct():
    Implicitly marking parameter $exception as nullable is deprecated, the
    explicit nullable type must be used instead in
    /builds/issue/drupal-3427903/vendor/behat/mink/src/Exception/ElementHtmlException.php
    on line 39

    /builds/issue/drupal-3427903/vendor/phpunit/phpunit/src/Framework/TestResult.php:956

    ERRORS!
    Tests: 1, Assertions: 24, Errors: 1.
andypost commented 4 months ago

I did update of comment with example

andypost commented 4 months ago

I checked files with $ php -d error_reporting="E_ALL" -l Mink/*/*/* to make sure no more deprecations left

also https://3v4l.org/6T9GB/rfc

andypost commented 1 month ago

Last deprecations for PHP 8.4 will be commited in 2 weeks https://wiki.php.net/todo/php84

codecov[bot] commented 4 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 98.72%. Comparing base (d8527fd) to head (4a730e1).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #869 +/- ## ========================================= Coverage 98.72% 98.72% - Complexity 374 389 +15 ========================================= Files 24 24 Lines 1022 1022 ========================================= Hits 1009 1009 Misses 13 13 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.