function Configurator::with
Parameters
Closure(T, InstrumentationScopeInterface): void $closure:
File
-
vendor/
open-telemetry/ sdk/ Common/ InstrumentationScope/ Configurator.php, line 39
Class
- Configurator
- @template T
Namespace
OpenTelemetry\SDK\Common\InstrumentationScopeCode
public function with(Closure $closure, ?string $name, ?string $version = null, ?string $schemaUrl = null) : self {
$this->configurators[] = $configurator = new ConfiguratorClosure($closure, self::namePattern($name), $version, $schemaUrl);
foreach ($this->configs as $instrumentationScope => $config) {
if ($configurator->matches($instrumentationScope)) {
($configurator->closure)($config, $instrumentationScope);
}
}
return $this;
}