websign-dev/sillbeam-core · v0.3.0

ProjectContextInterface

\Sillbeam\Core\Project · interface

Type information

\Sillbeam\Core\Project\ProjectContextInterface

Resolves Project membership from the current request on each call.

No Projects or no current request means no current Project. An unassigned host with Projects configured is an error, rather than an absent context.

Methods (4)

current()

\Sillbeam\Core\Project\ProjectContextInterface::current()

Returns the current request's Project, or null without Projects or a current request.

public function current(): ?ProjectDefinition;

hasModule()

\Sillbeam\Core\Project\ProjectContextInterface::hasModule()

Tests descriptor-class membership in the current Project graph.

Falls back to the application graph when there is no current Project; unknown module classes return false. No source files are scanned.

public function hasModule(string $module): bool;

id()

\Sillbeam\Core\Project\ProjectContextInterface::id()

Returns the current Project ID, or null when there is no current Project.

public function id(): ?string;

is()

\Sillbeam\Core\Project\ProjectContextInterface::is()

Tests the exact current Project ID; false when there is no current Project.

public function is(string $id): bool;