| @@ 47-56 (lines=10) @@ | ||
| 44 | * |
|
| 45 | * @return void |
|
| 46 | */ |
|
| 47 | public function bind(string $scope, string $abstract, string $concrete) |
|
| 48 | { |
|
| 49 | $this->validateScope(__METHOD__, $scope); |
|
| 50 | ||
| 51 | if ($scope === self::SCOPE_INSTANCE_PER_RESOLVE) { |
|
| 52 | $this->container->bind($abstract, $concrete); |
|
| 53 | } else { |
|
| 54 | $this->container->singleton($abstract, $concrete); |
|
| 55 | } |
|
| 56 | } |
|
| 57 | ||
| 58 | /** |
|
| 59 | * Binds the supplied class or interface to the return value |
|
| @@ 68-77 (lines=10) @@ | ||
| 65 | * |
|
| 66 | * @return void |
|
| 67 | */ |
|
| 68 | public function bindCallback(string $scope, string $abstract, callable $factory) |
|
| 69 | { |
|
| 70 | $this->validateScope(__METHOD__, $scope); |
|
| 71 | ||
| 72 | if ($scope === self::SCOPE_INSTANCE_PER_RESOLVE) { |
|
| 73 | $this->container->bind($abstract, $factory); |
|
| 74 | } else { |
|
| 75 | $this->container->singleton($abstract, $factory); |
|
| 76 | } |
|
| 77 | } |
|
| 78 | ||
| 79 | /** |
|
| 80 | * Binds the supplied abstract class or interface to the supplied value. |
|