Skip to content

Commit 734d932

Browse files
committed
Fix: Fix a bug that class aliases are not parsed properly
Only the first 20 lines of a file is passed for class aliases and when `class_alias()` function is placed after the line 20, it is not picked.
1 parent b93e689 commit 734d932

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Change Log
22

3+
## 1.2.1 - 2020/01/19
4+
- Fixed a bug that class aliases were not parsed properly.
5+
36
## 1.2.0 - 2020/01/19
47
- Added the ability to include class aliases.
58
- Added the `short_array_syntax` argument.

source/PHPClassMapGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* This is meant to be used for the callback function for the spl_autoload_register() function.
1818
*
1919
* @remark The parsed class file must have a name of the class defined in the file.
20-
* @version 1.2.0
20+
* @version 1.2.1
2121
*/
2222
class PHPClassMapGenerator implements interfacePHPClassMapGenerator {
2323

source/Utility/traitCodeParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ private function ___getClassAliasFromToken( array $aTokens, $i ) {
156156
return array();
157157
}
158158
$_aParameters = array();
159-
for ( $_i = $i; $_i < 20; $_i++ ) {
159+
for ( $_i = $i; $_i < count( $aTokens ); $_i++ ) {
160160
if ( ! is_array( $aTokens[ $_i ] ) ) {
161161
continue;
162162
}

0 commit comments

Comments
 (0)