# DependentInterface

Chevere\Interfaces\Dependent\DependentInterface

view source

# 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

  1. object ...$namedDependency

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: 1/16/2021, 9:23:54 PM