1: <?php declare(strict_types = 1);
2:
3: namespace PHPStan\DependencyInjection;
4:
5: /**
6: * @api
7: * @api-do-not-implement
8: */
9: interface Container
10: {
11:
12: public function hasService(string $serviceName): bool;
13:
14: /**
15: * @return mixed
16: * @throws MissingServiceException
17: */
18: public function getService(string $serviceName);
19:
20: /**
21: * @template T of object
22: * @param class-string<T> $className
23: * @return T
24: * @throws MissingServiceException
25: */
26: public function getByType(string $className);
27:
28: /**
29: * @param class-string $className
30: * @return string[]
31: */
32: public function findServiceNamesByType(string $className): array;
33:
34: /**
35: * Returns a lazy collection of all registered extensions implementing the given extension interface.
36: *
37: * The interface must be marked with the #[ExtensionInterface] attribute.
38: *
39: * @template T of object
40: * @param class-string<T> $extensionInterfaceName
41: * @return ExtensionsCollection<T>
42: * @throws MissingServiceException
43: */
44: public function getExtensionsCollection(string $extensionInterfaceName): ExtensionsCollection;
45:
46: /**
47: * @return mixed[]
48: */
49: public function getServicesByTag(string $tagName): array;
50:
51: /**
52: * @return mixed[]
53: */
54: public function getParameters(): array;
55:
56: public function hasParameter(string $parameterName): bool;
57:
58: /**
59: * @return mixed
60: * @throws ParameterNotFoundException
61: */
62: public function getParameter(string $parameterName);
63:
64: }
65: