D6915: Use null default types for determining argument type in PHP

Matthijs Tijink noreply at phabricator.kde.org
Wed Jul 26 09:34:01 UTC 2017


mtijink created this revision.
mtijink added a project: KDevelop.
Restricted Application added a subscriber: kdevelop-devel.

REVISION SUMMARY
  PHP allows default values for function arguments, even with typehints set. This does not affect the type given to the function because PHP converts it to declared type.
  
  There is one exception: when the default value is `null`, PHP changes the allowed types to be passed to `typehint|null`. In fact, before PHP 7.1, this was the only way to allow passing `null` instead of an object when a typehint was used.
  
  This diff implements this: when a `null` default type is passed, the argument type will be `typehint|null`.

REPOSITORY
  R52 KDevelop: PHP Support

REVISION DETAIL
  https://phabricator.kde.org/D6915

AFFECTED FILES
  duchain/helper.cpp
  duchain/tests/duchain.cpp
  duchain/tests/duchain.h

To: mtijink, #kdevelop
Cc: kdevelop-devel, #kdevelop, geetamc, Pilzschaf, akshaydeo, surgenight, arrowdodger
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20170726/a5c94ec8/attachment.html>


More information about the KDevelop-devel mailing list