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/ImportBundle/Command/ImportCommand.php | 2 +- src/Wallabag/ImportBundle/Controller/BrowserController.php | 2 +- src/Wallabag/ImportBundle/Controller/InstapaperController.php | 2 +- src/Wallabag/ImportBundle/Controller/PinboardController.php | 2 +- src/Wallabag/ImportBundle/Controller/ReadabilityController.php | 2 +- src/Wallabag/ImportBundle/Controller/WallabagController.php | 2 +- src/Wallabag/ImportBundle/Import/BrowserImport.php | 2 +- src/Wallabag/ImportBundle/Import/InstapaperImport.php | 4 ++-- src/Wallabag/ImportBundle/Import/PocketImport.php | 2 +- src/Wallabag/ImportBundle/Import/WallabagV1Import.php | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src/Wallabag/ImportBundle') diff --git a/src/Wallabag/ImportBundle/Command/ImportCommand.php b/src/Wallabag/ImportBundle/Command/ImportCommand.php index 99056c2c..f9ffe994 100644 --- a/src/Wallabag/ImportBundle/Command/ImportCommand.php +++ b/src/Wallabag/ImportBundle/Command/ImportCommand.php @@ -43,7 +43,7 @@ class ImportCommand extends ContainerAwareCommand $user = $em->getRepository('WallabagUserBundle:User')->findOneByUsername($input->getArgument('username')); } - if (!is_object($user)) { + if (!\is_object($user)) { throw new Exception(sprintf('User "%s" not found', $input->getArgument('username'))); } diff --git a/src/Wallabag/ImportBundle/Controller/BrowserController.php b/src/Wallabag/ImportBundle/Controller/BrowserController.php index 77a7a904..6418925c 100644 --- a/src/Wallabag/ImportBundle/Controller/BrowserController.php +++ b/src/Wallabag/ImportBundle/Controller/BrowserController.php @@ -30,7 +30,7 @@ abstract class BrowserController extends Controller $markAsRead = $form->get('mark_as_read')->getData(); $name = $this->getUser()->getId() . '.json'; - if (null !== $file && in_array($file->getClientMimeType(), $this->getParameter('wallabag_import.allow_mimetypes'), true) && $file->move($this->getParameter('wallabag_import.resource_dir'), $name)) { + if (null !== $file && \in_array($file->getClientMimeType(), $this->getParameter('wallabag_import.allow_mimetypes'), true) && $file->move($this->getParameter('wallabag_import.resource_dir'), $name)) { $res = $wallabag ->setFilepath($this->getParameter('wallabag_import.resource_dir') . '/' . $name) ->setMarkAsRead($markAsRead) diff --git a/src/Wallabag/ImportBundle/Controller/InstapaperController.php b/src/Wallabag/ImportBundle/Controller/InstapaperController.php index 550679c3..f184baf9 100644 --- a/src/Wallabag/ImportBundle/Controller/InstapaperController.php +++ b/src/Wallabag/ImportBundle/Controller/InstapaperController.php @@ -31,7 +31,7 @@ class InstapaperController extends Controller $markAsRead = $form->get('mark_as_read')->getData(); $name = 'instapaper_' . $this->getUser()->getId() . '.csv'; - if (null !== $file && in_array($file->getClientMimeType(), $this->getParameter('wallabag_import.allow_mimetypes'), true) && $file->move($this->getParameter('wallabag_import.resource_dir'), $name)) { + if (null !== $file && \in_array($file->getClientMimeType(), $this->getParameter('wallabag_import.allow_mimetypes'), true) && $file->move($this->getParameter('wallabag_import.resource_dir'), $name)) { $res = $instapaper ->setFilepath($this->getParameter('wallabag_import.resource_dir') . '/' . $name) ->setMarkAsRead($markAsRead) diff --git a/src/Wallabag/ImportBundle/Controller/PinboardController.php b/src/Wallabag/ImportBundle/Controller/PinboardController.php index 0e57fd41..6f54c69a 100644 --- a/src/Wallabag/ImportBundle/Controller/PinboardController.php +++ b/src/Wallabag/ImportBundle/Controller/PinboardController.php @@ -31,7 +31,7 @@ class PinboardController extends Controller $markAsRead = $form->get('mark_as_read')->getData(); $name = 'pinboard_' . $this->getUser()->getId() . '.json'; - if (null !== $file && in_array($file->getClientMimeType(), $this->getParameter('wallabag_import.allow_mimetypes'), true) && $file->move($this->getParameter('wallabag_import.resource_dir'), $name)) { + if (null !== $file && \in_array($file->getClientMimeType(), $this->getParameter('wallabag_import.allow_mimetypes'), true) && $file->move($this->getParameter('wallabag_import.resource_dir'), $name)) { $res = $pinboard ->setFilepath($this->getParameter('wallabag_import.resource_dir') . '/' . $name) ->setMarkAsRead($markAsRead) diff --git a/src/Wallabag/ImportBundle/Controller/ReadabilityController.php b/src/Wallabag/ImportBundle/Controller/ReadabilityController.php index 59de24cb..729a97a3 100644 --- a/src/Wallabag/ImportBundle/Controller/ReadabilityController.php +++ b/src/Wallabag/ImportBundle/Controller/ReadabilityController.php @@ -31,7 +31,7 @@ class ReadabilityController extends Controller $markAsRead = $form->get('mark_as_read')->getData(); $name = 'readability_' . $this->getUser()->getId() . '.json'; - if (null !== $file && in_array($file->getClientMimeType(), $this->getParameter('wallabag_import.allow_mimetypes'), true) && $file->move($this->getParameter('wallabag_import.resource_dir'), $name)) { + if (null !== $file && \in_array($file->getClientMimeType(), $this->getParameter('wallabag_import.allow_mimetypes'), true) && $file->move($this->getParameter('wallabag_import.resource_dir'), $name)) { $res = $readability ->setFilepath($this->getParameter('wallabag_import.resource_dir') . '/' . $name) ->setMarkAsRead($markAsRead) diff --git a/src/Wallabag/ImportBundle/Controller/WallabagController.php b/src/Wallabag/ImportBundle/Controller/WallabagController.php index 6e6524b4..d182dd2c 100644 --- a/src/Wallabag/ImportBundle/Controller/WallabagController.php +++ b/src/Wallabag/ImportBundle/Controller/WallabagController.php @@ -33,7 +33,7 @@ abstract class WallabagController extends Controller $markAsRead = $form->get('mark_as_read')->getData(); $name = $this->getUser()->getId() . '.json'; - if (null !== $file && in_array($file->getClientMimeType(), $this->getParameter('wallabag_import.allow_mimetypes'), true) && $file->move($this->getParameter('wallabag_import.resource_dir'), $name)) { + if (null !== $file && \in_array($file->getClientMimeType(), $this->getParameter('wallabag_import.allow_mimetypes'), true) && $file->move($this->getParameter('wallabag_import.resource_dir'), $name)) { $res = $wallabag ->setFilepath($this->getParameter('wallabag_import.resource_dir') . '/' . $name) ->setMarkAsRead($markAsRead) diff --git a/src/Wallabag/ImportBundle/Import/BrowserImport.php b/src/Wallabag/ImportBundle/Import/BrowserImport.php index b5593180..225f1791 100644 --- a/src/Wallabag/ImportBundle/Import/BrowserImport.php +++ b/src/Wallabag/ImportBundle/Import/BrowserImport.php @@ -77,7 +77,7 @@ abstract class BrowserImport extends AbstractImport */ public function parseEntry(array $importedEntry) { - if ((!array_key_exists('guid', $importedEntry) || (!array_key_exists('id', $importedEntry))) && is_array(reset($importedEntry))) { + if ((!array_key_exists('guid', $importedEntry) || (!array_key_exists('id', $importedEntry))) && \is_array(reset($importedEntry))) { if ($this->producer) { $this->parseEntriesForProducer($importedEntry); diff --git a/src/Wallabag/ImportBundle/Import/InstapaperImport.php b/src/Wallabag/ImportBundle/Import/InstapaperImport.php index 7ab69e7a..e4f0970c 100644 --- a/src/Wallabag/ImportBundle/Import/InstapaperImport.php +++ b/src/Wallabag/ImportBundle/Import/InstapaperImport.php @@ -62,7 +62,7 @@ class InstapaperImport extends AbstractImport } $entries = []; - $handle = fopen($this->filepath, 'r'); + $handle = fopen($this->filepath, 'rb'); while (false !== ($data = fgetcsv($handle, 10240))) { if ('URL' === $data[0]) { continue; @@ -72,7 +72,7 @@ class InstapaperImport extends AbstractImport // BUT it can also be the status (since status = folder in Instapaper) // and we don't want archive, unread & starred to become a tag $tags = null; - if (false === in_array($data[3], ['Archive', 'Unread', 'Starred'], true)) { + if (false === \in_array($data[3], ['Archive', 'Unread', 'Starred'], true)) { $tags = [$data[3]]; } diff --git a/src/Wallabag/ImportBundle/Import/PocketImport.php b/src/Wallabag/ImportBundle/Import/PocketImport.php index dddb87f4..c1b35b7e 100644 --- a/src/Wallabag/ImportBundle/Import/PocketImport.php +++ b/src/Wallabag/ImportBundle/Import/PocketImport.php @@ -149,7 +149,7 @@ class PocketImport extends AbstractImport // - first call get 5k offset 0 // - second call get 5k offset 5k // - and so on - if (self::NB_ELEMENTS === count($entries['list'])) { + if (self::NB_ELEMENTS === \count($entries['list'])) { ++$run; return $this->import(self::NB_ELEMENTS * $run); diff --git a/src/Wallabag/ImportBundle/Import/WallabagV1Import.php b/src/Wallabag/ImportBundle/Import/WallabagV1Import.php index a35c411e..b9bb525a 100644 --- a/src/Wallabag/ImportBundle/Import/WallabagV1Import.php +++ b/src/Wallabag/ImportBundle/Import/WallabagV1Import.php @@ -56,7 +56,7 @@ class WallabagV1Import extends WallabagImport // In case of a bad fetch in v1, replace title and content with v2 error strings // If fetching fails again, they will get this instead of the v1 strings - if (in_array($entry['title'], $this->untitled, true)) { + if (\in_array($entry['title'], $this->untitled, true)) { $data['title'] = $this->fetchingErrorMessageTitle; $data['html'] = $this->fetchingErrorMessage; } -- cgit v1.2.3