mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
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
This commit is contained in:
parent
be69262137
commit
b06f2bc67c
1 changed files with 10 additions and 4 deletions
|
@ -2610,7 +2610,7 @@ class ConstInfo extends VariableLike
|
||||||
{
|
{
|
||||||
$className = str_replace(["\\", "_"], ["-", "-"], $this->name->class->toLowerString());
|
$className = str_replace(["\\", "_"], ["-", "-"], $this->name->class->toLowerString());
|
||||||
|
|
||||||
return "$className.constants." . strtolower(str_replace(["__", "_"], ["", "-"], $this->name->getDeclarationName()));
|
return "$className.constants." . strtolower(str_replace("_", "-", trim($this->name->getDeclarationName(), "_")));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getFieldSynopsisName(): string
|
protected function getFieldSynopsisName(): string
|
||||||
|
@ -3052,7 +3052,7 @@ class PropertyInfo extends VariableLike
|
||||||
{
|
{
|
||||||
$className = str_replace(["\\", "_"], ["-", "-"], $this->name->class->toLowerString());
|
$className = str_replace(["\\", "_"], ["-", "-"], $this->name->class->toLowerString());
|
||||||
|
|
||||||
return "$className.props." . strtolower(str_replace(["__", "_"], ["", "-"], $this->name->getDeclarationName()));
|
return "$className.props." . strtolower(str_replace("_", "-", trim($this->name->getDeclarationName(), "_")));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getFieldSynopsisName(): string
|
protected function getFieldSynopsisName(): string
|
||||||
|
@ -6424,8 +6424,14 @@ if ($generateMethodSynopses) {
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($methodSynopses as $filename => $content) {
|
foreach ($methodSynopses as $filename => $content) {
|
||||||
if (!file_exists("$manualTarget/$filename")) {
|
$path = "$manualTarget/$filename";
|
||||||
if (file_put_contents("$manualTarget/$filename", $content)) {
|
|
||||||
|
if (!file_exists($path)) {
|
||||||
|
if (!file_exists(dirname($path))) {
|
||||||
|
mkdir(dirname($path));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (file_put_contents($path, $content)) {
|
||||||
echo "Saved $filename\n";
|
echo "Saved $filename\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue