Skip to content

Commit 211657e

Browse files
committed
feat: add template option to DocsCommand and include phpdoc-bootstrap-template dependency
1 parent a2206fd commit 211657e

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"ergebnis/rector-rules": "^1.14",
3232
"esi/phpunit-coverage-check": "^3.0",
3333
"fakerphp/faker": "^1.24",
34+
"fast-forward/phpdoc-bootstrap-template": "^1.0",
3435
"friendsofphp/php-cs-fixer": "^3.94",
3536
"phpdocumentor/shim": "^3.9",
3637
"phpowermove/docblock": "^4.0",

src/Command/DocsCommand.php

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ protected function configure(): void
6363
mode: InputOption::VALUE_OPTIONAL,
6464
description: 'Path to the source directory for the generated HTML documentation.',
6565
default: 'docs',
66+
)
67+
->addOption(
68+
name: 'template',
69+
mode: InputOption::VALUE_OPTIONAL,
70+
description: 'Path to the template directory for the generated HTML documentation.',
71+
default: 'vendor/fast-forward/phpdoc-bootstrap-template',
6672
);
6773
}
6874

@@ -90,10 +96,17 @@ protected function execute(InputInterface $input, OutputInterface $output): int
9096
}
9197

9298
$target = $this->getAbsolutePath($input->getOption('target'));
99+
$template = $input->getOption('template');
93100

94-
$htmlConfig = $this->createPhpDocumentorConfig(source: $source, target: $target, template: 'default');
101+
$htmlConfig = $this->createPhpDocumentorConfig(source: $source, target: $target, template: $template);
95102

96-
$command = new Process([$this->getAbsolutePath('vendor/bin/phpdoc'), '--config', $htmlConfig]);
103+
$command = new Process([
104+
$this->getAbsolutePath('vendor/bin/phpdoc'),
105+
'--config',
106+
$htmlConfig,
107+
'--markers',
108+
'TODO,FIXME,BUG,HACK',
109+
]);
97110

98111
return parent::runProcess($command, $output);
99112
}

0 commit comments

Comments
 (0)