PHP 8.1 > Always pass string to rtrim

Fixes the following deprecation:
rtrim(): Passing null to parameter #1 ($string) of type string is deprecated in vendor/friends-of-behat/mink-extension/src/Behat/MinkExtension/Context/RawMinkContext.php line 144
This commit is contained in:
Ruud Kamphuis
2021-12-23 11:11:26 +01:00
committed by GitHub
parent 16c61688fa
commit 7c7f059b1e

View File

@@ -141,7 +141,7 @@ class RawMinkContext implements MinkAwareContext
*/
public function locatePath($path)
{
$startUrl = rtrim($this->getMinkParameter('base_url'), '/') . '/';
$startUrl = rtrim($this->getMinkParameter('base_url') ?? '', '/') . '/';
return 0 !== strpos($path, 'http') ? $startUrl . ltrim($path, '/') : $path;
}