diff --git a/lib/class-file-reflector.php b/lib/class-file-reflector.php index 5b01e8d..62f401d 100644 --- a/lib/class-file-reflector.php +++ b/lib/class-file-reflector.php @@ -171,7 +171,10 @@ public function leaveNode( \PHPParser_Node $node ) { break; case 'Stmt_Function': - end( $this->functions )->uses = array_pop( $this->location )->uses; + $function = array_pop( $this->location ); + if ( isset( $function->uses ) && ! empty( $function->uses ) ) { + end( $this->functions )->uses = $function->uses; + } break; case 'Stmt_ClassMethod':