]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Remove some complexicity in InstallCommand
authorJeremy Benoist <jeremy.benoist@gmail.com>
Mon, 28 Mar 2016 12:18:50 +0000 (14:18 +0200)
committerJeremy Benoist <jeremy.benoist@gmail.com>
Mon, 28 Mar 2016 12:18:50 +0000 (14:18 +0200)
src/Wallabag/CoreBundle/Command/InstallCommand.php
src/Wallabag/CoreBundle/Helper/EntriesExport.php

index 2d73a9add8cafc66412a6da9ad1b2c61c4e62b69..7c3d1c523f95fdd2f41451355e43cef131b3f8eb 100644 (file)
@@ -74,10 +74,9 @@ class InstallCommand extends ContainerAwareCommand
         $fulfilled = true;
 
         $label = '<comment>PDO Drivers</comment>';
-        if (extension_loaded('pdo_sqlite') || extension_loaded('pdo_mysql') || extension_loaded('pdo_pgsql')) {
-            $status = '<info>OK!</info>';
-            $help = '';
-        } else {
+        $status = '<info>OK!</info>';
+        $help = '';
+        if (!(extension_loaded('pdo_sqlite') || extension_loaded('pdo_mysql') || extension_loaded('pdo_pgsql'))) {
             $fulfilled = false;
             $status = '<error>ERROR!</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 = '<comment>'.$functionRequired.'</comment>';
+            $status = '<info>OK!</info>';
+            $help = '';
 
-            if (function_exists($functionRequired)) {
-                $status = '<info>OK!</info>';
-                $help = '';
-            } else {
+            if (!function_exists($functionRequired)) {
                 $fulfilled = false;
                 $status = '<error>ERROR!</error>';
                 $help = 'You need the '.$functionRequired.' function activated';
index 82004a6d51371c348a012cae99dc11b7b49adbf8..d0680c3fc529c9d91ef61c8c740e5199806eded8 100644 (file)
@@ -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)