Skip to content

Commit fb547d6

Browse files
committed
example
1 parent 2e36a53 commit fb547d6

File tree

4 files changed

+34
-0
lines changed

4 files changed

+34
-0
lines changed

example/DemoService.php

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
declare(strict_types=1);
3+
4+
namespace Demo;
5+
6+
use PTS\SymfonyDiLoader\CacheWatcher;
7+
8+
class DemoService
9+
{
10+
/** @required-own */
11+
protected CacheWatcher $watcher;
12+
}

example/config/di.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
3+
services:
4+
_defaults:
5+
autowire: true
6+
public: true
7+
8+
Demo\DemoService: ~
9+
PTS\SymfonyDiLoader\CacheWatcher: ~

example/container.php

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
declare(strict_types=1);
3+
4+
use Demo\DemoService;
5+
use PTS\SymfonyDiLoader\LoaderContainer;
6+
7+
require '../vendor/autoload.php';
8+
require_once 'DemoService.php';
9+
10+
$loader = new LoaderContainer;
11+
$container = $loader->getContainer([__DIR__ . '/config/di.yml'], __DIR__ . '/var/di.cache.php');
12+
$service = $container->get(DemoService::class);

example/var/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/*

0 commit comments

Comments
 (0)