From 381f9681b55814bcc39a108a1ad6911489c7f1b4 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Mon, 18 Jan 2021 10:38:56 +0100 Subject: [PATCH] Fix CS --- src/Wallabag/CoreBundle/Controller/ConfigController.php | 2 +- src/Wallabag/CoreBundle/Entity/Tag.php | 2 +- src/Wallabag/CoreBundle/Helper/ContentProxy.php | 6 +++--- src/Wallabag/CoreBundle/Helper/TagsAssigner.php | 2 +- src/Wallabag/CoreBundle/Twig/WallabagExtension.php | 2 +- src/Wallabag/ImportBundle/Import/PocketImport.php | 2 +- .../ApiBundle/Controller/EntryRestControllerTest.php | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php index 42f8aff35..d5873ca8d 100644 --- a/src/Wallabag/CoreBundle/Controller/ConfigController.php +++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php @@ -327,7 +327,7 @@ class ConfigController extends Controller $backupCodes = (new BackupCodes())->toArray(); $backupCodesHashed = array_map( function ($backupCode) { - return password_hash($backupCode, PASSWORD_DEFAULT); + return password_hash($backupCode, \PASSWORD_DEFAULT); }, $backupCodes ); diff --git a/src/Wallabag/CoreBundle/Entity/Tag.php b/src/Wallabag/CoreBundle/Entity/Tag.php index 9fb2f94fd..6588785bf 100644 --- a/src/Wallabag/CoreBundle/Entity/Tag.php +++ b/src/Wallabag/CoreBundle/Entity/Tag.php @@ -84,7 +84,7 @@ class Tag */ public function setLabel($label) { - $this->label = mb_convert_case($label, MB_CASE_LOWER); + $this->label = mb_convert_case($label, \MB_CASE_LOWER); return $this; } diff --git a/src/Wallabag/CoreBundle/Helper/ContentProxy.php b/src/Wallabag/CoreBundle/Helper/ContentProxy.php index 7e93249dd..cd9c17e77 100644 --- a/src/Wallabag/CoreBundle/Helper/ContentProxy.php +++ b/src/Wallabag/CoreBundle/Helper/ContentProxy.php @@ -141,7 +141,7 @@ class ContentProxy $date = $value; // is it a timestamp? - if (false !== filter_var($date, FILTER_VALIDATE_INT)) { + if (false !== filter_var($date, \FILTER_VALIDATE_INT)) { $date = '@' . $date; } @@ -163,7 +163,7 @@ class ContentProxy */ public function setEntryDomainName(Entry $entry) { - $domainName = parse_url($entry->getUrl(), PHP_URL_HOST); + $domainName = parse_url($entry->getUrl(), \PHP_URL_HOST); if (false !== $domainName) { $entry->setDomainName($domainName); } @@ -177,7 +177,7 @@ class ContentProxy public function setDefaultEntryTitle(Entry $entry) { $url = parse_url($entry->getUrl()); - $path = pathinfo($url['path'], PATHINFO_BASENAME); + $path = pathinfo($url['path'], \PATHINFO_BASENAME); if (empty($path)) { $path = $url['host']; diff --git a/src/Wallabag/CoreBundle/Helper/TagsAssigner.php b/src/Wallabag/CoreBundle/Helper/TagsAssigner.php index 433b09fef..0b4e1e29f 100644 --- a/src/Wallabag/CoreBundle/Helper/TagsAssigner.php +++ b/src/Wallabag/CoreBundle/Helper/TagsAssigner.php @@ -44,7 +44,7 @@ class TagsAssigner } foreach ($tags as $label) { - $label = trim(mb_convert_case($label, MB_CASE_LOWER)); + $label = trim(mb_convert_case($label, \MB_CASE_LOWER)); // avoid empty tag if (0 === \strlen($label)) { diff --git a/src/Wallabag/CoreBundle/Twig/WallabagExtension.php b/src/Wallabag/CoreBundle/Twig/WallabagExtension.php index fe7ce8c1b..01fcf5674 100644 --- a/src/Wallabag/CoreBundle/Twig/WallabagExtension.php +++ b/src/Wallabag/CoreBundle/Twig/WallabagExtension.php @@ -158,7 +158,7 @@ class WallabagExtension extends AbstractExtension implements GlobalsInterface $nbDays = (int) $interval->format('%a') ?: 1; // force setlocale for date translation - setlocale(LC_TIME, strtolower($user->getConfig()->getLanguage()) . '_' . strtoupper(strtolower($user->getConfig()->getLanguage()))); + setlocale(\LC_TIME, strtolower($user->getConfig()->getLanguage()) . '_' . strtoupper(strtolower($user->getConfig()->getLanguage()))); return $this->translator->trans('footer.stats', [ '%user_creation%' => strftime('%e %B %Y', $user->getCreatedAt()->getTimestamp()), diff --git a/src/Wallabag/ImportBundle/Import/PocketImport.php b/src/Wallabag/ImportBundle/Import/PocketImport.php index 24fdaa2b8..469a8f16c 100644 --- a/src/Wallabag/ImportBundle/Import/PocketImport.php +++ b/src/Wallabag/ImportBundle/Import/PocketImport.php @@ -246,7 +246,7 @@ class PocketImport extends AbstractImport { $data = json_decode((string) $response->getBody(), true); - if (JSON_ERROR_NONE !== json_last_error()) { + if (\JSON_ERROR_NONE !== json_last_error()) { throw new \InvalidArgumentException('Unable to parse JSON data: ' . json_last_error_msg()); } diff --git a/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php b/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php index 644727448..c058c52f7 100644 --- a/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php +++ b/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php @@ -832,7 +832,7 @@ class EntryRestControllerTest extends WallabagApiTestCase $this->client->request('GET', '/api/entries/' . $entry->getId() . '/tags'); - $this->assertSame(json_encode($tags, JSON_HEX_QUOT), $this->client->getResponse()->getContent()); + $this->assertSame(json_encode($tags, \JSON_HEX_QUOT), $this->client->getResponse()->getContent()); } public function testPostTagsOnEntry()