-
Notifications
You must be signed in to change notification settings - Fork 1
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
Remove synopsis code that is not php #4
Comments
We'll have to look at the docbook code but I'm fairly certain it's using semantic markup where the return type must come first. We can transform it to the latter type but I'm pretty sure it needs to remain the same in docbook. This would be a good enhancement to do. |
Actually, it would be very good if we could do this without changing documentation sources. No need to update ~80% files and making trouble for the translations. @morrisonlevi feel free to assign me, I will look into it. I remember Hannes (PhD's creator) saying it's hard to implement, but it's worth trying. |
Implemented as feature branch in Sobak/phd. Sobak/phd@composer...php-methodsynopsis - two separate commits so it's easier to review. Return type + removed brackets around optional parameters: I wasn't, however, able to remove those spacings. It doesn't require changes in DocBook except of:
Please note that changes are affecting only PHP Package. Thoughts? |
What spacing are you talking about getting rid of? The stuff around |
Yep. This plus spaces before commas. I thought about using |
The visual changes look good - I will review the code changes later. Thank you for looking at this! |
You welcome :) |
I'm hugely in favor of introducing PHP style return type definition but I don't think that removing brackets from optional parameters is good. This is de facto standard across documentation of all languages even if it's not directly reflected by language syntax. It makes easier to spot place where required parameters ends, rather than searching for first occurrence of single |
It looks as if it always adds the colon whether there is a return type. Are we certain all of them use |
As the return type is optional, we should be following the PHP7 code style of a return type being |
Isn't that exactly what is on the screens (and thus implementation)? I don't see a difference |
Ha! I failed to type the rest of my message. It was in my head. Just never made it to my fingers. As the return type is optional, we should be following the PHP7 code style of a return type being Having said that, a Consideration of potential union types (rather than dumb But that's a PHP 7.1 syntax and so for PHP < 7.1 the syntax, as a template for new users to write their own code, is wrong. But I can live with that. Having said that, http://tdg.docbook.org/tdg/5.2/methodsynopsis.html doesn't seem to allow for multiple |
I've made a suggestion to DocBook to allow a node for multiple types (docbook/docbook#91). We shall see what happens there. |
Nice, thanks for taking the initiative. And good luck, obviously! |
should be converted to
or even brackets around optional parameters, etc.
The php syntax alone is enough to describe itself, there is no need for stuff that belongs to other languages. In fact, i'm sure that the manual syntax not matching php's, makes thing more difficult for novices.
The text was updated successfully, but these errors were encountered: