Skip to content

Commit

Permalink
feat: PHP 8.0 Support (ankitpokhrel#307)
Browse files Browse the repository at this point in the history
  • Loading branch information
ankitpokhrel authored Nov 14, 2020
1 parent dca27e7 commit dc387eb
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 11 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,7 @@ jobs:
- name: Update dependencies with composer
run: composer update --no-interaction --no-ansi --no-progress --no-suggest

- name: Run friendsofphp/php-cs-fixer
run: php7.3 ./vendor/bin/php-cs-fixer fix --diff-format=udiff --dry-run --show-progress=dots --using-cache=no --verbose
- name: Install and run friendsofphp/php-cs-fixer
run: |
wget https://cs.symfony.com/download/php-cs-fixer-v2.phar -O php-cs-fixer && sudo chmod a+x php-cs-fixer
php7.3 ./php-cs-fixer fix --diff-format=udiff --dry-run --show-progress=dots --using-cache=no --verbose
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ php:
- '7.2'
- '7.3'
- '7.4'
- 'nightly'

env:
matrix:
Expand All @@ -15,7 +16,8 @@ before_install:
- echo yes | pecl upgrade apcu
- echo "apc.enabled=1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- echo "apc.enable_cli=1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- composer self-update && composer update $FLAGS
- composer self-update --2
- if [[ $TRAVIS_PHP_VERSION != "nightly" ]]; then composer update $FLAGS; else composer update; fi

services:
- redis
Expand Down
9 changes: 4 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}
],
"require": {
"php": "^7.2.5",
"php": "^7.2.5 || ^8.0",
"ext-json": "*",
"guzzlehttp/guzzle": "^6.3 || ^7.0",
"nesbot/carbon": "^1.26.3 || ^2.0",
Expand All @@ -23,9 +23,8 @@
},
"require-dev": {
"ext-pcntl": "*",
"friendsofphp/php-cs-fixer": "^2.9",
"mockery/mockery": "^1.3.0",
"phpunit/phpunit": "^8.5"
"mockery/mockery": "^1.3.0 || ^1.4.2",
"phpunit/phpunit": "^8.5 || ^9.4"
},
"autoload": {
"psr-4": {
Expand All @@ -52,7 +51,7 @@
],
"extra": {
"branch-alias": {
"dev-master": "2.0-dev"
"dev-master": "2.1-dev"
}
}
}
2 changes: 1 addition & 1 deletion docker/base/Dockerfile.php8
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:8.0.0RC3-fpm-alpine
FROM php:8.0.0RC4-fpm-alpine

LABEL maintainer="[email protected],[email protected]" \
description="This builds tus-php-base image"
Expand Down
1 change: 0 additions & 1 deletion tests/FileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,6 @@ public function it_uploads_a_chunk() : void
$file = __DIR__ . '/.tmp/upload.txt';
$dataFile = __DIR__ . '/Fixtures/large.txt';
$key = uniqid();
$checksum = '74f02d6da32082463e382f2274e85fd8eae3e81f739f8959abc91865656e3b3a';
$chunkSize = 8192;
$totalBytes = 17548;

Expand Down
5 changes: 4 additions & 1 deletion tests/ResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,10 @@ public function it_sends_binary_response() : void
$response = $this->response->createOnly(true)->download($file, $name);

$this->assertEquals(200, $response->getStatusCode());
$this->assertRegExp("/attachment; filename=($name|\"$name\")/", $response->headers->get('content-disposition'));
$this->assertRegExp(
"/attachment; filename=($name|\"$name\")/",
$response->headers->get('content-disposition')
);
}

/**
Expand Down

0 comments on commit dc387eb

Please sign in to comment.