trait InteractsWithContainer (View source)

Methods

object
swap(string $abstract, object $instance)

Register an instance of an object in the container.

object
instance(string $abstract, object $instance)

Register an instance of an object in the container.

object
mock(string $abstract, Closure $mock = null)

Mock an instance of an object in the container.

object
spy(string $abstract, Closure $mock = null)

Spy an instance of an object in the container.

Details

protected object swap(string $abstract, object $instance)

Register an instance of an object in the container.

Parameters

string $abstract
object $instance

Return Value

object

protected object instance(string $abstract, object $instance)

Register an instance of an object in the container.

Parameters

string $abstract
object $instance

Return Value

object

protected object mock(string $abstract, Closure $mock = null)

Mock an instance of an object in the container.

Parameters

string $abstract
Closure $mock

Return Value

object

protected object spy(string $abstract, Closure $mock = null)

Spy an instance of an object in the container.

Parameters

string $abstract
Closure $mock

Return Value

object