Skip to content

Commit

Permalink
The autoloader is now working correctly with classes created with cla…
Browse files Browse the repository at this point in the history
…ss_alias() (ref #1452)
  • Loading branch information
gsherwood committed May 9, 2017
1 parent 4aff5b2 commit ad5a352
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public static function loadFile($path)
include $path;

$className = null;
$newClasses = array_diff(get_declared_classes(), $classes);
$newClasses = array_reverse(array_diff(get_declared_classes(), $classes));
foreach ($newClasses as $name) {
if (isset(self::$loadedFiles[$name]) === false) {
$className = $name;
Expand All @@ -165,7 +165,7 @@ public static function loadFile($path)
}

if ($className === null) {
$newClasses = array_reverse(array_diff(get_declared_traits(), $classes));
$newClasses = array_reverse(array_diff(get_declared_interfaces(), $classes));
foreach ($newClasses as $name) {
if (isset(self::$loadedFiles[$name]) === false) {
$className = $name;
Expand All @@ -175,7 +175,7 @@ public static function loadFile($path)
}

if ($className === null) {
$newClasses = array_reverse(array_diff(get_declared_interfaces(), $classes));
$newClasses = array_reverse(array_diff(get_declared_traits(), $classes));
foreach ($newClasses as $name) {
if (isset(self::$loadedFiles[$name]) === false) {
$className = $name;
Expand Down
1 change: 1 addition & 0 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
- PHPCS now stops looking for a phpcs.xml file as soon as one is found, favoring the closest one to the current dir
- Added missing help text for the --stdin-path CLI option to --help
- The Squiz standard now enforces short array syntax by default
- The autoloader is now working correctly with classes created with class_alias()
- Fixed bug #1442 : T_NULLABLE detection not working for nullable parameters and return type hints in some cases
- Fixed bug #1447 : Running the unit tests with a phpunit config file breaks the test suite
-- Unknown arguments were not being handled correctly, but are now stored in $config->unknown
Expand Down

0 comments on commit ad5a352

Please sign in to comment.