-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContainer.php
More file actions
60 lines (53 loc) · 2.5 KB
/
Copy pathContainer.php
File metadata and controls
60 lines (53 loc) · 2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php declare(strict_types=1);
namespace StellarWP\Foundation\ContainerWordPress\Contracts;
use StellarWP\Foundation\Container\Contracts\Container as FoundationContainer;
use StellarWP\Foundation\Container\Contracts\Providable;
/**
* WordPress-aware container contract.
*
* Extends the Foundation container contract so a WordPress project keeps the full
* base container API and gains WordPress-specific helpers.
*/
interface Container extends FoundationContainer
{
/**
* @param class-string|string $class
*
* @return $this
*/
public function when(string $class): Container;
/**
* @param class-string|string $id
*
* @return $this
*/
public function needs(string $id): Container;
/**
* @param string $action The WordPress action the $serviceProviderClass should be registered on.
* @param class-string<Providable> $serviceProviderClass The Service Provider to register on $action.
* @param string $alias Alias(es) for the $serviceProviderClass.
*
* @throws \lucatume\DI52\ContainerException
*/
public function registerOnAction(string $action, string $serviceProviderClass, ...$alias): void;
/**
* @param class-string<Providable>|string $baseProviderClass The provider class or id that the $dependentProviderClass
* depends on.
* @param class-string<Providable> $dependentProviderClass The Service Provider to register after
* $baseProviderClass has been registered.
* @param string ...$alias Alias(es) for the $dependentProviderClass.
*
* @throws \lucatume\DI52\ContainerException
*/
public function registerOnProvider(string $baseProviderClass, string $dependentProviderClass, ...$alias): void;
/**
* @param list<string> $actions A list of actions that all need to be fired for the Provider to be
* registered.
* @param class-string<Providable> $serviceProviderClass The Service Provider to register when the last action from $actions
* is fired.
* @param string ...$alias Alias(es) for the $serviceProviderClass.
*
* @throws \lucatume\DI52\ContainerException
*/
public function registerAfterAllActions(array $actions, string $serviceProviderClass, ...$alias): void;
}