Skip to content

Commit

Permalink
properly wrapping asts in object
Browse files Browse the repository at this point in the history
  • Loading branch information
Idrinth committed Jun 3, 2018
1 parent df7a91a commit 2e378ed
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace ComposerRequireCheckerTest\DefinedSymbolsLocator;

use ArrayObject;
use ComposerRequireChecker\ASTLocator\FileAST;
use ComposerRequireChecker\DefinedSymbolsLocator\LocateDefinedSymbolsFromASTRoots;
use PhpParser\Node\Arg;
use PhpParser\Node\Expr\FuncCall;
Expand Down Expand Up @@ -131,6 +132,9 @@ public function testBasicDoNotLocateNamespacedDefineCalls()

private function locate(array $roots): array
{
foreach($roots as &$ast) {
$ast = new FileAST('', $ast);
}
return ($this->locator)(new ArrayObject($roots));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ public function testLocate()
*/
private function locate(array $asts): array
{
return ($this->locator)(new FileAST('', new ArrayObject($asts)));
foreach($asts as &$ast) {
$ast = new FileAST('', $ast);
}
return ($this->locator)(new ArrayObject($asts));
}
}

0 comments on commit 2e378ed

Please sign in to comment.