Page MenuHomePhabricator

CI should fail on "Use statement with non-compound name has no effect" warnings
Closed, DuplicatePublic


PHP reports a warning if a use statement for a non-namespaced class is used in a non-namespaced context.

$ git checkout c48f489ba6
$ php5 -l tests/phpunit/includes/libs/rdbms/database/DatabaseSQLTest.php
PHP Warning:  The use statement with non-compound name 'InvalidArgumentException' has no effect in tests/phpunit/includes/libs/rdbms/database/DatabaseSQLTest.php on line 3
No syntax errors detected in tests/phpunit/includes/libs/rdbms/database/DatabaseSQLTest.php
$ echo $?

This warning is printed during the mediawiki-core-php55lint and mediawiki-phpunit-php55-jessie jobs, but doesn't cause either to fail. HHVM seems to not warn about it.