Skip to content

Commit

Permalink
CHG: apply goaop/framework internal changes from goaop/framework@f5e90ff
Browse files Browse the repository at this point in the history
  • Loading branch information
marcovtwout committed Jul 9, 2024
1 parent bfde85b commit 0c89deb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/AspectMock/Intercept/BeforeMockTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ public function transform(StreamMetaData $metadata): string
$beforeDefinition = sprintf($beforeDefinition, $params);
$tokenPosition = $method->getNode()->getAttribute('startTokenPos');
do {
if (($metadata->tokenStream[$tokenPosition][1] ?? '') === '{') {
$metadata->tokenStream[$tokenPosition][1] .= $beforeDefinition;
if (($metadata->tokenStream[$tokenPosition]->text ?? '') === '{') {
$metadata->tokenStream[$tokenPosition]->text .= $beforeDefinition;
$result = self::RESULT_TRANSFORMED;
break;
}
Expand Down
9 changes: 6 additions & 3 deletions src/AspectMock/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
use AspectMock\Intercept\BeforeMockTransformer;
use Go\Core\AspectContainer;
use Go\Core\AspectKernel;
use Go\Core\AdviceMatcher;
use Go\Core\CachedAspectLoader;
use Go\Instrument\ClassLoading\CachePathManager;
use Go\Instrument\ClassLoading\SourceTransformingLoader;
use Go\Instrument\Transformer\CachingTransformer;
use Go\Instrument\Transformer\FilterInjectorTransformer;
Expand Down Expand Up @@ -61,16 +64,16 @@ public function loadFile(string $file)

protected function registerTransformers(): array
{
$cachePathManager = $this->getContainer()->get('aspect.cache.path.manager');
$cachePathManager = $this->getContainer()->getService(CachePathManager::class);

$sourceTransformers = [
new FilterInjectorTransformer($this, SourceTransformingLoader::getId(), $cachePathManager),
new MagicConstantTransformer($this),
new BeforeMockTransformer(
$this,
$this->getContainer()->get('aspect.advice_matcher'),
$this->getContainer()->getService(AdviceMatcher::class),
$cachePathManager,
$this->getContainer()->get('aspect.cached.loader')
$this->getContainer()->getService(CachedAspectLoader::class)
)
];

Expand Down

0 comments on commit 0c89deb

Please sign in to comment.