Skip to content

PHP 8.0 Support #129

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.editorconfig export-ignore
.editorconfig export-ignore
.gitattributes export-ignore
/.github/ export-ignore
.gitignore export-ignore
Expand Down
28 changes: 10 additions & 18 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,16 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: Install
uses: docker://composer
with:
args: install
- name: Composer normalize
uses: docker://ergebnis/composer-normalize-action

- name: Normalize
uses: docker://composer
with:
args: composer normalize --dry-run

# Disabled until https://github.com/Roave/BackwardCompatibilityCheck/issues/37 is resolved
# roave-bc-check:
# name: Roave BC Check
# runs-on: ubuntu-latest
roave-bc-check:
name: Roave BC Check
runs-on: ubuntu-latest

# steps:
# - name: Checkout code
# uses: actions/checkout@v2
steps:
- name: Checkout code
uses: actions/checkout@v2

# - name: Roave BC Check
# uses: docker://nyholm/roave-bc-check-ga
- name: Roave BC Check
uses: docker://nyholm/roave-bc-check-ga
82 changes: 50 additions & 32 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,60 +2,78 @@ name: CI

on:
push:
branches:
- master
pull_request:

jobs:
build-lowest-version:
name: Build lowest version
latest:
name: PHP ${{ matrix.php }} Latest
runs-on: ubuntu-latest
strategy:
matrix:
php: ['7.1', '7.2', '7.3', '7.4', '8.0']

steps:
- name: Set up PHP
uses: shivammathur/setup-php@1.7.0
with:
php-version: '7.1'
coverage: xdebug
extensions: mbstring
tools: prestissimo

- name: Setup Problem Matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Checkout code
uses: actions/checkout@v2

- name: Download dependencies
run: composer update --prefer-stable --prefer-dist --no-interaction --no-progress --no-suggest --prefer-lowest
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer
coverage: none

- name: Run tests
run: composer test-ci
- name: Install dependencies
run: composer update --prefer-dist --no-interaction --no-progress

build:
name: Build
- name: Execute tests
run: composer test

lowest:
name: PHP ${{ matrix.php }} Lowest
runs-on: ubuntu-latest
strategy:
max-parallel: 10
matrix:
php: ['7.1', '7.2', '7.3', '7.4']

steps:
- name: Set up PHP
uses: shivammathur/setup-php@1.7.0
- name: Checkout code
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mbstring
tools: prestissimo
tools: composer
coverage: none

- name: Install dependencies
run: |
composer require "sebastian/comparator:^3.0.2" --no-interaction --no-update
composer update --prefer-dist --prefer-stable --prefer-lowest --no-interaction --no-progress

- name: Setup Problem Matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Execute tests
run: composer test

coverage:
name: Code Coverage
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Download dependencies
run: composer update --prefer-stable --prefer-dist --no-interaction --no-progress --no-suggest
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
tools: composer
coverage: xdebug

- name: Install dependencies
run: |
composer require "friends-of-phpspec/phpspec-code-coverage:^4.3.2" --no-interaction --no-update
composer update --prefer-dist --no-interaction --no-progress

- name: Run tests
run: composer test
- name: Execute tests
run: composer test-ci
2 changes: 2 additions & 0 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:

- name: PHPStan
uses: docker://oskarstark/phpstan-ga
env:
REQUIRE_DEV: true
with:
args: analyze --no-progress

Expand Down
11 changes: 4 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
}
],
"require": {
"php": "^7.1",
"clue/stream-filter": "^1.4.1",
"php": "^7.1 || ^8.0",
"clue/stream-filter": "^1.5",
"php-http/message-factory": "^1.0.2",
"psr/http-message": "^1.0"
},
Expand All @@ -25,12 +25,9 @@
},
"require-dev": {
"ext-zlib": "*",
"akeneo/phpspec-skip-example-extension": "^1.0",
"coduo/phpspec-data-provider-extension": "^1.0",
"ergebnis/composer-normalize": "^2.1",
"ergebnis/composer-normalize": "^2.6",
"guzzlehttp/psr7": "^1.0",
"henrikbjorn/phpspec-code-coverage": "^1.0",
"phpspec/phpspec": "^2.4",
"phpspec/phpspec": "^5.1 || ^6.3",
"slim/slim": "^3.0",
"zendframework/zend-diactoros": "^1.0"
},
Expand Down
5 changes: 2 additions & 3 deletions phpspec.ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ suites:
psr4_prefix: Http\Message
formatter.name: pretty
extensions:
- PhpSpec\Extension\CodeCoverageExtension
- Coduo\PhpSpec\DataProvider\DataProviderExtension
- Akeneo\SkipExampleExtension
FriendsOfPhpSpec\PhpSpec\CodeCoverage\CodeCoverageExtension: ~
code_coverage:
format: clover
output: build/coverage.xml
runner.maintainers.errors.level: 16383
4 changes: 1 addition & 3 deletions phpspec.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@ suites:
namespace: Http\Message
psr4_prefix: Http\Message
formatter.name: pretty
extensions:
- Coduo\PhpSpec\DataProvider\DataProviderExtension
- Akeneo\SkipExampleExtension
runner.maintainers.errors.level: 16383
65 changes: 15 additions & 50 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,6 @@ parameters:
count: 1
path: src/CookieJar.php

-
message: "#^Method Http\\\\Message\\\\CookieJar\\:\\:count\\(\\) has no return typehint specified\\.$#"
count: 1
path: src/CookieJar.php

-
message: "#^Method Http\\\\Message\\\\CookieJar\\:\\:getIterator\\(\\) return type has no value type specified in iterable type Traversable\\<mixed, mixed\\>\\.$#"
count: 1
Expand All @@ -145,61 +140,16 @@ parameters:
count: 1
path: src/CookieUtil.php

-
message: "#^Method Http\\\\Message\\\\Encoding\\\\FilteredStream\\:\\:getSize\\(\\) has no return typehint specified\\.$#"
count: 2
path: src/Encoding/FilteredStream.php

-
message: "#^Method Http\\\\Message\\\\Encoding\\\\FilteredStream\\:\\:isSeekable\\(\\) has no return typehint specified\\.$#"
count: 2
path: src/Encoding/FilteredStream.php

-
message: "#^Method Http\\\\Message\\\\Encoding\\\\FilteredStream\\:\\:seek\\(\\) has no return typehint specified\\.$#"
count: 2
path: src/Encoding/FilteredStream.php

-
message: "#^Method Http\\\\Message\\\\Encoding\\\\FilteredStream\\:\\:rewind\\(\\) has no return typehint specified\\.$#"
count: 2
path: src/Encoding/FilteredStream.php

-
message: "#^Method Http\\\\Message\\\\Encoding\\\\FilteredStream\\:\\:fill\\(\\) has no return typehint specified\\.$#"
count: 1
path: src/Encoding/FilteredStream.php

-
message: "#^Method Http\\\\Message\\\\Encoding\\\\ChunkStream\\:\\:fill\\(\\) has no return typehint specified\\.$#"
count: 1
path: src/Encoding/ChunkStream.php

-
message: "#^Method Http\\\\Message\\\\Encoding\\\\Filter\\\\Chunk\\:\\:filter\\(\\) has no return typehint specified\\.$#"
count: 1
path: src/Encoding/Filter/Chunk.php

-
message: "#^Method Http\\\\Message\\\\Encoding\\\\Filter\\\\Chunk\\:\\:filter\\(\\) has parameter \\$closing with no typehint specified\\.$#"
count: 1
path: src/Encoding/Filter/Chunk.php

-
message: "#^Method Http\\\\Message\\\\Encoding\\\\Filter\\\\Chunk\\:\\:filter\\(\\) has parameter \\$consumed with no typehint specified\\.$#"
count: 1
path: src/Encoding/Filter/Chunk.php

-
message: "#^Method Http\\\\Message\\\\Encoding\\\\Filter\\\\Chunk\\:\\:filter\\(\\) has parameter \\$in with no typehint specified\\.$#"
count: 1
path: src/Encoding/Filter/Chunk.php

-
message: "#^Method Http\\\\Message\\\\Encoding\\\\Filter\\\\Chunk\\:\\:filter\\(\\) has parameter \\$out with no typehint specified\\.$#"
count: 1
path: src/Encoding/Filter/Chunk.php

-
message: "#^Access to an undefined property Http\\\\Message\\\\Encoding\\\\Filter\\\\Chunk\\:\\:\\$stream\\.$#"
count: 2
Expand All @@ -220,6 +170,21 @@ parameters:
count: 1
path: src/Encoding/Filter/Chunk.php

-
message: "#^Method Http\\\\Message\\\\Encoding\\\\FilteredStream\\:\\:fill\\(\\) has no return typehint specified\\.$#"
count: 1
path: src/Encoding/FilteredStream.php

-
message: "#^Method Http\\\\Message\\\\Encoding\\\\FilteredStream\\:\\:rewind\\(\\) has no return typehint specified\\.$#"
count: 1
path: src/Encoding/FilteredStream.php

-
message: "#^Method Http\\\\Message\\\\Encoding\\\\FilteredStream\\:\\:seek\\(\\) has no return typehint specified\\.$#"
count: 1
path: src/Encoding/FilteredStream.php

-
message: "#^Method Http\\\\Message\\\\MessageFactory\\\\DiactorosMessageFactory\\:\\:createRequest\\(\\) has parameter \\$headers with no value type specified in iterable type array\\.$#"
count: 1
Expand Down
2 changes: 1 addition & 1 deletion spec/CookieJarSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ function it_clears_cookies()
$this->count()->shouldReturn(0);
}

public function getMatchers()
public function getMatchers(): array
{
return [
'beAnArrayOfInstance' => function ($subject, $instance) {
Expand Down
Loading