Skip to content
Snippets Groups Projects
Commit a698c38e authored by David Prévot's avatar David Prévot
Browse files

New upstream version 7.0.1

parents 30bf1421 3b415def
No related branches found
No related tags found
No related merge requests found
......@@ -31,8 +31,8 @@ jobs:
- name: Run PHP-CS-Fixer
run: ./tools/php-cs-fixer fix --dry-run --show-progress=dots --using-cache=no --verbose
type-checker:
name: Type Checker
static-analysis:
name: Static Analysis
runs-on: ubuntu-latest
......@@ -49,8 +49,8 @@ jobs:
- name: Install dependencies with Composer
run: ./tools/composer update --no-interaction --no-ansi --no-progress
- name: Run Psalm
run: ./tools/psalm --config=.psalm/config.xml --no-progress --shepherd --show-info=false --stats
- name: Run PHPStan
run: ./tools/phpstan analyse --no-progress --error-format=github
tests:
name: Tests
......
# https://docs.github.com/en/actions
on:
push:
tags:
- "**"
name: Release
jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install PHP with extensions
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
coverage: none
extensions: none
tools: none
- name: Determine tag
run: echo "RELEASE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Parse ChangeLog
run: build/scripts/extract-release-notes.php ${{ env.RELEASE_TAG }} > release-notes.md
- name: Create release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ env.RELEASE_TAG }}
name: phpunit/php-timer ${{ env.RELEASE_TAG }}
bodyFile: release-notes.md
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="php-cs-fixer" version="^3.0" installed="3.41.1" location="./tools/php-cs-fixer" copy="true"/>
<phar name="psalm" version="^5.0" installed="5.18.0" location="./tools/psalm" copy="true"/>
<phar name="composer" version="^2.0.3" installed="2.6.6" location="./tools/composer" copy="true"/>
<phar name="php-cs-fixer" version="^3.59" installed="3.59.3" location="./tools/php-cs-fixer" copy="true"/>
<phar name="composer" version="^2.7" installed="2.7.7" location="./tools/composer" copy="true"/>
<phar name="phpstan" version="^1.11" installed="1.11.5" location="./tools/phpstan" copy="true"/>
</phive>
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="dev-master@">
<file src="src/ResourceUsageFormatter.php">
<TypeDoesNotContainType occurrences="1">
<code>is_float($_SERVER['REQUEST_TIME_FLOAT'])</code>
</TypeDoesNotContainType>
</file>
</files>
<?xml version="1.0"?>
<psalm
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
resolveFromConfigFile="false"
errorBaseline=".psalm/baseline.xml"
findUnusedBaselineEntry="true"
findUnusedCode="false"
>
<projectFiles>
<directory name="src" />
<ignoreFiles>
<directory name="vendor" />
</ignoreFiles>
</projectFiles>
</psalm>
......@@ -2,6 +2,12 @@
All notable changes are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles.
## [7.0.1] - 2024-07-03
### Changed
* This project now uses PHPStan instead of Psalm for static analysis
## [7.0.0] - 2024-02-02
### Removed
......@@ -133,6 +139,7 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt
* This component is no longer supported on PHP 5.3, PHP 5.4, PHP 5.5, PHP 5.6, and PHP 7.0
[7.0.1]: https://github.com/sebastianbergmann/php-timer/compare/7.0.0...7.0.1
[7.0.0]: https://github.com/sebastianbergmann/php-timer/compare/6.0...7.0.0
[6.0.0]: https://github.com/sebastianbergmann/php-timer/compare/5.0.3...6.0.0
[5.0.3]: https://github.com/sebastianbergmann/php-timer/compare/5.0.2...5.0.3
......
......@@ -2,7 +2,6 @@
[![Latest Stable Version](https://poser.pugx.org/phpunit/php-timer/v/stable.png)](https://packagist.org/packages/phpunit/php-timer)
[![CI Status](https://github.com/sebastianbergmann/php-timer/workflows/CI/badge.svg)](https://github.com/sebastianbergmann/php-timer/actions)
[![Type Coverage](https://shepherd.dev/github/sebastianbergmann/php-timer/coverage.svg)](https://shepherd.dev/github/sebastianbergmann/php-timer)
[![codecov](https://codecov.io/gh/sebastianbergmann/php-timer/branch/main/graph/badge.svg)](https://codecov.io/gh/sebastianbergmann/php-timer)
Utility class for timing things, factored out of PHPUnit into a stand-alone component.
......
#!/usr/bin/env php
<?php declare(strict_types=1);
if ($argc !== 2) {
print $argv[0] . ' <tag>' . PHP_EOL;
exit(1);
}
$version = $argv[1];
$file = __DIR__ . '/../../ChangeLog.md';
if (!is_file($file) || !is_readable($file)) {
print $file . ' cannot be read' . PHP_EOL;
exit(1);
}
$buffer = '';
$append = false;
foreach (file($file) as $line) {
if (str_starts_with($line, '## [' . $version . ']')) {
$append = true;
continue;
}
if ($append && (str_starts_with($line, '## ') || str_starts_with($line, '['))) {
break;
}
if ($append) {
$buffer .= $line;
}
}
$buffer = trim($buffer);
if ($buffer === '') {
print 'Unable to extract release notes' . PHP_EOL;
exit(1);
}
print $buffer . PHP_EOL;
parameters:
level: 9
paths:
- src
- tests
......@@ -13,7 +13,7 @@ use function floor;
use function sprintf;
/**
* @psalm-immutable
* @immutable
*/
final readonly class Duration
{
......
......@@ -17,7 +17,7 @@ use function sprintf;
final class ResourceUsageFormatter
{
/**
* @psalm-var array<string,int>
* @var array<string,int>
*/
private const SIZES = [
'GB' => 1073741824,
......
......@@ -15,7 +15,7 @@ use function hrtime;
final class Timer
{
/**
* @psalm-var list<float>
* @var list<float>
*/
private array $startTimes = [];
......
......@@ -21,7 +21,7 @@ use PHPUnit\Framework\TestCase;
final class DurationTest extends TestCase
{
/**
* @psalm-return list<array{0: string, 1: float}>
* @return list<array{0: string, 1: float}>
*/
public static function durationProvider(): array
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment