Skip to content

Split type declaration into its own page#174

Closed
Girgias wants to merge 18 commits intophp:masterfrom
Girgias:type-declaration-page
Closed

Split type declaration into its own page#174
Girgias wants to merge 18 commits intophp:masterfrom
Girgias:type-declaration-page

Conversation

@Girgias
Copy link
Copy Markdown
Member

@Girgias Girgias commented Nov 1, 2020

Also adds a section about union types.

Copy link
Copy Markdown
Member

@cmb69 cmb69 left a comment

Choose a reason for hiding this comment

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

Thanks for working on this! Moving the type declaration documentation to an appropriate place is long overdue, and having union types documented help to simplify the PHP 8.0 migration guide a bit.

@cmb69 cmb69 changed the title Split type declaration into it's own page Split type declaration into its own page Nov 1, 2020
<sect2 xml:id="language.types.declarations.return-only">
<title>Return only types</title>

<sect3 xml:id="language.types.declarations.void">
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Would it make sense to somehow unify/merge this section with

<sect2 xml:id="language.types.void">
<title>void</title>
<para>
<literal>void</literal> as a return type means that the return value is
useless. <literal>void</literal> in a parameter list means that the function
doesn't accept any parameters. As of PHP 7.1 <literal>void</literal> is accepted as a function return type hint.
</para>
</sect2>

and have void's own section (&language.types.void;)? I'd really like to drop the pseudo-types section; mixed is a built-in type as well now, and number could be replaced with the respective union type; and variadics are being worked on already.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Seems reasonable, I suppose I could add a note which goes along the lines:

<note>
 <para>
   The PHP documentation uses <literal>void</literal> in an argument list to convey that a function doesn't accept any arguments.
 </para>
</note>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe we should drop that as well? Using void to indicate no arguments is a C-ism, I don't think there's any value in doing that in the PHP manual.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@cmb69
Copy link
Copy Markdown
Member

cmb69 commented Nov 1, 2020

Also, before actually removing a page from the manual (language/oop5/typehinting.xml in this case), it might be sensible to cater to existing user notes (i.e. integrate or remove).

@Girgias
Copy link
Copy Markdown
Member Author

Girgias commented Nov 1, 2020

Also, before actually removing a page from the manual (language/oop5/typehinting.xml in this case), it might be sensible to cater to existing user notes (i.e. integrate or remove).

The notes all seems updated and irrelevant to some extend by just being benchmarks (I noted that Nikita also removed a bunch just now)

@Girgias Girgias force-pushed the type-declaration-page branch from e9f4a90 to 00c5f0e Compare November 6, 2020 17:02
@Girgias Girgias force-pushed the type-declaration-page branch from 00c5f0e to 7ffa2d0 Compare November 6, 2020 17:15
@Girgias
Copy link
Copy Markdown
Member Author

Girgias commented Nov 6, 2020

So I still don't know what to do with the two examples in the temporary "Misc" section, any ideas?

@cmb69 cmb69 mentioned this pull request Nov 8, 2020
@Girgias Girgias force-pushed the type-declaration-page branch from 7ffa2d0 to 8272cf1 Compare November 8, 2020 19:20
@Girgias Girgias force-pushed the type-declaration-page branch from 8272cf1 to 8eb85e7 Compare November 9, 2020 13:35
@php-pulls php-pulls closed this in a9a6224 Nov 12, 2020
@Girgias Girgias deleted the type-declaration-page branch November 12, 2020 18:42
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.

3 participants