Skip to content

Commit 3074be4

Browse files
committed
Implement NEON dependencies as DIC extension
1 parent ec95066 commit 3074be4

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

common.neon

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
services:
2-
- Mathematicator\Statistics\StatisticsManager
1+
extensions:
2+
mathematicator.statistic: Mathematicator\Statistics\StatisticExtension

src/StatisticExtension.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Mathematicator\Statistics;
6+
7+
8+
use Nette\DI\CompilerExtension;
9+
10+
final class StatisticExtension extends CompilerExtension
11+
{
12+
public function beforeCompile(): void
13+
{
14+
$builder = $this->getContainerBuilder();
15+
16+
$builder->addDefinition($this->prefix('statisticsManager'))
17+
->setFactory(StatisticsManager::class);
18+
}
19+
}

0 commit comments

Comments
 (0)