AutoloadGenerator: Filter PSR4-compliant classes instead of ignoring directories
authorBrad Jorsch <bjorsch@wikimedia.org>
Thu, 20 Sep 2018 17:44:35 +0000 (13:44 -0400)
committerBrad Jorsch <bjorsch@wikimedia.org>
Thu, 20 Sep 2018 19:15:27 +0000 (15:15 -0400)
commitca3789a271b982580c0be0b92599fa37f5c5948d
treee50b363699dd0136e7a1630204aaef7c989d6a49
parent62c6f40d73637c777a6bf14eaa4d1512e6663170
AutoloadGenerator: Filter PSR4-compliant classes instead of ignoring directories

Per discussion in T166010, we're going to handle class aliases (e.g. for
BC) by including the class_alias() call in the same file as the target
class. When the target class is a PSR4-compliant class, we still need to
pick up that alias for inclusion in autoload.php.

Thus, instead of excluding whole directories, we need to process the
files and filter out only those found classes that are PSR4 compliant.

Bug: T204983
Change-Id: I1c516998df368531c90ea54acc5be8be96e1db6c
includes/utils/AutoloadGenerator.php
maintenance/generateLocalAutoload.php
tests/phpunit/structure/AutoLoaderStructureTest.php