@@ -77,6 +77,16 @@ protected function execute(InputInterface $input, OutputInterface $output)
7777 // Get params (for filtering via milestone/label/closed)
7878 $ params = $ this ->getParams ($ closed , $ milestone );
7979
80+ // Choose output
81+ if ( ! $ outputOption ) {
82+ $ outputInstance = new Table ($ input , $ output , $ questionHelper , $ columns , $ file );
83+ } elseif (array_key_exists ($ outputOption , $ this ->outputs )) {
84+ $ outputClassName = $ this ->outputs [$ outputOption ];
85+ $ outputInstance = new $ outputClassName ($ input , $ output , $ questionHelper , $ columns , $ file );
86+ } else {
87+ throw new \Exception ("Output ' {$ output }' not found! " );
88+ }
89+
8090 // Get issues
8191 $ issues = $ this ->getIssues ($ output , $ project , $ params , $ includeLabels , $ excludeLabels );
8292 $ issues = $ this ->filterIssuesByArgument ($ issues , $ input );
@@ -88,16 +98,6 @@ protected function execute(InputInterface $input, OutputInterface $output)
8898 // Set time records in issues
8999 $ issues = $ this ->setTimesInIssues ($ output , $ issues , $ from , $ to , $ user );
90100
91- // Choose output
92- if ( ! $ outputOption ) {
93- $ outputInstance = new Table ($ input , $ output , $ questionHelper , $ columns , $ file );
94- } elseif (array_key_exists ($ outputOption , $ this ->outputs )) {
95- $ outputClassName = $ this ->outputs [$ outputOption ];
96- $ outputInstance = new $ outputClassName ($ input , $ output , $ questionHelper , $ columns , $ file );
97- } else {
98- throw new \Exception ("Output ' {$ output }' not found! " );
99- }
100-
101101 // Put everything out there!
102102 $ outputInstance ->render ($ issues , $ this ->config );
103103
0 commit comments