Have ClassCollector ignore PHP 7 anonymous classes
authorBrad Jorsch <bjorsch@wikimedia.org>
Tue, 1 May 2018 17:13:37 +0000 (13:13 -0400)
committerBrad Jorsch <bjorsch@wikimedia.org>
Tue, 1 May 2018 17:13:37 +0000 (13:13 -0400)
commite5abec805272980cf02d2f9b8ab2d56983a668db
tree5a2ab2952b65e34d1582a21173914e1c780dc46e
parentebc32b659a3528991f0d8943699c62d15448dd56
Have ClassCollector ignore PHP 7 anonymous classes

PHP 7 introduces anonymous classes with a syntax like

 $instance = new class() extends Foo { ... };

ClassCollector is incorrectly detecting this as a class named
"() extends Foo". This patch fixes that by having it ignore "new class"
in much the same way it currently ignores "::class".

Change-Id: I4d1985a9c04be71f7bea6cb7b61dcea74f44a6e2
includes/utils/AutoloadGenerator.php
tests/phpunit/includes/utils/ClassCollectorTest.php