Skip to content

Commit c436e32

Browse files
committed
Cleanup code.
1 parent c47effb commit c436e32

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/PHPProphet.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,17 @@ public function __construct(Prophet $prophet)
2323
public function prophesize(string $namespace): NamespaceProphecy
2424
{
2525
$textTemplate = new Template(__DIR__ . '/function.tpl');
26-
$functionProphecyStorage = FunctionProphecyStorage::getInstance();
2726
$functionRevealer = new FunctionRevealer($textTemplate);
27+
$functionProphecyStorage = FunctionProphecyStorage::getInstance();
28+
29+
$namespaceProphecy = new NamespaceProphecy(
30+
$this->prophet,
31+
$namespace,
32+
$functionProphecyStorage,
33+
$functionRevealer
34+
);
35+
$this->namespaceProphecies[$namespace] = $namespaceProphecy;
2836

29-
$this->namespaceProphecies[$namespace] = new NamespaceProphecy($this->prophet, $namespace, $functionProphecyStorage, $functionRevealer);
3037
return $this->namespaceProphecies[$namespace];
3138
}
3239

src/PHPProphetTrait.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,9 @@ public function runBare(): void
6161
try {
6262
parent::runBare();
6363
} finally {
64-
if ($this->phpProphet)
64+
if ($this->phpProphet) {
6565
$this->phpProphet->unReveal();
66+
}
6667
}
6768
}
6869
}

0 commit comments

Comments
 (0)