Skip to content

Commit

Permalink
Extension: added abstract CompilerExtension with helper
Browse files Browse the repository at this point in the history
  • Loading branch information
f3l1x authored and mabar committed Jan 5, 2020
1 parent 2c19060 commit 9ec2137
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/Extension/CompilerExtension.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php declare(strict_types = 1);

namespace Contributte\DI\Extension;

use Contributte\DI\Helper\ExtensionDefinitionsHelper;
use Nette\DI\CompilerExtension as NCompilerExtension;

abstract class CompilerExtension extends NCompilerExtension
{

/** @var ExtensionDefinitionsHelper|null */
private $helper;

protected function getHelper(): ExtensionDefinitionsHelper
{
if ($this->helper === null) {
$this->helper = new ExtensionDefinitionsHelper($this->compiler);
}

return $this->helper;
}

}

0 comments on commit 9ec2137

Please sign in to comment.