1
- <?php declare (strict_types=1 );
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ /*
6
+ * This file is part of the Docs Builder package.
7
+ * (c) Ryan Weaver <[email protected] >
8
+ * For the full copyright and license information, please view the LICENSE
9
+ * file that was distributed with this source code.
10
+ */
2
11
3
12
namespace SymfonyDocsBuilder \Command ;
4
13
5
14
use Doctrine \Common \EventManager ;
6
15
use Doctrine \RST \Builder ;
7
- use Doctrine \RST \Event \PostNodeRenderEvent ;
8
16
use Doctrine \RST \Event \PostParseDocumentEvent ;
9
17
use Doctrine \RST \Event \PreBuildParseEvent ;
10
18
use Doctrine \RST \Event \PreBuildRenderEvent ;
11
19
use Symfony \Component \Console \Helper \ProgressBar ;
12
20
use Symfony \Component \Console \Input \InputInterface ;
13
21
use Symfony \Component \Console \Output \OutputInterface ;
14
- use Symfony \Component \Console \Style \SymfonyStyle ;
15
22
use Symfony \Component \Filesystem \Filesystem ;
16
23
use Symfony \Component \Finder \Finder ;
17
24
use SymfonyDocsBuilder \BuildContext ;
18
- use SymfonyDocsBuilder \KernelFactory ;
19
25
20
26
trait CommandInitializerTrait
21
27
{
@@ -43,8 +49,6 @@ private function doInitialize(InputInterface $input, OutputInterface $output, st
43
49
44
50
private function initializeProgressBarEventListeners (): void
45
51
{
46
-
47
-
48
52
// tries to handle progress bar for "rendering"
49
53
$ this ->eventManager ->addEventListener (
50
54
[PreBuildRenderEvent::PRE_BUILD_RENDER ],
@@ -69,7 +73,7 @@ private function startBuild()
69
73
70
74
/**
71
75
* Removes all existing html files in the output dir that should not exist
72
- * because previous build in the same output directory has been executed on another version
76
+ * because previous build in the same output directory has been executed on another version.
73
77
*/
74
78
private function sanitizeOutputDirs (Finder $ finder )
75
79
{
@@ -121,7 +125,7 @@ function ($file) use ($outputDir, $format) {
121
125
public function preBuildParse (PreBuildParseEvent $ event )
122
126
{
123
127
$ parseQueue = $ event ->getParseQueue ();
124
- $ parseCount = count ($ parseQueue ->getAllFilesThatRequireParsing ());
128
+ $ parseCount = \ count ($ parseQueue ->getAllFilesThatRequireParsing ());
125
129
$ this ->io ->note (sprintf ('Start parsing %d out-of-date rst files ' , $ parseCount ));
126
130
$ this ->progressBar = new ProgressBar ($ this ->output , $ parseCount );
127
131
}
0 commit comments