Skip to content

Commit

Permalink
chore: fix composer.json script section; fix CS
Browse files Browse the repository at this point in the history
  • Loading branch information
roxblnfk committed May 27, 2024
1 parent 7262bde commit 8c20628
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 25 deletions.
45 changes: 30 additions & 15 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,20 +108,35 @@
"sort-packages": true
},
"scripts": {
"cs:diff": "php vendor/bin/php-cs-fixer fix --dry-run -v --diff",
"cs:fix": "php vendor/bin/php-cs-fixer fix -v",
"infect": "XDEBUG_MODE=coverage php vendor/bin/roave-infection-static-analysis-plugin --configuration=infection.json.dist",
"infect:ci": "XDEBUG_MODE=coverage php vendor/bin/roave-infection-static-analysis-plugin --ansi --configuration=infection.json.dist --logger-github --ignore-msi-with-no-mutations --only-covered",
"psalm": "php vendor/bin/psalm --show-info=true",
"psalm:baseline": "php vendor/bin/psalm --set-baseline=psalm-baseline.xml",
"psalm:ci": "php vendor/bin/psalm --output-format=github --shepherd --show-info=false --stats --threads=4",
"refactor": "php vendor/bin/rector process --config=rector.php",
"refactor:ci": "php vendor/bin/rector process --config=rector.php --dry-run --ansi",
"stan": "php vendor/bin/phpstan analyse --memory-limit=2G",
"stan:baseline": "php vendor/bin/phpstan analyse --generate-baseline --memory-limit=2G --allow-empty-baseline",
"stan:ci": "php vendor/bin/phpstan analyse --memory-limit=2G --error-format=github",
"test": "XDEBUG_MODE=coverage php vendor/bin/pest --exclude-group=phpunit-only --color=always",
"test:cc": "XDEBUG_MODE=coverage php vendor/bin/pest --coverage --coverage-clover=.build/phpunit/logs/clover.xml --exclude-group=phpunit-only --color=always",
"test:sep": "XDEBUG_MODE=coverage php vendor/bin/phpunit --group=phpunit-only --color=always --exclude-testsuite=Arch"
"cs:diff": "php-cs-fixer fix --dry-run -v --diff",
"cs:fix": "php-cs-fixer fix -v",
"infect": [
"@putenv XDEBUG_MODE=coverage",
"roave-infection-static-analysis-plugin --configuration=infection.json.dist"
],
"infect:ci": [
"@putenv XDEBUG_MODE=coverage",
"roave-infection-static-analysis-plugin --ansi --configuration=infection.json.dist --logger-github --ignore-msi-with-no-mutations --only-covered"
],
"psalm": "psalm --show-info=true",
"psalm:baseline": "psalm --set-baseline=psalm-baseline.xml",
"psalm:ci": "psalm --output-format=github --shepherd --show-info=false --stats --threads=4",
"refactor": "rector process --config=rector.php",
"refactor:ci": "rector process --config=rector.php --dry-run --ansi",
"stan": "phpstan analyse --memory-limit=2G",
"stan:baseline": "phpstan analyse --generate-baseline --memory-limit=2G --allow-empty-baseline",
"stan:ci": "phpstan analyse --memory-limit=2G --error-format=github",
"test": [
"@putenv XDEBUG_MODE=coverage",
"pest --exclude-group=phpunit-only --color=always"
],
"test:cc": [
"@putenv XDEBUG_MODE=coverage",
"pest --coverage --coverage-clover=.build/phpunit/logs/clover.xml --exclude-group=phpunit-only --color=always"
],
"test:sep": [
"@putenv XDEBUG_MODE=coverage",
"phpunit --group=phpunit-only --color=always --exclude-testsuite=Arch"
]
}
}
3 changes: 1 addition & 2 deletions src/Support/Caster/Trace.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ public function __construct(
public readonly float $delta,
public readonly int $memory,
public readonly array $stack,
) {
}
) {}

Check warning on line 33 in src/Support/Caster/Trace.php

View check run for this annotation

Codecov / codecov/patch

src/Support/Caster/Trace.php#L33

Added line #L33 was not covered by tests

public function __toString(): string

Check warning on line 35 in src/Support/Caster/Trace.php

View check run for this annotation

Codecov / codecov/patch

src/Support/Caster/Trace.php#L35

Added line #L35 was not covered by tests
{
Expand Down
3 changes: 1 addition & 2 deletions src/Support/Caster/TraceFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ final class TraceFile
*/
public function __construct(

Check warning on line 22 in src/Support/Caster/TraceFile.php

View check run for this annotation

Codecov / codecov/patch

src/Support/Caster/TraceFile.php#L22

Added line #L22 was not covered by tests
public readonly array $line,
) {
}
) {}

Check warning on line 24 in src/Support/Caster/TraceFile.php

View check run for this annotation

Codecov / codecov/patch

src/Support/Caster/TraceFile.php#L24

Added line #L24 was not covered by tests

public function __toString(): string

Check warning on line 26 in src/Support/Caster/TraceFile.php

View check run for this annotation

Codecov / codecov/patch

src/Support/Caster/TraceFile.php#L26

Added line #L26 was not covered by tests
{
Expand Down
12 changes: 6 additions & 6 deletions src/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,25 +43,25 @@ function trap(mixed ...$values): TrapHandle
*/
function tr(mixed ...$values): mixed
{
/** @var int<0, max> $counter */
/** @var int<-1, max> $counter */
static $counter = -1;

Check warning on line 47 in src/functions.php

View check run for this annotation

Codecov / codecov/patch

src/functions.php#L47

Added line #L47 was not covered by tests
/** @var float $time */
static $time = 0.0;

Check warning on line 49 in src/functions.php

View check run for this annotation

Codecov / codecov/patch

src/functions.php#L49

Added line #L49 was not covered by tests

++$counter;

Check warning on line 51 in src/functions.php

View check run for this annotation

Codecov / codecov/patch

src/functions.php#L51

Added line #L51 was not covered by tests

$previous = $time;
$mem = $time = \microtime(true);

Check warning on line 54 in src/functions.php

View check run for this annotation

Codecov / codecov/patch

src/functions.php#L53-L54

Added lines #L53 - L54 were not covered by tests
try {
if ($values === []) {

Check warning on line 56 in src/functions.php

View check run for this annotation

Codecov / codecov/patch

src/functions.php#L56

Added line #L56 was not covered by tests
$previous = $time;
$mem = $time = \microtime(true);
/** @psalm-suppress InternalMethod */
return TrapHandle::fromTicker(
$counter,
$counter === 0 ? 0 : $mem - $previous,
memory_get_usage(),
\memory_get_usage(),
)->return();

Check warning on line 62 in src/functions.php

View check run for this annotation

Codecov / codecov/patch

src/functions.php#L58-L62

Added lines #L58 - L62 were not covered by tests
}

$mem = $time = \microtime(true);
/** @psalm-suppress InternalMethod */
return TrapHandle::fromArray($values)->return();

Check warning on line 66 in src/functions.php

View check run for this annotation

Codecov / codecov/patch

src/functions.php#L66

Added line #L66 was not covered by tests
} finally {
Expand Down Expand Up @@ -92,7 +92,7 @@ function td(mixed ...$values): never
/**
* Register the var-dump caster for protobuf messages
*/
if (class_exists(AbstractCloner::class)) {
if (\class_exists(AbstractCloner::class)) {
/** @psalm-suppress MixedAssignment */
AbstractCloner::$defaultCasters[Message::class] ??= [ProtobufCaster::class, 'cast'];
/** @psalm-suppress MixedAssignment */
Expand Down

0 comments on commit 8c20628

Please sign in to comment.