W3cubDocs

/Symfony 4.1

ServiceReferenceGraph

class ServiceReferenceGraph

This is a directed graph of your services.

This information can be used by your compiler passes instead of collecting it themselves which improves performance quite a lot.

Methods

bool hasNode(string $id)
ServiceReferenceGraphNode getNode(string $id)

Gets a node by identifier.

array getNodes()

Returns all nodes.

clear()

Clears all nodes.

connect(string|null $sourceId, $sourceValue, string|null $destId, $destValue = null, $reference = null, bool $lazy = false, bool $weak = false)

Connects 2 nodes together in the Graph.

Details

bool hasNode(string $id)

Parameters

string $id

Return Value

bool

ServiceReferenceGraphNode getNode(string $id)

Gets a node by identifier.

Parameters

string $id

Return Value

ServiceReferenceGraphNode

Exceptions

InvalidArgumentException if no node matches the supplied identifier

array getNodes()

Returns all nodes.

Return Value

array

clear()

Clears all nodes.

connect(string|null $sourceId, $sourceValue, string|null $destId, $destValue = null, $reference = null, bool $lazy = false, bool $weak = false)

Connects 2 nodes together in the Graph.

Parameters

string|null $sourceId
$sourceValue
string|null $destId
$destValue
$reference
bool $lazy
bool $weak