class SourceResolver implements SourceResolverInterface

Properties

protected array $sources

All of the registered sources.

protected string $default

The default source name.

Methods

__construct(array $sources = [])

Create a new source resolver instance.

source(string $name = null)

Get a source instance.

void
addSource(string $name, SourceInterface $source)

Add a source to the resolver.

bool
hasSource(string $name)

Check if a source has been registered.

string
getDefaultSourceName()

Get the default source name.

void
setDefaultSourceName(string $name)

Set the default source name.

Details

at line 26
__construct(array $sources = [])

Create a new source resolver instance.

Parameters

array $sources

at line 40
SourceInterface source(string $name = null)

Get a source instance.

Parameters

string $name

Return Value

SourceInterface

at line 57
void addSource(string $name, SourceInterface $source)

Add a source to the resolver.

Parameters

string $name
SourceInterface $source

Return Value

void

at line 69
bool hasSource(string $name)

Check if a source has been registered.

Parameters

string $name

Return Value

bool

at line 78
string getDefaultSourceName()

Get the default source name.

Return Value

string

at line 90
void setDefaultSourceName(string $name)

Set the default source name.

Parameters

string $name

Return Value

void