@@ -22,6 +22,26 @@ protected function configure()
2222 ->setHelp ('Runs all necessary checks ' );
2323 }
2424
25+ protected function runCoverage (InputInterface $ input , OutputInterface $ output , $ coverageFilePath )
26+ {
27+ $ app = $ this ->getApplication ();
28+
29+ if (($ code = $ app ->runCommand ('coverage:check ' , $ output , [
30+ 'input-file ' => $ coverageFilePath ,
31+ ])) !== 0 ) {
32+ return $ code ;
33+ }
34+
35+ if ($ input ->getOption ('report ' ) && ($ code = $ app ->runCommand ('coverage:report ' , $ output , [
36+ 'input-file ' => $ coverageFilePath ,
37+ '--php-version ' , '5.6 ' ,
38+ ])) !== 0 ) {
39+ return $ code ;
40+ }
41+
42+ return 0 ;
43+ }
44+
2545 protected function execute (InputInterface $ input , OutputInterface $ output )
2646 {
2747 $ app = $ this ->getApplication ();
@@ -49,21 +69,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
4969 return $ code ;
5070 }
5171
52- if (!$ app ->isHhvm ()) {
53- if (($ code = $ app ->runCommand ('coverage:check ' , $ output , [
54- 'input-file ' => $ coverageFilePath ,
55- ])) !== 0 ) {
56- return $ code ;
57- }
58-
59- if ($ input ->getOption ('report ' )) {
60- if (($ code = $ app ->runCommand ('coverage:report ' , $ output , [
61- 'input-file ' => $ coverageFilePath ,
62- '--php-version ' , '5.6 ' ,
63- ])) !== 0 ) {
64- return $ code ;
65- }
66- }
72+ if (!$ app ->isHhvm () && ($ code = $ this ->runCoverage ($ input , $ output , $ coverageFilePath ))) {
73+ return $ code ;
6774 }
6875
6976 if (version_compare (PHP_VERSION , '5.6.0 ' ) >= 0 && ($ code = $ app ->runCommand ('code-style:check ' , $ output , [
0 commit comments