Mink icon indicating copy to clipboard operation
Mink copied to clipboard

Fix PHP RFC: Deprecate implicitly nullable parameter types

Open andypost opened this issue 9 months ago • 6 comments

It will be a blocker for Drupal 11

Links

  • https://wiki.php.net/rfc/deprecate-implicitly-nullable-types
  • https://php.watch/versions/8.4/implicitly-marking-parameter-type-nullable-deprecated

andypost avatar Apr 30 '24 04:04 andypost

It will be a blocker for Drupal 11

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

aik099 avatar Apr 30 '24 06:04 aik099

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 avatar Apr 30 '24 06:04 andypost

I did update of comment with example

andypost avatar Apr 30 '24 06:04 andypost

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 avatar Apr 30 '24 06:04 andypost

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

andypost avatar Aug 02 '24 11:08 andypost

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
@@            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.

codecov[bot] avatar Aug 21 '24 01:08 codecov[bot]