Skip to content

Commit

Permalink
Merge pull request #190 from ahmed-abid/AA-2
Browse files Browse the repository at this point in the history
AA-2 fixed PHPUnit Framework Exception Undefined offset at  BeforeMoc…
  • Loading branch information
Naktibalda committed Apr 10, 2021
2 parents a4adb2a + aa1964e commit eef5e5e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/AspectMock/Intercept/BeforeMockTransformer.php
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 eef5e5e

Please sign in to comment.