Skip to content

Commit

Permalink
Add specific class and nullable typehints to spec
Browse files Browse the repository at this point in the history
  • Loading branch information
cconard96 authored and trasher committed Oct 6, 2020
1 parent eb6055a commit eca3dbe
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion source/codingstandards.rst
Original file line number Diff line number Diff line change
Expand Up @@ -368,9 +368,12 @@ boolean Logical type (true or false)
string String type (any value in ``""`` or ``' '``)
array Array type
object Object type
ressource Resource type (as returned from ``mysql_connect`` function)
resource Resource type (as returned from ``mysql_connect`` function)
========= ===========

You may also use a specific class for the type as a replacement for `object` when you know the exact type of data being used. This is recommended if you use typehints.
Since PHP 7.1, you can have nullable typehints for method parameters and return types. You should prepend a `?` to the above types if they are nullable.

Inserting comment in source code for doxygen.
Result : full doc for variables, functions, classes...

Expand Down

0 comments on commit eca3dbe

Please sign in to comment.