Skip to content
Commit 9730beeb authored by Matthijs Tijink's avatar Matthijs Tijink Committed by Alexander Zhigalin
Browse files

Use null default types for determining argument type in PHP

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`.

Reviewers: #kdevelop

Subscribers: kdevelop-devel, #kdevelop

Tags: #kdevelop

Differential Revision: https://phabricator.kde.org/D6915
parent 2c863b8a
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment