Skip to content

Commit

Permalink
Add support for Laravel 6.0 and dropped some support for some older v…
Browse files Browse the repository at this point in the history
…ersions of Laravel. (#15)

* Add support for Laravel 6.0 and dropped support for some older versions.

* Fixes code quality issue

* Fixes typo in orchestra package version
  • Loading branch information
richan-fongdasen authored Sep 5, 2019
1 parent da5a365 commit dd4535c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
10 changes: 3 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,12 @@ dist: trusty
matrix:
fast_finish: true
include:
- php: 7.1
env: LARAVEL=5.5.* ORCHESTRA=3.5.*
- php: 7.1
env: LARAVEL=5.6.* ORCHESTRA=3.6.*
- php: 7.2
env: LARAVEL=5.7.* ORCHESTRA=3.7.*
env: LARAVEL=5.8.* ORCHESTRA=3.8.*
- php: 7.2
env: LARAVEL=5.8.* ORCHESTRA=3.8.* COVERAGE=1
env: LARAVEL=6.0.* ORCHESTRA=4.0.* COVERAGE=1
- php: 7.3
env: LARAVEL=5.8.* ORCHESTRA=3.8.*
env: LARAVEL=6.0.* ORCHESTRA=4.0.*

allow_failures:
- env: COVERAGE=1
Expand Down
16 changes: 8 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@
"source": "https://github.com/richan-fongdasen/laravel-varnishable"
},
"require": {
"php": "^7.1.3",
"php": "^7.2",
"guzzlehttp/guzzle": "~6.0",
"illuminate/database": "5.5.*|5.6.*|5.7.*|5.8.*",
"illuminate/support": "5.5.*|5.6.*|5.7.*|5.8.*"
"illuminate/database": "5.8.*|6.0.*",
"illuminate/support": "5.8.*|6.0.*"
},
"require-dev": {
"mockery/mockery": "~1.0",
"orchestra/database": "~3.5",
"orchestra/testbench": "~3.5",
"orchestra/database": "~3.8|~4.0",
"orchestra/testbench": "~3.8|~4.0",
"phpmd/phpmd": "^2.6",
"phpstan/phpstan": "^0.11.8",
"phpstan/phpstan": "^0.11.15",
"phpstan/phpstan-deprecation-rules": "^0.11.2",
"phpstan/phpstan-strict-rules": "^0.11.1",
"phpunit/phpunit": "^8.0 || ~7.0 || ~6.0",
"sebastian/phpcpd": "^4.1 || ~3.0"
"phpunit/phpunit": "^7.5|^8.0",
"sebastian/phpcpd": "^4.1"
},
"config": {
"sort-packages": true
Expand Down
7 changes: 5 additions & 2 deletions src/Concerns/ManageEtagHeader.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ trait ManageEtagHeader
*/
protected function addEtagHeader(Response $response) :void
{
if ((bool) $this->getConfig('use_etag')) {
$response->setEtag(md5($response->getContent()));
$useEtag = (bool) $this->getConfig('use_etag');
$content = $response->getContent();

if (($content !== false) && $useEtag) {
$response->setEtag(md5($content));
}
}

Expand Down
5 changes: 3 additions & 2 deletions tests/Supports/database/factories/UserFactory.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php

use Illuminate\Support\Str;
use RichanFongdasen\Varnishable\Tests\Supports\Models\User;

$factory->define(User::class, function (\Faker\Generator $faker) {
Expand All @@ -8,8 +9,8 @@
return [
'name' => $faker->name,
'email' => $faker->email,
'password' => bcrypt(str_random(12)),
'remember_token' => str_random(12),
'password' => bcrypt(Str::random(12)),
'remember_token' => Str::random(12),
'created_at' => '2016-01-01 00:00:00',
'updated_at' => date('Y-m-d H:i:s', $time),
];
Expand Down

0 comments on commit dd4535c

Please sign in to comment.