From 2a1ceb67b4400f46f4d3067e887ff54aa906f0a2 Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Wed, 5 Sep 2018 14:25:32 +0200 Subject: php-cs-fixer Signed-off-by: Kevin Decherf --- src/Wallabag/CoreBundle/Helper/ContentProxy.php | 8 ++++---- src/Wallabag/CoreBundle/Helper/CryptoProxy.php | 2 +- src/Wallabag/CoreBundle/Helper/DownloadImages.php | 4 ++-- src/Wallabag/CoreBundle/Helper/EntriesExport.php | 4 ++-- src/Wallabag/CoreBundle/Helper/PreparePagerForEntries.php | 2 +- src/Wallabag/CoreBundle/Helper/Redirect.php | 2 +- src/Wallabag/CoreBundle/Helper/TagsAssigner.php | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-) (limited to 'src/Wallabag/CoreBundle/Helper') diff --git a/src/Wallabag/CoreBundle/Helper/ContentProxy.php b/src/Wallabag/CoreBundle/Helper/ContentProxy.php index fe795d42..3fe31c2c 100644 --- a/src/Wallabag/CoreBundle/Helper/ContentProxy.php +++ b/src/Wallabag/CoreBundle/Helper/ContentProxy.php @@ -85,7 +85,7 @@ class ContentProxy (new LocaleConstraint()) ); - if (0 === count($errors)) { + if (0 === \count($errors)) { $entry->setLanguage($value); return; @@ -107,7 +107,7 @@ class ContentProxy (new UrlConstraint()) ); - if (0 === count($errors)) { + if (0 === \count($errors)) { $entry->setPreviewPicture($value); return; @@ -212,7 +212,7 @@ class ContentProxy $entry->setHttpStatus($content['status']); } - if (!empty($content['authors']) && is_array($content['authors'])) { + if (!empty($content['authors']) && \is_array($content['authors'])) { $entry->setPublishedBy($content['authors']); } @@ -233,7 +233,7 @@ class ContentProxy } // if content is an image, define it as a preview too - if (!empty($content['content_type']) && in_array($this->mimeGuesser->guess($content['content_type']), ['jpeg', 'jpg', 'gif', 'png'], true)) { + if (!empty($content['content_type']) && \in_array($this->mimeGuesser->guess($content['content_type']), ['jpeg', 'jpg', 'gif', 'png'], true)) { $this->updatePreviewPicture($entry, $content['url']); } diff --git a/src/Wallabag/CoreBundle/Helper/CryptoProxy.php b/src/Wallabag/CoreBundle/Helper/CryptoProxy.php index 7d8c9888..67d73915 100644 --- a/src/Wallabag/CoreBundle/Helper/CryptoProxy.php +++ b/src/Wallabag/CoreBundle/Helper/CryptoProxy.php @@ -81,6 +81,6 @@ class CryptoProxy */ private function mask($value) { - return strlen($value) > 0 ? $value[0] . '*****' . $value[strlen($value) - 1] : 'Empty value'; + return \strlen($value) > 0 ? $value[0] . '*****' . $value[\strlen($value) - 1] : 'Empty value'; } } diff --git a/src/Wallabag/CoreBundle/Helper/DownloadImages.php b/src/Wallabag/CoreBundle/Helper/DownloadImages.php index 487a3a23..cc3dcfce 100644 --- a/src/Wallabag/CoreBundle/Helper/DownloadImages.php +++ b/src/Wallabag/CoreBundle/Helper/DownloadImages.php @@ -198,7 +198,7 @@ class DownloadImages // Must be one or more digits followed by w OR x $pattern = "/(?:[^\"'\s]+\s*(?:\d+[wx])+)/"; preg_match_all($pattern, $srcsetAttribute, $matches); - $srcset = call_user_func_array('array_merge', $matches); + $srcset = \call_user_func_array('array_merge', $matches); $srcsetUrls = array_map(function ($src) { return trim(explode(' ', $src, 2)[0]); }, $srcset); @@ -308,7 +308,7 @@ class DownloadImages $this->logger->debug('DownloadImages: Checking extension (alternative)', ['ext' => $ext]); } - if (!in_array($ext, ['jpeg', 'jpg', 'gif', 'png'], true)) { + if (!\in_array($ext, ['jpeg', 'jpg', 'gif', 'png'], true)) { $this->logger->error('DownloadImages: Processed image with not allowed extension. Skipping: ' . $imagePath); return false; diff --git a/src/Wallabag/CoreBundle/Helper/EntriesExport.php b/src/Wallabag/CoreBundle/Helper/EntriesExport.php index 136f66f5..cbf1037b 100644 --- a/src/Wallabag/CoreBundle/Helper/EntriesExport.php +++ b/src/Wallabag/CoreBundle/Helper/EntriesExport.php @@ -45,7 +45,7 @@ class EntriesExport */ public function setEntries($entries) { - if (!is_array($entries)) { + if (!\is_array($entries)) { $this->language = $entries->getLanguage(); $entries = [$entries]; } @@ -325,7 +325,7 @@ class EntriesExport { $delimiter = ';'; $enclosure = '"'; - $handle = fopen('php://memory', 'rb+'); + $handle = fopen('php://memory', 'b+r'); fputcsv($handle, ['Title', 'URL', 'Content', 'Tags', 'MIME Type', 'Language', 'Creation date'], $delimiter, $enclosure); diff --git a/src/Wallabag/CoreBundle/Helper/PreparePagerForEntries.php b/src/Wallabag/CoreBundle/Helper/PreparePagerForEntries.php index 49c1ea41..1c2c5093 100644 --- a/src/Wallabag/CoreBundle/Helper/PreparePagerForEntries.php +++ b/src/Wallabag/CoreBundle/Helper/PreparePagerForEntries.php @@ -31,7 +31,7 @@ class PreparePagerForEntries $user = $this->tokenStorage->getToken() ? $this->tokenStorage->getToken()->getUser() : null; } - if (null === $user || !is_object($user)) { + if (null === $user || !\is_object($user)) { return; } diff --git a/src/Wallabag/CoreBundle/Helper/Redirect.php b/src/Wallabag/CoreBundle/Helper/Redirect.php index abc84d08..9d1a6345 100644 --- a/src/Wallabag/CoreBundle/Helper/Redirect.php +++ b/src/Wallabag/CoreBundle/Helper/Redirect.php @@ -31,7 +31,7 @@ class Redirect { $user = $this->tokenStorage->getToken() ? $this->tokenStorage->getToken()->getUser() : null; - if (null === $user || !is_object($user)) { + if (null === $user || !\is_object($user)) { return $url; } diff --git a/src/Wallabag/CoreBundle/Helper/TagsAssigner.php b/src/Wallabag/CoreBundle/Helper/TagsAssigner.php index 0bfe5c57..e6b4989f 100644 --- a/src/Wallabag/CoreBundle/Helper/TagsAssigner.php +++ b/src/Wallabag/CoreBundle/Helper/TagsAssigner.php @@ -32,7 +32,7 @@ class TagsAssigner { $tagsEntities = []; - if (!is_array($tags)) { + if (!\is_array($tags)) { $tags = explode(',', $tags); } @@ -48,7 +48,7 @@ class TagsAssigner $label = trim(mb_convert_case($label, MB_CASE_LOWER)); // avoid empty tag - if (0 === strlen($label)) { + if (0 === \strlen($label)) { continue; } -- cgit v1.2.3