From fb99f93546772d4fde1e6ba085563a5777e7ff59 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Fri, 21 May 2021 00:43:33 +0200 Subject: [PATCH] Fix PHP 8.1 deprecations --- src/Symfony/Component/Console/Helper/Table.php | 2 +- .../Ldap/Tests/Security/CheckLdapCredentialsListenerTest.php | 2 ++ src/Symfony/Component/String/Slugger/AsciiSlugger.php | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Console/Helper/Table.php b/src/Symfony/Component/Console/Helper/Table.php index 9662f4e7538f7..61c3f1f01f7b0 100644 --- a/src/Symfony/Component/Console/Helper/Table.php +++ b/src/Symfony/Component/Console/Helper/Table.php @@ -520,7 +520,7 @@ private function renderCell(array $row, int $column, string $cellFormat): string if ($isNotStyledByTag) { $cellFormat = $cell->getStyle()->getCellFormat(); if (!\is_string($cellFormat)) { - $tag = http_build_query($cell->getStyle()->getTagOptions(), null, ';'); + $tag = http_build_query($cell->getStyle()->getTagOptions(), '', ';'); $cellFormat = '<'.$tag.'>%s'; } diff --git a/src/Symfony/Component/Ldap/Tests/Security/CheckLdapCredentialsListenerTest.php b/src/Symfony/Component/Ldap/Tests/Security/CheckLdapCredentialsListenerTest.php index cbf93b2d913f3..462cb228ea883 100644 --- a/src/Symfony/Component/Ldap/Tests/Security/CheckLdapCredentialsListenerTest.php +++ b/src/Symfony/Component/Ldap/Tests/Security/CheckLdapCredentialsListenerTest.php @@ -138,6 +138,7 @@ public function testBindFailureShouldThrowAnException() $this->expectException(BadCredentialsException::class); $this->expectExceptionMessage('The presented password is invalid.'); + $this->ldap->method('escape')->willReturnArgument(0); $this->ldap->expects($this->any())->method('bind')->willThrowException(new ConnectionException()); $listener = $this->createListener(); @@ -178,6 +179,7 @@ public function testEmptyQueryResultShouldThrowAnException() ->withConsecutive( ['elsa', 'test1234A$'] ); + $this->ldap->method('escape')->willReturnArgument(0); $this->ldap->expects($this->once())->method('query')->willReturn($query); $listener = $this->createListener(); diff --git a/src/Symfony/Component/String/Slugger/AsciiSlugger.php b/src/Symfony/Component/String/Slugger/AsciiSlugger.php index 55b441aca2939..5f38f38f2c10f 100644 --- a/src/Symfony/Component/String/Slugger/AsciiSlugger.php +++ b/src/Symfony/Component/String/Slugger/AsciiSlugger.php @@ -103,7 +103,7 @@ public function slug(string $string, string $separator = '-', string $locale = n $locale = $locale ?? $this->defaultLocale; $transliterator = []; - if ('de' === $locale || 0 === strpos($locale, 'de_')) { + if ($locale && ('de' === $locale || 0 === strpos($locale, 'de_'))) { // Use the shortcut for German in UnicodeString::ascii() if possible (faster and no requirement on intl) $transliterator = ['de-ASCII']; } elseif (\function_exists('transliterator_transliterate') && $locale) {