Skip to content
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

Allow installing with PHP 8 #13

Merged
merged 27 commits into from
Sep 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
cd2cf3e
Change to released version oho PHP 7.4
tuupola Aug 19, 2020
6d5a6b4
Allow installing with PHP 8.0
tuupola Aug 19, 2020
11f2ece
Upgrade phpunit/phpunit
tuupola Aug 20, 2020
cb2927a
Change to master version of http-interop/http-factory-tests
tuupola Aug 20, 2020
9057270
Temporarily allow only nightly testing
tuupola Aug 20, 2020
42bad32
Remove accidentally added nyholm/psr7
tuupola Aug 20, 2020
f4a8c66
Add workaround for dependency hell
tuupola Aug 20, 2020
0a65bc7
Fix yaml syntax
tuupola Aug 20, 2020
17a7097
Add workaround for Travis config mess
tuupola Aug 20, 2020
223483b
Add workaround for Travis config mess
tuupola Aug 20, 2020
803f80d
Add workaround for Travis config mess
tuupola Aug 20, 2020
3b5374a
Add workaround for Travis config mess
tuupola Aug 20, 2020
79c74f1
Add workaround for Travis config mess
tuupola Aug 20, 2020
db1c638
Add workaround for Travis config mess
tuupola Aug 20, 2020
d455d3c
Add workaround for Travis config mess
tuupola Aug 20, 2020
e7e3509
Add workaround for Travis config mess
tuupola Aug 20, 2020
720f0cf
Upgrade http-interop/http-factory-tests
tuupola Aug 20, 2020
fd9f14e
Add back PHP 7.4 testing
tuupola Aug 20, 2020
9f4d3c0
Merge branch 'master' into php-8
tuupola Aug 25, 2020
e74f8ee
Add exception when filename is empty
tuupola Aug 25, 2020
5adb1c5
Add back tests for older PHP versions
tuupola Sep 7, 2020
ad242cd
Add workaround for dependency hell
tuupola Sep 8, 2020
4d712c3
Add workaround for dependency hell
tuupola Sep 8, 2020
4f20a75
Add Travis COMPOSER_ARGS to make vendor
tuupola Sep 8, 2020
f52df23
Change matrix to jobs
tuupola Sep 8, 2020
1ecdb64
Possible fix from missing nightly tests
tuupola Sep 8, 2020
9016241
Try yet another workaround for PHPUnit dependency hell
tuupola Sep 8, 2020
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
39 changes: 27 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,41 @@ php:
- 7.1
- 7.2
- 7.3
- 7.4snapshot
- nightly
- 7.4

env:
- PSR7_LIBRARY="zendframework/zend-diactoros:^1.0"
- PSR7_LIBRARY="zendframework/zend-diactoros:^2.0"
- PSR7_LIBRARY="nyholm/psr7"
- PSR7_LIBRARY="slim/psr7"
- PSR7_LIBRARY="slim/slim:^3.0"
- PSR7_LIBRARY="guzzlehttp/psr7"

matrix:
global:
- COMPOSER_ARGS="--no-interaction"
jobs:
- PSR7_LIBRARY="zendframework/zend-diactoros:^1.0"
- PSR7_LIBRARY="zendframework/zend-diactoros:^2.0"
- PSR7_LIBRARY="nyholm/psr7"
- PSR7_LIBRARY="slim/psr7"
- PSR7_LIBRARY="slim/slim:^3.0"
- PSR7_LIBRARY="guzzlehttp/psr7"

jobs:
fast_finish: true
include:
- php: nightly
env: PSR7_LIBRARY="zendframework/zend-diactoros:^1.0" COMPOSER_ARGS="--no-interaction --ignore-platform-reqs"
- php: nightly
env: PSR7_LIBRARY="zendframework/zend-diactoros:^2.0" COMPOSER_ARGS="--no-interaction --ignore-platform-reqs"
- php: nightly
env: PSR7_LIBRARY="nyholm/psr7" COMPOSER_ARGS="--no-interaction --ignore-platform-reqs"
- php: nightly
env: PSR7_LIBRARY="slim/psr7" COMPOSER_ARGS="--no-interaction --ignore-platform-reqs"
- php: nightly
env: PSR7_LIBRARY="slim/slim:^3.0" COMPOSER_ARGS="--no-interaction --ignore-platform-reqs"
- php: nightly
env: PSR7_LIBRARY="guzzlehttp/psr7" COMPOSER_ARGS="--no-interaction --ignore-platform-reqs"
allow_failures:
- php: nightly

before_script:
- travis_retry composer self-update
- if [ "$PSR7_LIBRARY" != "" ]; then composer require --dev $PSR7_LIBRARY; fi
- travis_retry composer install --no-interaction
- travis_retry composer install $COMPOSER_ARGS
- if [ "$PSR7_LIBRARY" != "" ]; then composer require $COMPOSER_ARGS --dev $PSR7_LIBRARY; fi

script:
- make travis
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

All notable changes to this project will be documented in this file, in reverse chronological order by release.

## [1.2.0](https://github.com/tuupola/http-factory/compare/1.1.0...1.2.0) - unreleased
### Added
- Allow installing with PHP 8 ([#13](https://github.com/tuupola/http-factory/pull/13)).


### Fixed
- Throw exception from `createStreamFromFile()` when filename is empty ([#13](https://github.com/tuupola/http-factory/pull/13/commits/e74f8ee352b92fbc21829307af1172eb7f5ab914)).

## [1.1.0](https://github.com/tuupola/http-factory/compare/1.0.3...1.1.0) - 2019-08-07
### Added
- Support for slim/psr7 ([#10](https://github.com/tuupola/http-factory/pull/10)).
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ help:
@echo ""

vendor: $(wildcard composer.lock)
composer install --prefer-dist
composer install --prefer-dist --no-interaction ${COMPOSER_ARGS}

lint: vendor
vendor/bin/phplint . --exclude=vendor/
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
"sort-packages": true
},
"require": {
"php": "^7.1",
"php": "^7.1|^8.0",
"psr/http-factory": "^1.0"
},
"require-dev": {
"http-interop/http-factory-tests": "^0.7.0",
"overtrue/phplint": "^1.0",
"phpunit/phpunit": "^6.0|^7.0",
"phpunit/phpunit": "^7.0|^8.0|^9.0",
"squizlabs/php_codesniffer": "^3.0"
},
"conflict": {
Expand Down
4 changes: 4 additions & 0 deletions src/StreamFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ public function createStreamFromFile(string $filename, string $mode = "r"): Stre
);
}

if (empty($filename)) {
throw new RuntimeException("Filename cannot be empty");
}

if (class_exists(SlimPsr7StreamFactory::class)) {
return (new SlimPsr7StreamFactory)->createStreamFromFile($filename, $mode);
}
Expand Down