Service Class

Aurora\Container Namespace


Properties

class

Service class

protected $class = '': string

arguments

Arguments array

protected $arguments = []: array

methods

Methods array

protected $methods = []: array

locked

Locked flag

protected $locked = : bool

shared

Shared flag

protected $shared = : bool

Constructor

__construct

Constructor

Parameters

  • string $class — Class name

Signature

public function __construct(string $class)

Methods

__construct

Constructor

Parameters

  • string $class — Class name

Signature

public function __construct(string $class)

lock

Lock the service definition

Return Value

  • $this

Signature

public function lock()

unlock

Unlock the service definition

Return Value

  • $this

Signature

public function unlock()

shared

Set the service definition as shared

Return Value

  • $this

Signature

public function shared()

argument

Add an argument to the service constructor

Parameters

  • mixed $value — Argument value or array with arguments

Return Value

  • $this

Signature

public function argument(mixed $value)

method

Add service initialization method call

Parameters

  • string $name — Method name
  • mixed $arguments — Method arguments

Signature

public function method(string $name, mixed $arguments = [])

getClass

Retrieve the service class

Return Value

  • string

Signature

public function getClass(): string

getArguments

Get the service constructor arguments

Return Value

  • array

Signature

public function getArguments(): array

getMethods

Get the service initialization method calls

Return Value

  • array

Signature

public function getMethods(): array

isLocked

Check locked flag

Return Value

  • bool

Signature

public function isLocked(): bool

isShared

Check shared flag

Return Value

  • bool

Signature

public function isShared(): bool

Go to top