Skip to content

Commit

Permalink
[INFR] Updated genmethoddocs
Browse files Browse the repository at this point in the history
  • Loading branch information
HorstOeko committed Dec 8, 2024
1 parent 5c67f6b commit dc59539
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions make/genmethoddocs.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,23 @@ class ExtractClass
*/
protected $className = "";

/**
* Class + method name to ignore in inheritance check
*
* @var array
*/
protected $ignoreInheritance = [];

/**
* Constructor
*
* @param string $className
* @param array $ignoreInheritance
*/
public function __construct(string $className)
public function __construct(string $className, array $ignoreInheritance = [])
{
$this->className = $className;
$this->ignoreInheritance = $ignoreInheritance;
}

/**
Expand Down Expand Up @@ -125,7 +134,9 @@ public function getArray(): array

foreach ($methods as $method) {
if ($method->getDeclaringClass()->getName() != $this->className) {
continue;
if (!in_array(sprintf('%s::%s', $this->className, $method->getName()), $this->ignoreInheritance)) {
continue;
}
}

$docComment = $method->getDocComment();
Expand Down Expand Up @@ -691,10 +702,10 @@ class BatchMarkDownGenerator
* @throws PcreException
* @throws LogicException
*/
public static function generate(array $classes)
public static function generate(array $classes, array $ignoreInheritance = [])
{
foreach ($classes as $className => $toFilename) {
$extractor = new ExtractClass($className);
$extractor = new ExtractClass($className, $ignoreInheritance);
$generator = new MarkDownGenerator($extractor);
$generator->generateMarkdown();
$generator->saveToFile($toFilename);
Expand All @@ -719,4 +730,7 @@ public static function generate(array $classes)
ZugferdQuickDescriptorXRechnung::class => dirname(__FILE__) . '/Class-ZugferdQuickDescriptorXRechnung.md',
ZugferdQuickDescriptorXRechnung2::class => dirname(__FILE__) . '/Class-ZugferdQuickDescriptorXRechnung2.md',
ZugferdQuickDescriptorXRechnung3::class => dirname(__FILE__) . '/Class-ZugferdQuickDescriptorXRechnung3.md',
], [
'horstoeko\zugferd\ZugferdDocumentPdfBuilder::setDeterministicModeEnabled',
'horstoeko\zugferd\ZugferdDocumentPdfMerger::setDeterministicModeEnabled',
]);

0 comments on commit dc59539

Please sign in to comment.