-
Notifications
You must be signed in to change notification settings - Fork 223
Expand file tree
/
Copy pathComponentPlugin.php
More file actions
33 lines (28 loc) · 906 Bytes
/
ComponentPlugin.php
File metadata and controls
33 lines (28 loc) · 906 Bytes
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
<?php
declare(strict_types=1);
namespace OpenTelemetry\Config\SDK\Configuration\Internal;
use OpenTelemetry\API\Configuration\Config\ComponentProvider;
use OpenTelemetry\API\Configuration\Context;
/**
* @template T
* @implements \OpenTelemetry\API\Configuration\Config\ComponentPlugin<T>
*
* @internal
*/
final readonly class ComponentPlugin implements \OpenTelemetry\API\Configuration\Config\ComponentPlugin
{
/**
* @param array $properties resolved properties according to component provider config
* @param ComponentProvider<T> $provider component provider used to create the component
*/
public function __construct(
private array $properties,
private ComponentProvider $provider,
) {
}
#[\Override]
public function create(Context $context): mixed
{
return $this->provider->createPlugin($this->properties, $context);
}
}