Skip to content

Commit

Permalink
Bump lowest supported version to PHP 7.4 (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
sanmai authored Oct 23, 2023
1 parent 7b1c11e commit 3375501
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 44 deletions.
25 changes: 7 additions & 18 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,16 @@ on:
- master
- main

jobs:
env:
COMPOSER_ROOT_VERSION: 0.1.x-dev

jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2']
php-version: ['7.4', '8.0', '8.1', '8.2', '8.3']
coverage: ['pcov']
include:
- php-version: '7.1'
coverage: xdebug

name: Test with PHP ${{ matrix.php-version }}

Expand Down Expand Up @@ -48,11 +47,6 @@ jobs:
composer-${{ matrix.php-version }}-
composer-
- name: Set package version for Composer
uses: ergebnis/composer-root-version-action@0.2.1
with:
branch: main

- name: Install dependencies
run: |
composer remove --no-update --dev --no-interaction --no-progress \
Expand All @@ -69,7 +63,7 @@ jobs:
runs-on: ubuntu-latest

env:
PHP_VERSION: '8.1'
PHP_VERSION: '8.2'

steps:
- name: Checkout code
Expand All @@ -92,11 +86,6 @@ jobs:
composer-${{ env.PHP_VERSION }}-
composer-
- name: Set package version for Composer
uses: ergebnis/composer-root-version-action@0.2.1
with:
branch: main

- name: Install dependencies
run: |
composer update --prefer-dist --no-interaction --no-progress
Expand All @@ -121,8 +110,8 @@ jobs:
runs-on: ubuntu-latest

env:
PHP_VERSION: '8.1'
PHP_CS_FIXER_VERSION: 'v3.12.0'
PHP_VERSION: '8.2'
PHP_CS_FIXER_VERSION: 'v3.35.1'

steps:
- name: Checkout
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
}
],
"require": {
"php": ">=7.1"
"php": ">=7.4"
},
"require-dev": {
"ergebnis/composer-normalize": "^2.8",
"friendsofphp/php-cs-fixer": "^3.12",
"infection/infection": ">=0.18",
"friendsofphp/php-cs-fixer": "^3.35.1",
"infection/infection": ">=0.27.6",
"phan/phan": ">=2",
"php-coveralls/php-coveralls": "^2.0",
"phpstan/phpstan": ">=1.4.5",
"phpunit/phpunit": ">=7.4",
"phpunit/phpunit": ">=9.5 <10",
"vimeo/psalm": ">=2"
},
"autoload": {
Expand Down
39 changes: 20 additions & 19 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
<phpunit bootstrap="vendor/autoload.php"
<?xml version="1.0"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
bootstrap="vendor/autoload.php"
executionOrder="random"
resolveDependencies="true"
forceCoversAnnotation="false"
colors="true">

<testsuites>
<testsuite name="Main">
<directory>tests/</directory>
</testsuite>
</testsuites>

<filter>
<whitelist>
<directory suffix=".php">src/</directory>
</whitelist>
</filter>

<logging>
<log type="coverage-clover" target="build/logs/clover.xml"/>
<log type="coverage-text" target="php://stdout"/>
</logging>
colors="true"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage>
<include>
<directory suffix=".php">src/</directory>
</include>
<report>
<clover outputFile="build/logs/clover.xml"/>
<text outputFile="php://stdout"/>
</report>
</coverage>
<testsuites>
<testsuite name="Main">
<directory>tests/</directory>
</testsuite>
</testsuites>
<logging/>
</phpunit>
2 changes: 2 additions & 0 deletions src/Deferred.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
*
* @template T
*
* @template-implements Interfaces\Deferred<T>
*
* @psalm-suppress PropertyNotSetInConstructor
*
* @internal
Expand Down
2 changes: 2 additions & 0 deletions src/Immediate.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
*
* @template T
*
* @template-implements Interfaces\Deferred<T>
*
* @internal
*/
final class Immediate implements Interfaces\Deferred
Expand Down
2 changes: 1 addition & 1 deletion tests/DeferredTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function testGetFromEmptyReturnNull(bool $false = false): void
}

/**
* @return iterable<int>
* @return iterable<null|int>
*/
private function yieldsNothing(bool $false = false): iterable
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Examples/Calculator.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ private function makeDependency(int $number)

for ($i = 1; $i <= $number; ++$i) {
\usleep(100);
$factorial = $factorial * $i;
$factorial *= $i;
}

yield $factorial;
Expand Down
2 changes: 1 addition & 1 deletion tests/LaterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function testGet(): void
{
$later = later(
/** @return iterable<int> */
function (): iterable {
static function (): iterable {
yield 42;
}
);
Expand Down

0 comments on commit 3375501

Please sign in to comment.