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