From 9b734b22bde598af7b0e4f832c8df4ca85f50918 Mon Sep 17 00:00:00 2001 From: Fred Cox Date: Fri, 29 Jan 2016 10:56:25 +0200 Subject: [PATCH] Remove incorrect usage of hasOption `hasOption` is confusingly named, it actually checks that the option has been created, not if the user has passed the option. So in this case its always true. Also changed a weird usage of `in_array`. --- Command/DumpCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Command/DumpCommand.php b/Command/DumpCommand.php index b2521d8..a4ab80d 100644 --- a/Command/DumpCommand.php +++ b/Command/DumpCommand.php @@ -47,7 +47,7 @@ class DumpCommand extends ContainerAwareCommand $routeCollection = $this->getContainer()->get('router')->getRouteCollection(); - if (!$input->hasOption('format') || in_array($format, array('json'))) { + if ($format == 'json') { $formatter = $this->getContainer()->get('nelmio_api_doc.formatter.simple_formatter'); } else { if (!in_array($format, $this->availableFormats)) {