interface Illuminate / Contracts / Container / Container

Container

Methods

public

bound ( $abstract ) : bool

Determine if the given abstract type has been bound.

Parameters

  • $abstract string
public

alias ( $abstract , $alias ) : void

Alias a type to a different name.

Parameters

  • $abstract string
  • $alias string
public

tag ( $abstracts , $tags ) : void

Assign a set of tags to a given binding.

Parameters

  • $abstracts array|string
  • $tags array|mixed
public

tagged ( $tag ) : iterable

Resolve all of the bindings for a given tag.

Parameters

  • $tag string
public

bind ( $abstract , $concrete , $shared ) : void

Register a binding with the container.

Parameters

  • $abstract string
  • $concrete Closure |string|null
  • $shared bool
public

bindMethod ( $method , $callback ) : void

Bind a callback to resolve with Container::call.

Parameters

  • $method array|string
  • $callback Closure
public

bindIf ( $abstract , $concrete , $shared ) : void

Register a binding if it hasn't already been registered.

Parameters

  • $abstract string
  • $concrete Closure |string|null
  • $shared bool
public

singleton ( $abstract , $concrete ) : void

Register a shared binding in the container.

Parameters

  • $abstract string
  • $concrete Closure |string|null
public

singletonIf ( $abstract , $concrete ) : void

Register a shared binding if it hasn't already been registered.

Parameters

  • $abstract string
  • $concrete Closure |string|null
public

scoped ( $abstract , $concrete ) : void

Register a scoped binding in the container.

Parameters

  • $abstract string
  • $concrete Closure |string|null
public

scopedIf ( $abstract , $concrete ) : void

Register a scoped binding if it hasn't already been registered.

Parameters

  • $abstract string
  • $concrete Closure |string|null
public

extend ( $abstract , Closure $closure ) : void

"Extend" an abstract type in the container.

Parameters

public

instance ( $abstract , $instance ) : mixed

Register an existing instance as shared in the container.

Parameters

  • $abstract string
  • $instance mixed
public

addContextualBinding ( $concrete , $abstract , $implementation ) : void

Add a contextual binding to the container.

Parameters

  • $concrete string
  • $abstract string
  • $implementation Closure |string
public

when ( $concrete ) : ContextualBindingBuilder

Define a contextual binding.

Parameters

  • $concrete string|array
public

factory ( $abstract ) : Closure

Get a closure to resolve the given type from the container.

Parameters

  • $abstract string
public

flush ( ) : void

Flush the container of all bindings and resolved instances.

public

make ( $abstract , array $parameters ) : mixed

Resolve the given type from the container.

Parameters

  • $abstract string
  • $parameters array
public

call ( $callback , array $parameters , $defaultMethod ) : mixed

Call the given Closure / class@method and inject its dependencies.

Parameters

  • $callback callable|string
  • $parameters array
  • $defaultMethod string|null
public

resolved ( $abstract ) : bool

Determine if the given abstract type has been resolved.

Parameters

  • $abstract string
public

beforeResolving ( $abstract , Closure $callback ) : void

Register a new before resolving callback.

Parameters

public

resolving ( $abstract , Closure $callback ) : void

Register a new resolving callback.

Parameters

public

afterResolving ( $abstract , Closure $callback ) : void

Register a new after resolving callback.

Parameters