diff --git a/.gitignore b/.gitignore index 4e44c24..41d7bab 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ Thumbs.db # Other .phpunit.result.cache +.phpunit.cache/ .php_cs.cache clover.xml .env diff --git a/composer.json b/composer.json index 7a938d4..5ab13d1 100644 --- a/composer.json +++ b/composer.json @@ -54,7 +54,7 @@ }, "require-dev": { "jetbrains/phpstorm-attributes": "^1.0", - "phpunit/phpunit": "^9.5.28", + "phpunit/phpunit": "^10.0", "vimeo/psalm": ">=5.8" }, "autoload-dev": { diff --git a/phpunit.xml b/phpunit.xml index 429c170..6ad1b8d 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,23 +1,13 @@ + xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd" backupGlobals="false" colors="true" + processIsolation="false" stopOnFailure="false" stopOnError="false" cacheDirectory=".phpunit.cache" + backupStaticProperties="false"> tests/Unit - src diff --git a/src/Collector.php b/src/Collector.php index 5bd228e..676bfd1 100644 --- a/src/Collector.php +++ b/src/Collector.php @@ -10,18 +10,11 @@ */ final class Collector implements CollectorInterface, JsonSerializable { - /** @var string */ private string $namespace = ''; - - /** @var string */ private string $subsystem = ''; - - /** @var string */ private string $help = ''; - /** @var non-empty-string[] */ private array $labels = []; - /** @var float[] */ private array $buckets = []; @@ -89,9 +82,6 @@ public function jsonSerialize(): array /** * New histogram metric. - * - * @param float ...$bucket - * @return static */ public static function histogram(float ...$bucket): self { @@ -104,8 +94,6 @@ public static function histogram(float ...$bucket): self /** * New gauge metric. - * - * @return static */ public static function gauge(): self { @@ -114,8 +102,6 @@ public static function gauge(): self /** * New counter metric. - * - * @return static */ public static function counter(): self { diff --git a/src/CollectorInterface.php b/src/CollectorInterface.php index 706d528..ddffc6f 100644 --- a/src/CollectorInterface.php +++ b/src/CollectorInterface.php @@ -20,28 +20,24 @@ interface CollectorInterface { /** * @param non-empty-string $namespace - * @return self */ #[Pure] public function withNamespace(string $namespace): self; /** * @param non-empty-string $subsystem - * @return self */ #[Pure] public function withSubsystem(string $subsystem): self; /** * @param non-empty-string $help - * @return self */ #[Pure] public function withHelp(string $help): self; /** * @param non-empty-string ...$label - * @return self */ #[Pure] public function withLabels(string ...$label): self; diff --git a/src/MetricsInterface.php b/src/MetricsInterface.php index ae6ca4c..2c8dc69 100644 --- a/src/MetricsInterface.php +++ b/src/MetricsInterface.php @@ -12,9 +12,7 @@ interface MetricsInterface * Add collector value. Fallback to appropriate method of related collector. * * @param non-empty-string $name - * @param float $value * @param non-empty-string[] $labels - * * @throws MetricsException */ public function add(string $name, float $value, array $labels = []): void; @@ -23,9 +21,7 @@ public function add(string $name, float $value, array $labels = []): void; * Subtract the collector value, only for gauge collector. * * @param non-empty-string $name - * @param float $value * @param non-empty-string[] $labels - * * @throws MetricsException */ public function sub(string $name, float $value, array $labels = []): void; @@ -34,9 +30,7 @@ public function sub(string $name, float $value, array $labels = []): void; * Observe collector value, only for histogram and summary collectors. * * @param non-empty-string $name - * @param float $value * @param non-empty-string[] $labels - * * @throws MetricsException */ public function observe(string $name, float $value, array $labels = []): void; @@ -45,9 +39,7 @@ public function observe(string $name, float $value, array $labels = []): void; * Set collector value, only for gauge collector. * * @param non-empty-string $name - * @param float $value * @param non-empty-string[] $labels - * * @throws MetricsException */ public function set(string $name, float $value, array $labels = []): void; @@ -56,7 +48,6 @@ public function set(string $name, float $value, array $labels = []): void; * Declares named collector. * * @param non-empty-string $name Collector name. - * @param CollectorInterface $collector * * @throws MetricsException */