-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathLateModule.php
More file actions
50 lines (44 loc) · 1.34 KB
/
LateModule.php
File metadata and controls
50 lines (44 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
declare(strict_types=1);
namespace Inpsyde\App\Tests\Project\ModularityLib;
use Inpsyde\App\Tests\Project\ModularityPlugin3\Calc;
use Inpsyde\Modularity\Module\ServiceModule;
use Psr\Container\ContainerInterface;
use Psr\Log\LoggerInterface;
final class LateModule extends BaseModule
{
/**
* @param ContainerInterface $container
* @return bool
*/
public function run(ContainerInterface $container): bool
{
add_action(
'shutdown',
static function () use ($container): void {
$calc = $container->get(Calc::class);
$result = $calc->calculate('7', '*', '7');
$container->get(LoggerInterface::class)->debug("Result is: {$result}");
},
PHP_INT_MAX
);
return parent::run($container);
}
public function services(): array
{
return array_merge(
parent::services(),
[
// phpcs:ignore Inpsyde.CodeQuality.ReturnTypeDeclaration.NoReturnType
'dummy-test' => static function () {
return new class {
public function text(): string
{
return 'Hello World';
}
};
},
]
);
}
}