Skip to content
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version: ['8.1', '8.2', '8.3']
php-version: ['8.2', '8.3']
Comment thread
brettmc marked this conversation as resolved.
Outdated
experimental: [false]
composer_args: [""]
include:
Expand Down Expand Up @@ -171,5 +171,5 @@ jobs:
needs: php
with:
matrix_extension: '["ast, json, grpc"]'
matrix_php_version: '["8.1", "8.2", "8.3"]'
matrix_php_version: '["8.2", "8.3", "8.4", "8.5"]'
install_directory: '~/.test/.packages'
2 changes: 1 addition & 1 deletion .github/workflows/publish-otel-php-base-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
name: OpenTelemetry PHP base docker image creation
strategy:
matrix:
php-version: ['8.1', '8.2', '8.3', '8.4']
php-version: ['8.2', '8.3', '8.4', '8.5']
runs-on: ubuntu-latest
permissions:
packages: write
Expand Down
2 changes: 1 addition & 1 deletion .phan/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
//
// Note that the **only** effect of choosing `'5.6'` is to infer that functions removed in php 7.0 exist.
// (See `backward_compatibility_checks` for additional options)
'target_php_version' => '8.1',
'target_php_version' => '8.2',

// If enabled, missing properties will be created when
// they are first seen. If false, we'll report an
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"readme": "./README.md",
"license": "Apache-2.0",
"require": {
"php": "^8.1",
"php": "^8.2",
"google/protobuf": "^3.22 || ^4.0",
"nyholm/psr7-server": "^1.1",
"php-http/discovery": "^1.14",
Expand All @@ -19,9 +19,9 @@
"ramsey/uuid": "^3.0 || ^4.0",
"symfony/config": "^5.4 || ^6.4 || ^7.0 || ^8.0",
"symfony/polyfill-mbstring": "^1.23",
"symfony/polyfill-php82": "^1.26",
"symfony/polyfill-php83": "^1.32",
"symfony/polyfill-php84": "^1.32",
"symfony/polyfill-php85": "^1.32",
"tbachert/spi": "^1.0.1"
},
"config": {
Expand Down
51 changes: 29 additions & 22 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,35 @@ RUN apt-get update && apt-get install -y lsb-release apt-transport-https ca-cert

ARG PHP_VERSION=8.3

RUN apt-get install -y \
php${PHP_VERSION}-ast \
php${PHP_VERSION}-cli \
php${PHP_VERSION}-curl \
php${PHP_VERSION}-dev \
php${PHP_VERSION}-grpc \
php${PHP_VERSION}-intl \
php${PHP_VERSION}-mbstring \
php${PHP_VERSION}-opcache \
php${PHP_VERSION}-opentelemetry \
php${PHP_VERSION}-protobuf \
php${PHP_VERSION}-simplexml \
php${PHP_VERSION}-sockets \
php${PHP_VERSION}-xdebug \
php${PHP_VERSION}-zip \
php${PHP_VERSION}-mongodb \
php${PHP_VERSION}-amqp \
php${PHP_VERSION}-rdkafka \
php${PHP_VERSION}-mysqli \
php${PHP_VERSION}-pgsql \
php${PHP_VERSION}-sqlite3 \
unzip
RUN set -eux; \
major=${PHP_VERSION%%.*}; minor=${PHP_VERSION#*.}; \
if [ "$major" -gt 8 ] || { [ "$major" -eq 8 ] && [ "$minor" -ge 5 ]; }; then \
OPCACHE_PKG=""; \
else \
OPCACHE_PKG="php${PHP_VERSION}-opcache"; \
fi; \
apt-get install -y \
php${PHP_VERSION}-ast \
php${PHP_VERSION}-cli \
php${PHP_VERSION}-curl \
php${PHP_VERSION}-dev \
php${PHP_VERSION}-grpc \
php${PHP_VERSION}-intl \
php${PHP_VERSION}-mbstring \
${OPCACHE_PKG} \
php${PHP_VERSION}-opentelemetry \
php${PHP_VERSION}-protobuf \
php${PHP_VERSION}-simplexml \
php${PHP_VERSION}-sockets \
php${PHP_VERSION}-xdebug \
php${PHP_VERSION}-zip \
php${PHP_VERSION}-mongodb \
php${PHP_VERSION}-amqp \
php${PHP_VERSION}-rdkafka \
php${PHP_VERSION}-mysqli \
php${PHP_VERSION}-pgsql \
php${PHP_VERSION}-sqlite3 \
unzip

COPY --from=composer /usr/bin/composer /usr/local/bin/composer

Expand Down
9 changes: 1 addition & 8 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,13 @@
]);

$rectorConfig->sets([
SetList::PHP_81,
SetList::PHP_82,
SetList::CODE_QUALITY,
PHPUnitSetList::PHPUNIT_100,
]);
$rectorConfig->rule(AddOverrideAttributeToOverriddenMethodsRector::class);
$rectorConfig->skip([
FlipTypeControlToUseExclusiveTypeRector::class,
NewInInitializerRector::class => [
__DIR__ . '/src/SDK/Trace/Sampler/ParentBased.php',
],
ReadOnlyPropertyRector::class => [
__DIR__ . '/src/SDK/Metrics/Stream/SynchronousMetricStream.php',
__DIR__ . '/tests/Unit/Extension/Propagator',
],
DisallowedEmptyRuleFixerRector::class,
ExplicitBoolCompareRector::class,
LocallyCalledStaticMethodToNonStaticRector::class,
Expand Down
6 changes: 3 additions & 3 deletions src/API/Baggage/Entry.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

namespace OpenTelemetry\API\Baggage;

final class Entry
final readonly class Entry
{
public function __construct(
private readonly mixed $value,
private readonly MetadataInterface $metadata,
private mixed $value,
private MetadataInterface $metadata,
) {
}

Expand Down
4 changes: 2 additions & 2 deletions src/API/Baggage/Propagation/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
use function trim;
use function urldecode;

final class Parser
final readonly class Parser
{
private const EXCLUDED_KEY_CHARS = [' ', '(', ')', '<', '>', '@', ',', ';', ':', '\\', '"', '/', '[', ']', '?', '=', '{', '}'];
private const EXCLUDED_VALUE_CHARS = [' ', '"', ',', ';', '\\'];
private const EQUALS = '=';

public function __construct(
private readonly string $baggageHeader,
private string $baggageHeader,
) {
}

Expand Down
12 changes: 6 additions & 6 deletions src/API/Instrumentation/AutoInstrumentation/Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
/**
* Context used for component creation.
*/
final class Context
final readonly class Context
{
public function __construct(
public readonly TracerProviderInterface $tracerProvider = new NoopTracerProvider(),
public readonly MeterProviderInterface $meterProvider = new NoopMeterProvider(),
public readonly LoggerProviderInterface $loggerProvider = new NoopLoggerProvider(),
public readonly TextMapPropagatorInterface $propagator = new NoopTextMapPropagator(),
public readonly ResponsePropagatorInterface $responsePropagator = new NoopResponsePropagator(),
public TracerProviderInterface $tracerProvider = new NoopTracerProvider(),
public MeterProviderInterface $meterProvider = new NoopMeterProvider(),
public LoggerProviderInterface $loggerProvider = new NoopLoggerProvider(),
public TextMapPropagatorInterface $propagator = new NoopTextMapPropagator(),
public ResponsePropagatorInterface $responsePropagator = new NoopResponsePropagator(),
) {
}
}
4 changes: 2 additions & 2 deletions src/API/Instrumentation/SpanAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
* add the argument as a span attribute.
*/
#[Attribute(Attribute::TARGET_PARAMETER | Attribute::TARGET_PROPERTY)]
final class SpanAttribute
final readonly class SpanAttribute
{
/**
* @param string|null $name Optional name to use for the attribute. Default: argument name.
*/
public function __construct(
public readonly ?string $name = null,
public ?string $name = null,
) {
}
}
8 changes: 4 additions & 4 deletions src/API/Instrumentation/WithSpan.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
* by the OpenTelemetry extension.
*/
#[Attribute(Attribute::TARGET_FUNCTION|Attribute::TARGET_METHOD)]
final class WithSpan
final readonly class WithSpan
{
/**
* @param string|null $span_name Optional span name. Default: function name or class::method
* @param int|null $span_kind Optional {@link SpanKind}. Default: {@link SpanKind::KIND_INTERNAL}
* @param array $attributes Optional attributes to be added to the span.
*/
public function __construct(
public readonly ?string $span_name = null,
public readonly ?int $span_kind = null,
public readonly array $attributes = [],
public ?string $span_name = null,
public ?int $span_kind = null,
public array $attributes = [],
) {
}
}
10 changes: 5 additions & 5 deletions src/API/Trace/SpanSuppression/SemanticConvention.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
/**
* @experimental
*/
final class SemanticConvention
final readonly class SemanticConvention
{
/**
* @param list<string> $samplingAttributes
*/
public function __construct(
public readonly string $name,
public readonly int $spanKind,
public readonly array $samplingAttributes,
public readonly array $attributes,
public string $name,
public int $spanKind,
public array $samplingAttributes,
public array $attributes,
) {
}
}
2 changes: 1 addition & 1 deletion src/API/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
}
],
"require": {
"php": "^8.1",
"php": "^8.2",
"open-telemetry/context": "^1.4",
"psr/log": "^1.1|^2.0|^3.0",
"symfony/polyfill-php82": "^1.26"
Expand Down
4 changes: 2 additions & 2 deletions src/Config/SDK/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
use OpenTelemetry\SDK\SdkBuilder;
use WeakMap;

final class Configuration
final readonly class Configuration
{
/**
* @param ComponentPlugin<SdkBuilder> $sdkPlugin
*/
private function __construct(
private readonly ComponentPlugin $sdkPlugin,
private ComponentPlugin $sdkPlugin,
) {
}

Expand Down
10 changes: 5 additions & 5 deletions src/Config/SDK/Configuration/ConfigurationFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,19 @@
/**
* @template T
*/
final class ConfigurationFactory
final readonly class ConfigurationFactory
{
private readonly CompiledConfigurationFactory $compiledFactory;
private CompiledConfigurationFactory $compiledFactory;

/**
* @param iterable<ComponentProvider> $componentProviders
* @param ComponentProvider<T> $rootComponent
* @param EnvReader $envReader
*/
public function __construct(
private readonly iterable $componentProviders,
private readonly ComponentProvider $rootComponent,
private readonly EnvReader $envReader,
private iterable $componentProviders,
private ComponentProvider $rootComponent,
private EnvReader $envReader,
) {
$this->compiledFactory = $this->compileFactory();
}
Expand Down
4 changes: 2 additions & 2 deletions src/Config/SDK/Configuration/Environment/ArrayEnvSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

namespace OpenTelemetry\Config\SDK\Configuration\Environment;

final class ArrayEnvSource implements EnvSource
final readonly class ArrayEnvSource implements EnvSource
{
public function __construct(
private readonly array $env,
private array $env,
) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
use Symfony\Component\Config\Resource\ResourceInterface;
use Symfony\Component\Config\ResourceCheckerInterface;

final class EnvResourceChecker implements ResourceCheckerInterface
final readonly class EnvResourceChecker implements ResourceCheckerInterface
{
public function __construct(
private readonly EnvReader $envReader,
private EnvReader $envReader,
) {
}

Expand Down
4 changes: 2 additions & 2 deletions src/Config/SDK/Configuration/Environment/EnvSourceReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
use function is_string;
use function trim;

final class EnvSourceReader implements EnvReader
final readonly class EnvSourceReader implements EnvReader
{
/**
* @param iterable<EnvSource> $envSources
*/
public function __construct(
private readonly iterable $envSources,
private iterable $envSources,
) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@
*
* @internal
*/
final class CompiledConfigurationFactory
final readonly class CompiledConfigurationFactory
{
/**
* @param ComponentProvider<T> $rootComponent
* @param NodeInterface $node
* @param iterable<ResourceTrackable> $resourceTrackable
*/
public function __construct(
private readonly ComponentProvider $rootComponent,
private readonly NodeInterface $node,
private readonly iterable $resourceTrackable,
private ComponentProvider $rootComponent,
private NodeInterface $node,
private iterable $resourceTrackable,
) {
}

Expand Down
6 changes: 3 additions & 3 deletions src/Config/SDK/Configuration/Internal/ComponentPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
*
* @internal
*/
final class ComponentPlugin implements \OpenTelemetry\API\Configuration\Config\ComponentPlugin
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 readonly array $properties,
private readonly ComponentProvider $provider,
private array $properties,
private ComponentProvider $provider,
) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
/**
* @internal
*/
final class ComposerPackageResource implements SelfCheckingResourceInterface
final readonly class ComposerPackageResource implements SelfCheckingResourceInterface
{
public readonly string $packageName;
public readonly string|false $version;
public string $packageName;
public string|false $version;

public function __construct(string $packageName)
{
Expand Down
Loading
Loading