troizet opened a new pull request, #6065:
URL: https://github.com/apache/netbeans/pull/6065
What was done in this PR:
- Changed the way `null` is parsed similar to true and false
- Fixed displaying `null` value for constant in navigator and in autocomplete
for example:
```php
define('TEST_CONST', null);
```
in navigator:
before:

after:

in autocompletion and documentation:
before:

after:

Similarly for class constants.
- Fixed guessing the returned `null` type in documentation, in the navigator
and during phpDoc comment generation
for example:
```php
function test()
{
if ($z) {
return 'str';
}
return null;
}
test();
```
in navigator:
before:

after:

in documentation:
before:

after:

phpDoc generation:
before:

after:

- Fixed broken tests
- Added parser test for `true`, `false`, `null`
- Added documentation test to guess the returned `null` type
- Added phpDoc generation test to guess the returned `null` type
The reason for these changes is that the return type of a function that
contains the `return null` is guessed correctly only if `null` is parsed as a
scalar.
In this case the conditions are satisfied:
https://github.com/apache/netbeans/blob/c649c8287923460591fa7e343c6d8ac46b7e872b/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/ModelVisitor.java#L314-L316
https://github.com/apache/netbeans/blob/c649c8287923460591fa7e343c6d8ac46b7e872b/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/VariousUtils.java#L432-L445
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists