From 0e49487bb0a004d526eb41e7d3fb44b566441e34 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Mon, 28 Mar 2016 14:18:50 +0200 Subject: [PATCH] Remove some complexicity in InstallCommand --- src/Wallabag/CoreBundle/Command/InstallCommand.php | 14 ++++++-------- src/Wallabag/CoreBundle/Helper/EntriesExport.php | 2 ++ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php index 2d73a9ad..7c3d1c52 100644 --- a/src/Wallabag/CoreBundle/Command/InstallCommand.php +++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php @@ -74,10 +74,9 @@ class InstallCommand extends ContainerAwareCommand $fulfilled = true; $label = 'PDO Drivers'; - if (extension_loaded('pdo_sqlite') || extension_loaded('pdo_mysql') || extension_loaded('pdo_pgsql')) { - $status = 'OK!'; - $help = ''; - } else { + $status = 'OK!'; + $help = ''; + if (!(extension_loaded('pdo_sqlite') || extension_loaded('pdo_mysql') || extension_loaded('pdo_pgsql'))) { $fulfilled = false; $status = 'ERROR!'; $help = 'Needs one of sqlite, mysql or pgsql PDO drivers'; @@ -88,11 +87,10 @@ class InstallCommand extends ContainerAwareCommand foreach ($this->functionExists as $functionRequired) { $label = ''.$functionRequired.''; + $status = 'OK!'; + $help = ''; - if (function_exists($functionRequired)) { - $status = 'OK!'; - $help = ''; - } else { + if (!function_exists($functionRequired)) { $fulfilled = false; $status = 'ERROR!'; $help = 'You need the '.$functionRequired.' function activated'; diff --git a/src/Wallabag/CoreBundle/Helper/EntriesExport.php b/src/Wallabag/CoreBundle/Helper/EntriesExport.php index 82004a6d..d0680c3f 100644 --- a/src/Wallabag/CoreBundle/Helper/EntriesExport.php +++ b/src/Wallabag/CoreBundle/Helper/EntriesExport.php @@ -367,6 +367,8 @@ class EntriesExport /** * Return a Serializer object for producing processes that need it (JSON & XML). * + * @param string $format + * * @return Serializer */ private function prepareSerializingContent($format) -- 2.41.0