oleg-andreyev / MinkPhpWebDriver

Webdriver driver for Mink framework
MIT License
8 stars 9 forks source link

Do not call strtolower on null (PHP 8.1 warning) #76

Closed marinaglancy closed 1 year ago

marinaglancy commented 2 years ago

Elements such as "option", "select" and "textarea" do not have 'type' property and it causes a notice in PHP 8.1:

8192: strtolower(): Passing null to parameter #1 () of type string is deprecated in /var/www/html/vendor/oleg-andreyev/mink-phpwebdriver/src/WebDriver.php line 578
andrewnicols commented 2 years ago

@oleg-andreyev, any chance we can land this. We're trying to get compatibility with PHP 8.1 ASAP and this is a blocker for us.

oleg-andreyev commented 2 years ago

@oleg-andreyev, any chance we can land this. We're trying to get compatibility with PHP 8.1 ASAP and this is a blocker for us.

One thing that bugs me, input has missing or unknown "type" it should fallback "text"

MDN:

If omitted (or an unknown value is specified), the input type text is used, creating a plaintext input field.

oleg-andreyev commented 2 years ago

also I've done some work on https://github.com/oleg-andreyev/MinkPhpWebDriver/releases/tag/v1.2.0

now PHP >= 7.4 and build is working.

marinaglancy commented 2 years ago

FYI In minkphp/MinkSelenium2Driver it is changed to ?: '' in four different places but the other three are only engaged if type='input' https://github.com/minkphp/MinkSelenium2Driver/commit/96ba5d71393e198f6ea2f6a61b1c5d14659757fc

The value of the variable is never compared to 'text' so it will not make any difference to the logic. But I can do it if you want

marinaglancy commented 1 year ago

hi @oleg-andreyev , thanks for reviewing it. Is there any chance to get it merged and tagged? TIA

oleg-andreyev commented 1 year ago

https://github.com/oleg-andreyev/MinkPhpWebDriver/releases/tag/v.1.2.1

stronk7 commented 1 year ago

Hi @oleg-andreyev ,

any reason the new release is not showing @ packagist? https://packagist.org/packages/oleg-andreyev/mink-phpwebdriver

Was just trying to update our repos here to use it and composer cannot find it, so far.

Ciao :-)

Edited: Ah, maybe I need to patiently wait 24 hours or so? Sorry for the pressure, if that's the case, heh! I'm just used to see the new tags/releases happening almost immediately @ packagist.

oleg-andreyev commented 1 year ago

@stronk7 fixed.

It appears I made a typo in tag/release image

tag is updated https://packagist.org/packages/oleg-andreyev/mink-phpwebdriver#v1.2.1

stronk7 commented 1 year ago

Aha, great! Heap thanks!