Add support for traits in ClassCollector
authorvictorbarbu <victorbarbu08@gmail.com>
Sat, 6 Feb 2016 14:16:40 +0000 (16:16 +0200)
committerAddshore <addshorewiki@gmail.com>
Wed, 10 Feb 2016 18:11:41 +0000 (18:11 +0000)
Bug: T126116
Change-Id: Ifb81c6844565736111717736fe7649492e31f0f7

includes/utils/AutoloadGenerator.php

index 7d63156..69426d7 100644 (file)
@@ -310,6 +310,7 @@ class ClassCollector {
                case T_NAMESPACE:
                case T_CLASS:
                case T_INTERFACE:
+               case T_TRAIT:
                        $this->startToken = $token;
                }
        }
@@ -331,6 +332,7 @@ class ClassCollector {
 
                case T_CLASS:
                case T_INTERFACE:
+               case T_TRAIT:
                        $this->tokens[] = $token;
                        if ( is_array( $token ) && $token[0] === T_STRING ) {
                                $this->classes[] = $this->namespace . $this->implodeTokens();