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

Function trailing commas #241

Closed
wants to merge 3 commits into from
Closed

Function trailing commas #241

wants to merge 3 commits into from

Conversation

Crell
Copy link
Contributor

@Crell Crell commented Nov 25, 2020

  • Trailing commas in function parameter list.
  • Trailing commas in use clause.
  • Minor language change along the way.
  • I have no idea what the difference is between para and simplepara...

$second_arg,
$a_very_long_argument_name,
$arg_with_default = 5,
$again = 'a default string', // This trailing comma is optional as of PHP 8.0.0
Copy link
Member

Choose a reason for hiding this comment

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

I feel how this comment is written it means that prior to PHP 8.0.0 the trailing comma was mandatory

@cmb69
Copy link
Contributor

cmb69 commented Nov 28, 2020

<simpara> is somewhat like a HTML <p>, but <para> is more like a <div>. See https://tdg.docbook.org/tdg/4.5/para.html#d0e133584 for a more specific explanation.

That said, I think that currently PhD treats both pretty similar, and in practise, the documentation mostly uses <para>.

@Girgias
Copy link
Member

Girgias commented Nov 28, 2020

<simpara> is somewhat like a HTML <p>, but <para> is more like a <div>. See https://tdg.docbook.org/tdg/4.5/para.html#d0e133584 for a more specific explanation.

That said, I think that currently PhD treats both pretty similar, and in practise, the documentation mostly uses <para>.

I think the only important distinction is when it's inside a <note>, <warning>, etc. element. With a simpara you'll get something like:

Note: simpara content

whereas with a para you get:

Note:

Para content

@Crell
Copy link
Contributor Author

Crell commented Nov 28, 2020

Updated the comment.

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.

LGTM :)

@php-pulls php-pulls closed this in 574f492 Nov 28, 2020
@cmb69
Copy link
Contributor

cmb69 commented Nov 28, 2020

Thanks!

It seems that the manual is generally sloppy regarding the term "argument", so I left it as is, but in the long run we may consider to distinguish between "parameter" and "argument" (or "formal parameter" and "actual parameter").

@Crell Crell deleted the func-comma branch November 29, 2020 18:40
@Crell
Copy link
Contributor Author

Crell commented Nov 29, 2020

What even is the difference between an argument and a parameter? I've generally seen/used them interchangeably.

@cmb69
Copy link
Contributor

cmb69 commented Nov 29, 2020

@Girgias
Copy link
Member

Girgias commented Nov 29, 2020

Huh, I've been getting the proper order wrong then apparently, oh well TIL

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.

None yet

3 participants