Skip to content

Commit

Permalink
Merge pull request #5 from roadrunner-php/feature/phpunit-10
Browse files Browse the repository at this point in the history
Updates phpunit up to 10.x
  • Loading branch information
butschster authored Apr 12, 2023
2 parents 436463e + b72a16e commit 09abd24
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 41 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Thumbs.db

# Other
.phpunit.result.cache
.phpunit.cache/
.php_cs.cache
clover.xml
.env
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
16 changes: 3 additions & 13 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,23 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
verbose="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
stopOnError="false"
>
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">
<testsuites>
<testsuite name="Jobs Tests">
<directory>tests/Unit</directory>
</testsuite>
</testsuites>

<coverage>
<include>
<directory>src</directory>
Expand Down
14 changes: 0 additions & 14 deletions src/Collector.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];

Expand Down Expand Up @@ -89,9 +82,6 @@ public function jsonSerialize(): array

/**
* New histogram metric.
*
* @param float ...$bucket
* @return static
*/
public static function histogram(float ...$bucket): self
{
Expand All @@ -104,8 +94,6 @@ public static function histogram(float ...$bucket): self

/**
* New gauge metric.
*
* @return static
*/
public static function gauge(): self
{
Expand All @@ -114,8 +102,6 @@ public static function gauge(): self

/**
* New counter metric.
*
* @return static
*/
public static function counter(): self
{
Expand Down
4 changes: 0 additions & 4 deletions src/CollectorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
9 changes: 0 additions & 9 deletions src/MetricsInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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
*/
Expand Down

0 comments on commit 09abd24

Please sign in to comment.