Skip to content

Commit

Permalink
PHP 8.1 compatibility
Browse files Browse the repository at this point in the history
* Bump version of `tukio` to `1.3.0`
* Bump version of `laminas/laminas-diactoros` to `2.8.0`
* Add 8.1 version into CI workflows
* Fix `StreamInterface::__toString()` compatibility with PHP 8.1

Closes #92
Closes #93
  • Loading branch information
Jeckerson authored and jbboehr committed Dec 11, 2021
1 parent 9401004 commit b52d62a
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .ci/deps.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
"HTTP_GUZZLE_PSR18_ADAPTER_VERSION": "ade71939e1805b6e5305dbec4fb72b64f983b12d",
"TUKIO_SHORTNAME": "tukio",
"TUKIO_REPO": "https://github.com/Crell/Tukio.git",
"TUKIO_VERSION": "1.2.0",
"TUKIO_VERSION": "1.3.0",
"LAMINAS_DIACTOROS_SHORTNAME": "laminas-diactoros",
"LAMINAS_DIACTOROS_REPO": "https://github.com/laminas/laminas-diactoros.git",
"LAMINAS_DIACTOROS_VERSION": "2.5.0",
"LAMINAS_DIACTOROS_VERSION": "2.8.0",
"RELAY_SHORTNAME": "relay",
"RELAY_REPO": "https://github.com/jbboehr/Relay.Relay.git",
"RELAY_VERSION": "d1b26ae9e1cbfcc713f1e7d328a88fb1fba1ab9b",
Expand Down
2 changes: 1 addition & 1 deletion .ci/travis_php.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export COVERAGE=${COVERAGE:-true}
export PHP_VERSION_ID=$(php -r 'echo PHP_VERSION_ID;')
# error_reporting='E_ALL & ~E_DEPRECATED'
export PHP_WITH_EXT="`which php` -d error_reporting=24575 -d extension=`pwd`/modules/psr.so"
export DEFAULT_COMPOSER_FLAGS="--ansi --no-interaction --no-progress --prefer-dist"
export DEFAULT_COMPOSER_FLAGS="--ansi --no-interaction --no-progress --prefer-dist --ignore-platform-reqs"
export PHP_VERSION_ID=$(php -r 'echo PHP_VERSION_ID;')

export NO_INTERACTION=1
Expand Down
1 change: 0 additions & 1 deletion .github/php-debian.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

ARG PHP_VERSION=7.4
ARG BASE_IMAGE=php:$PHP_VERSION

Expand Down
1 change: 0 additions & 1 deletion .github/php-fedora.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

ARG BASE_IMAGE=fedora:latest

# image0
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
- "7.3"
- "7.4"
- "8.0"
- "8.1"

steps:
- uses: actions/checkout@v2
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
- "7.3"
- "7.4"
- "8.0"
- "8.1"
coverage:
- "true"
- "false"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
php-versions:
- "7.4"
- "8.0"
- "8.1"
steps:
- uses: actions/checkout@v2
- run: bash .github/scripts/osx.sh
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
fail-fast: false
matrix:
operating-system: [windows-2016]
php-versions: ["7.4", "8.0"]
php-versions: ["7.4", "8.0", "8.1"]
ts: [ts, nts]
include:
- php-versions: "7.4"
Expand All @@ -33,6 +33,10 @@ jobs:
vc_num: "vs16"
arch: x64
build_type: Win32
- php-versions: "8.1"
vc_num: "vs16"
arch: x64
build_type: Win32

steps:
- name: Disable Git autocrlf
Expand Down
2 changes: 1 addition & 1 deletion nix/deps/relay-composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion nix/deps/request-handler-composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions psr_http_message.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,11 @@ PHP_PSR_BEGIN_ARG_INFO(HttpMessage, ServerRequestInterface, withoutAttribute, 1)
ZEND_ARG_INFO(0, name)
PHP_PSR_END_ARG_INFO()

#if PHP_VERSION_ID >= 80000
PHP_PSR_BEGIN_ARG_WITH_RETURN_TYPE_INFO(HttpMessage, StreamInterface, __toString, 0, IS_STRING, 0)
#else
PHP_PSR_BEGIN_ARG_INFO(HttpMessage, StreamInterface, __toString, 0)
#endif
PHP_PSR_END_ARG_INFO()

PHP_PSR_BEGIN_ARG_INFO(HttpMessage, StreamInterface, close, 0)
Expand Down Expand Up @@ -264,7 +268,11 @@ PHP_PSR_BEGIN_ARG_INFO(HttpMessage, UriInterface, withFragment, 1)
ZEND_ARG_INFO(0, fragment)
PHP_PSR_END_ARG_INFO()

#if PHP_VERSION_ID >= 80000
PHP_PSR_BEGIN_ARG_WITH_RETURN_TYPE_INFO(HttpMessage, UriInterface, __toString, 0, IS_STRING, 0)
#else
PHP_PSR_BEGIN_ARG_INFO(HttpMessage, UriInterface, __toString, 0)
#endif
PHP_PSR_END_ARG_INFO()

#endif /* PSR_HTTP_MESSAGE_H */
Expand Down

0 comments on commit b52d62a

Please sign in to comment.