-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Display a progress bar during parsing * Display one progress bar per renderer * Introduce an event once the files have been collected for parsing This gives me progress bars like this after rendering: Parsing: 16/16 [============================] 100% Parsed 16 files in 0.98 seconds Rendering: 16/16 [============================] 100% Output format html: Rendered 16 documents in 0.71 seconds Rendering: 16/16 [============================] 100% Output format interlink: Rendered 16 documents in 0.00 seconds During rendering and during parsing the currently handled file is displayed.
- Loading branch information
Showing
7 changed files
with
156 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
packages/guides/src/Event/PostCollectFilesForParsingEvent.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace phpDocumentor\Guides\Event; | ||
|
||
use phpDocumentor\Guides\Files; | ||
use phpDocumentor\Guides\Handlers\ParseDirectoryCommand; | ||
|
||
/** | ||
* This event is called after all files have been collected for parsing | ||
* But before the actual parsing begins. | ||
* | ||
* It can be used to manipulate the files to be parsed. | ||
*/ | ||
final class PostCollectFilesForParsingEvent | ||
{ | ||
public function __construct( | ||
private readonly ParseDirectoryCommand $command, | ||
private Files $files, | ||
) { | ||
} | ||
|
||
public function getCommand(): ParseDirectoryCommand | ||
{ | ||
return $this->command; | ||
} | ||
|
||
public function getFiles(): Files | ||
{ | ||
return $this->files; | ||
} | ||
|
||
public function setFiles(Files $files): void | ||
{ | ||
$this->files = $files; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters