Skip to content

Commit

Permalink
AA-2 fixed PHPUnit Framework Exception Undefined offset at BeforeMock…
Browse files Browse the repository at this point in the history
…Transformer.php:72
  • Loading branch information
ahmed-abid committed Feb 14, 2021
1 parent 588d15b commit aa1964e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/AspectMock/Intercept/BeforeMockTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function transform(StreamMetaData $metadata): string
$beforeDefinition = sprintf($beforeDefinition, $params);
$tokenPosition = $method->getNode()->getAttribute('startTokenPos');
do {
if ($metadata->tokenStream[$tokenPosition][1] === '{') {
if (($metadata->tokenStream[$tokenPosition][1] ?? '') === '{') {
$metadata->tokenStream[$tokenPosition][1] .= $beforeDefinition;
$result = self::RESULT_TRANSFORMED;
break;
Expand Down

0 comments on commit aa1964e

Please sign in to comment.