SVN precommit and nullable return types

When committing my plugin to the repo, I'm getting an error that looks like this:

Commit blocked by pre-commit hook (exit code 1) with output:


***********************************
PHP error in: path/to/file.php:


Parse error: syntax error, unexpected '?' in path/to/file.php on line 36
Errors parsing path/to/filephp

Examining the line in question, I see that the ? is part of one of PHP 7.1's nullable return types:

static function foo($bar=null): ?string { ... }

Note that my readme.txt file correctly notes the minimum PHP version, if that makes any difference to the parser. If not, do I need to remove all my nullable return types for now?

Topic php svn Wordpress

Category Web


Linting only supports 7.0 and down. Nullable Types are available in PHP 7.1, so 7.1 code will fail. You will have to change it.

Good Luck!

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.