Skip to content

Commit 54b2fed

Browse files
committed
Add example for #78
Closes #78.
1 parent a61e78c commit 54b2fed

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
use Auryn\Injector;
4+
5+
require __DIR__ . "/../vendor/autoload.php";
6+
7+
$injector = new Injector;
8+
9+
class A {
10+
public $std;
11+
12+
public function __construct(stdClass $std) {
13+
$this->std = $std;
14+
}
15+
}
16+
17+
$stdClass = new stdClass;
18+
$stdClass->foo = "foobar";
19+
20+
$a = $injector->make(A::class, [
21+
":std" => $stdClass,
22+
]);
23+
24+
print $a->std->foo . PHP_EOL;

0 commit comments

Comments
 (0)