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 RFC: Deprecate implicitly nullable parameter types #869

Merged
merged 2 commits into from
Oct 1, 2024

Conversation

andypost
Copy link
Contributor

@aik099
Copy link
Member

aik099 commented Apr 30, 2024

It will be a blocker for Drupal 11

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

@andypost
Copy link
Contributor Author

andypost commented Apr 30, 2024

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.

Copy link
Member

@aik099 aik099 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good. Doesn't look like a BC break.

@andypost
Copy link
Contributor Author

I did update of comment with example

@andypost
Copy link
Contributor Author

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
Copy link
Contributor Author

andypost commented Aug 2, 2024

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

Copy link

codecov bot commented Aug 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.72%. Comparing base (d8527fd) to head (4a730e1).
Report is 1 commits behind head on master.

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           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@andypost
Copy link
Contributor Author

andypost commented Oct 1, 2024

Any chance to get this one commited? RC1 does not bring new deprecations

@aik099 aik099 merged commit 83d1759 into minkphp:master Oct 1, 2024
14 checks passed
@aik099
Copy link
Member

aik099 commented Oct 1, 2024

Merged, thank you @andypost .

@andypost andypost deleted the implicit-nullables branch October 1, 2024 13:27
@andypost
Copy link
Contributor Author

@aik099 please create a new release with declared PHP 8.4 support, Drupal depends on it

@aik099
Copy link
Member

aik099 commented Oct 30, 2024

@andypost , isn't a similar change needed for drivers?

@andypost
Copy link
Contributor Author

better to check as Drupal showed no issues but it using limited set

@aik099
Copy link
Member

aik099 commented Oct 30, 2024

better to check as Drupal showed no issues but it using limited set

I've tried searching for = null in method arguments and the only thing that showed up was a Zombie driver.


Created Mink 1.12.0 release. Please check if it helped.

@aik099
Copy link
Member

aik099 commented Oct 30, 2024

@andypost , I see, that you're signing your git commits. Do you type a GPG key passphrase on every commit?

I'm using git on 2 OSes:

  • on macOS via Sublime Merge app;
  • on Linux (AlmaLinux) via git client.

Is there any way to have an OS-integrated SSH-agent analog that stores the GPG passphrase safely?

P.S.
Sublime Merge even doesn't ask for a passphrase.

@andypost
Copy link
Contributor Author

Drupal using mink-selenium2-driver, mink-browserkit-driver and php-webdriver and no issues detected

@andypost
Copy link
Contributor Author

@aik099 fyi all tests are passed for latest Drupal branches, thank you a lot!!!

@andypost
Copy link
Contributor Author

@aik099 no I do not type, in my case Ubuntu and Github cares about keyring and mapping

@aik099
Copy link
Member

aik099 commented Oct 31, 2024

Drupal using mink-selenium2-driver, mink-browserkit-driver and php-webdriver and no issues detected

@andypost ,

  1. What version of Selenium Server are you using?
  2. Do you have tests, that open and switch to new windows OR use frames?

@andypost
Copy link
Contributor Author

@aik099 I've no idea about selenium as Drupal using Nightwatch + lullabot/mink-selenium2-driver and the selenium/standalone-chrome docker image for CI

And I can't find any tests opening windows, the only iframe usage I know is file-upload fallback but I see no tests covering it

@aik099
Copy link
Member

aik099 commented Oct 31, 2024

The Docker image is likely using Selenium Server 3.x or 4.x.

The usage of a custom Selenium2 driver explains why everything is still working.

Thank you.

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.

2 participants