| @@ 208-219 (lines=12) @@ | ||
| 205 | * |
|
| 206 | * @return $this |
|
| 207 | */ |
|
| 208 | public function bind($alias, $resolver) |
|
| 209 | { |
|
| 210 | if (is_array($resolver) || $resolver instanceof \Closure) { |
|
| 211 | $this->bindings[$alias] = [$resolver, false]; |
|
| 212 | ||
| 213 | return $this; |
|
| 214 | } |
|
| 215 | ||
| 216 | $this->bindings[$alias] = $resolver; |
|
| 217 | ||
| 218 | return $this; |
|
| 219 | } |
|
| 220 | ||
| 221 | /** |
|
| 222 | * {@inheritdoc} |
|
| @@ 226-237 (lines=12) @@ | ||
| 223 | * |
|
| 224 | * @return $this |
|
| 225 | */ |
|
| 226 | public function bindSingleton($alias, $resolver) |
|
| 227 | { |
|
| 228 | if (is_object($resolver) && !$resolver instanceof \Closure) { |
|
| 229 | $this->bindings[$alias] = $resolver; |
|
| 230 | ||
| 231 | return $this; |
|
| 232 | } |
|
| 233 | ||
| 234 | $this->bindings[$alias] = [$resolver, true]; |
|
| 235 | ||
| 236 | return $this; |
|
| 237 | } |
|
| 238 | ||
| 239 | /** |
|
| 240 | * {@inheritdoc} |
|