Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit b06f2bc

Browse files
Improve documentation generation
- Really trim leading and trailing hyphens (single hyphens were not trimmed before) - Create the necesary directories for even namespaced methods when generating methodsynopsis
1 parent be69262 commit b06f2bc

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

‎build/gen_stub.php‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2610,7 +2610,7 @@ protected function getFieldSynopsisDefaultLinkend(): string
26102610
{
26112611
$className = str_replace(["\\", "_"], ["-", "-"], $this->name->class->toLowerString());
26122612

2613-
return "$className.constants." . strtolower(str_replace(["__", "_"], ["", "-"], $this->name->getDeclarationName()));
2613+
return "$className.constants." . strtolower(str_replace("_", "-", trim($this->name->getDeclarationName(), "_")));
26142614
}
26152615

26162616
protected function getFieldSynopsisName(): string
@@ -3052,7 +3052,7 @@ protected function getFieldSynopsisDefaultLinkend(): string
30523052
{
30533053
$className = str_replace(["\\", "_"], ["-", "-"], $this->name->class->toLowerString());
30543054

3055-
return "$className.props." . strtolower(str_replace(["__", "_"], ["", "-"], $this->name->getDeclarationName()));
3055+
return "$className.props." . strtolower(str_replace("_", "-", trim($this->name->getDeclarationName(), "_")));
30563056
}
30573057

30583058
protected function getFieldSynopsisName(): string
@@ -6424,8 +6424,14 @@ function(?ArgInfo $aliasArg, ?ArgInfo $aliasedArg) use ($aliasFunc, $aliasedFunc
64246424
}
64256425

64266426
foreach ($methodSynopses as $filename => $content) {
6427-
if (!file_exists("$manualTarget/$filename")) {
6428-
if (file_put_contents("$manualTarget/$filename", $content)) {
6427+
$path = "$manualTarget/$filename";
6428+
6429+
if (!file_exists($path)) {
6430+
if (!file_exists(dirname($path))) {
6431+
mkdir(dirname($path));
6432+
}
6433+
6434+
if (file_put_contents($path, $content)) {
64296435
echo "Saved $filename\n";
64306436
}
64316437
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /