Modernize to PHP 8.0

This commit is contained in:
Yassine Guedidi
2025-04-05 13:56:56 +02:00
parent 1d5674a230
commit a107773c11
31 changed files with 97 additions and 199 deletions

View File

@ -21,7 +21,7 @@ class ArraySiteConfigBuilder implements SiteConfigBuilder
{
$host = strtolower($host);
if ('www.' === substr($host, 0, 4)) {
if (str_starts_with($host, 'www.')) {
$host = substr($host, 4);
}

View File

@ -26,7 +26,7 @@ class GrabySiteConfigBuilder implements SiteConfigBuilder
// required by credentials below
$host = strtolower($host);
if ('www.' === substr($host, 0, 4)) {
if (str_starts_with($host, 'www.')) {
$host = substr($host, 4);
}

View File

@ -66,7 +66,7 @@ class LoginFormAuthenticator
$crawler = new Crawler((string) $html);
$loggedIn = $crawler->evaluate((string) $siteConfig->getNotLoggedInXpath());
} catch (\Throwable $e) {
} catch (\Throwable) {
return false;
}
@ -98,7 +98,7 @@ class LoginFormAuthenticator
$extraFields = [];
foreach ($siteConfig->getExtraFields() as $fieldName => $fieldValue) {
if ('@=' === substr($fieldValue, 0, 2)) {
if (str_starts_with($fieldValue, '@=')) {
$fieldValue = $this->expressionLanguage->evaluate(
substr($fieldValue, 2),
[