Skip to content

Commit

Permalink
Add PHP8 support.
Browse files Browse the repository at this point in the history
  • Loading branch information
ptondereau committed Oct 5, 2020
1 parent af6676a commit 9296d6e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
13 changes: 9 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ matrix:
- php: 7.1
- php: 7.2
- php: 7.3
- php: 7.3.0
- php: 7.3.1
- php: 7.3.2
- php: 7.4
- php: nightly
env:
- IGNORE_PLATFORM_REQ=true
- php: hhvm-3.9
sudo: required
dist: trusty
Expand All @@ -36,7 +36,12 @@ before_install:
- xdebug-disable

before_script:
- travis_retry composer update --no-interaction --prefer-source --prefer-stable
- if [[ "$IGNORE_PLATFORM_REQ" == "true" ]]; then
composer self-update --preview;
travis_retry composer update --no-interaction --prefer-stable --ignore-platform-req=php;
else
travis_retry composer update --no-interaction --prefer-stable;
fi

script:
- if [[ "$LINT" == "true" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"sort-packages": true
},
"require": {
"php": "^7",
"php": "^7.0 || ^8.0",
"ext-intl": "*",
"ext-simplexml": "*",
"ext-mbstring": "*",
Expand Down
8 changes: 6 additions & 2 deletions tests/Assert/Tests/AssertTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1832,7 +1832,11 @@ public function testValidCallable()
{
$this->assertTrue(Assertion::isCallable('\is_callable'));
$this->assertTrue(Assertion::isCallable(__NAMESPACE__.'\\Fixtures\\someCallable'));
$this->assertTrue(Assertion::isCallable([OneCountable::class, 'count']));
if (PHP_VERSION_ID >= 70400) {
$this->assertTrue(Assertion::isCallable([new OneCountable(), 'count']));
} else {
$this->assertTrue(Assertion::isCallable([OneCountable::class, 'count']));
}
$this->assertTrue(
Assertion::isCallable(
function () {
Expand Down Expand Up @@ -2227,7 +2231,7 @@ public function testInvalidPropertiesExist($properties)

public function testIsResource()
{
self::assertTrue(Assertion::isResource(\curl_init()));
self::assertTrue(Assertion::isResource(fopen('php://memory', 'w')));
}

/**
Expand Down

0 comments on commit 9296d6e

Please sign in to comment.