Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align the output of docgen.php to gen_stub.php #86

Merged
merged 1 commit into from
Aug 2, 2023

Conversation

kocsismate
Copy link
Member

I only fixed a few things, but then realized that it's not possible to completely align the output of the two scripts, since gen_stub.php has much more information about symbols than docgen.php has (like the @readonly or @type PHPDoc).

Copy link
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I never used docgen, so I prefer to see @cmb69's comments.
But it looks sensible to me.

@@ -606,7 +609,7 @@ function gen_class_markup(ReflectionClass $class, $content) { /* {{{ */
}
$markup .= '<classsynopsisinfo role="comment">&InheritedProperties;</classsynopsisinfo>'. PHP_EOL;
foreach ($inherited as $declaring_class) {
$markup .= str_repeat(' ', $ident) ."<xi:include xpointer=\"xmlns(db=http://docbook.org/ns/docbook) xpointer(id('" . strtolower($declaring_class) . ".synopsis')/descendant::db:fieldsynopsis)\"><xi:fallback/></xi:include>". PHP_EOL;
$markup .= str_repeat(' ', $ident) ."<xi:include xpointer=\"xmlns(db=http://docbook.org/ns/docbook) xpointer(id('" . strtolower($declaring_class) . ".synopsis')/descendant::db:fieldsynopsis)\">" . PHP_EOL . str_repeat(' ', $ident + 1) . "<xi:fallback/>" . PHP_EOL . str_repeat(' ', $ident) . "</xi:include>". PHP_EOL;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be better to use "\n" instead of PHP_EOL? As the output on Windows will be different from Nix

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I was thinking about changing this, but at last I decided not to touch so many instances of PHP_EOL (150+). However, this could de addressed in a separate PR if Christoph also agrees.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right makes sense to leave it as is then

@Girgias Girgias merged commit 1bed00a into php:master Aug 2, 2023
@kocsismate kocsismate deleted the sync-stub branch August 4, 2023 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants