Basic.php
5 years ago
Call.php
5 years ago
ConstructParams.php
5 years ago
CreateArgs.php
5 years ago
NamedInstances.php
5 years ago
Namespace.php
5 years ago
ShareInstances.php
2 years ago
NamedInstances.php
55 lines
| 1 | <?php |
| 2 | /* @description Dice - A minimal Dependency Injection Container for PHP * |
| 3 | * @author Tom Butler tom@r.je * |
| 4 | * @copyright 2012-2018 Tom Butler <tom@r.je> | https:// r.je/dice.html * |
| 5 | * @license http:// www.opensource.org/licenses/bsd-license.php BSD License * |
| 6 | * @version 3.0 */ |
| 7 | class Z { |
| 8 | public $y1; |
| 9 | public $y2; |
| 10 | public function __construct(Y $y1, Y $y2) { |
| 11 | $this->y1 = $y1; |
| 12 | $this->y2 = $y2; |
| 13 | } |
| 14 | } |
| 15 | |
| 16 | class Y1 { |
| 17 | public $y2; |
| 18 | |
| 19 | public function __construct(Y2 $y2) { |
| 20 | $this->y2 = $y2; |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | |
| 25 | class Y2 { |
| 26 | public $name; |
| 27 | |
| 28 | public function __construct($name) { |
| 29 | $this->name = $name; |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | class Y3 extends Y2 { |
| 34 | |
| 35 | } |
| 36 | |
| 37 | |
| 38 | class Y { |
| 39 | public $name; |
| 40 | public function __construct($name) { |
| 41 | $this->name = $name; |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | |
| 46 | class HasTwoSameDependencies { |
| 47 | public $y2a; |
| 48 | public $y2b; |
| 49 | |
| 50 | public function __construct(Y2 $y2a, Y2 $y2b) { |
| 51 | $this->y2a = $y2a; |
| 52 | $this->y2b = $y2b; |
| 53 | } |
| 54 | } |
| 55 |