# DependentInterface

Chevere\Interfaces\Dependent\DependentInterface

view source (opens new window)

# Description

Describes the component in charge of defining a class with explicit dependencies.

# Methods

# withDependencies

Dependencies must be passed on construct for this interface.

Parameters

  • ...namedDependency: object

Return

void

Each named argument value will be assigned to a property of the same name.

class Dependent Implements DependentInterface
{
     private FooType $foo;
     private BarType $bar;
     // ...
}

new Dependent(foo: $fooInstance, bar: $barInstance);

# getDependencies

Declares required dependencies as class name -> property name.


# assertDependencies

Asserts that the instance meets all dependencies.

Return

void


# dependencies

Provides access to the dependencies instance.


Last Updated: 5/1/2021, 2:31:10 PM