PHP Class Illuminate\Support\Facades\Facade

Exibir arquivo Open project: illuminate/support Class Usage Examples

Protected Properties

Property Type Description
$app Illuminate\Contracts\Foundation\Application The application instance being facaded.
$resolvedInstance array The resolved object instances.

Public Methods

Method Description
__callStatic ( string $method, array $args ) : mixed Handle dynamic, static calls to the object.
clearResolvedInstance ( string $name ) : void Clear a resolved facade instance.
clearResolvedInstances ( ) : void Clear all of the resolved instances.
getFacadeApplication ( ) : Illuminate\Contracts\Foundation\Application Get the application instance behind the facade.
getFacadeRoot ( ) : mixed Get the root object behind the facade.
setFacadeApplication ( Illuminate\Contracts\Foundation\Application $app ) : void Set the application instance.
shouldReceive ( ) : Expectation Initiate a mock expectation on the facade.
spy ( ) : void Convert the facade into a Mockery spy.
swap ( mixed $instance ) : void Hotswap the underlying instance behind the facade.

Protected Methods

Method Description
createFreshMockInstance ( string $name ) : Expectation Create a fresh mock instance for the given class.
createMockByName ( string $name ) : Mockery\MockInterface Create a fresh mock instance for the given class.
getFacadeAccessor ( ) : string Get the registered name of the component.
getMockableClass ( ) : string | null Get the mockable class for the bound instance.
isMock ( ) : boolean Determines whether a mock is set as the instance of the facade.
resolveFacadeInstance ( string | object $name ) : mixed Resolve the facade root instance from the container.

Method Details

__callStatic() public static method

Handle dynamic, static calls to the object.
public static __callStatic ( string $method, array $args ) : mixed
$method string
$args array
return mixed

clearResolvedInstance() public static method

Clear a resolved facade instance.
public static clearResolvedInstance ( string $name ) : void
$name string
return void

clearResolvedInstances() public static method

Clear all of the resolved instances.
public static clearResolvedInstances ( ) : void
return void

createFreshMockInstance() protected static method

Create a fresh mock instance for the given class.
protected static createFreshMockInstance ( string $name ) : Expectation
$name string
return Mockery\Expectation

createMockByName() protected static method

Create a fresh mock instance for the given class.
protected static createMockByName ( string $name ) : Mockery\MockInterface
$name string
return Mockery\MockInterface

getFacadeAccessor() protected static method

Get the registered name of the component.
protected static getFacadeAccessor ( ) : string
return string

getFacadeApplication() public static method

Get the application instance behind the facade.
public static getFacadeApplication ( ) : Illuminate\Contracts\Foundation\Application
return Illuminate\Contracts\Foundation\Application

getFacadeRoot() public static method

Get the root object behind the facade.
public static getFacadeRoot ( ) : mixed
return mixed

getMockableClass() protected static method

Get the mockable class for the bound instance.
protected static getMockableClass ( ) : string | null
return string | null

isMock() protected static method

Determines whether a mock is set as the instance of the facade.
protected static isMock ( ) : boolean
return boolean

resolveFacadeInstance() protected static method

Resolve the facade root instance from the container.
protected static resolveFacadeInstance ( string | object $name ) : mixed
$name string | object
return mixed

setFacadeApplication() public static method

Set the application instance.
public static setFacadeApplication ( Illuminate\Contracts\Foundation\Application $app ) : void
$app Illuminate\Contracts\Foundation\Application
return void

shouldReceive() public static method

Initiate a mock expectation on the facade.
public static shouldReceive ( ) : Expectation
return Mockery\Expectation

spy() public static method

Convert the facade into a Mockery spy.
public static spy ( ) : void
return void

swap() public static method

Hotswap the underlying instance behind the facade.
public static swap ( mixed $instance ) : void
$instance mixed
return void

Property Details

$app protected_oe static_oe property

The application instance being facaded.
protected static Application,Illuminate\Contracts\Foundation $app
return Illuminate\Contracts\Foundation\Application

$resolvedInstance protected_oe static_oe property

The resolved object instances.
protected static array $resolvedInstance
return array