Skip to content

Commit

Permalink
Laravel 6 support (#5)
Browse files Browse the repository at this point in the history
Laravel 6 support
  • Loading branch information
glorand authored Nov 22, 2019
1 parent 58f7238 commit 26cccc2
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 17 deletions.
6 changes: 1 addition & 5 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ build:
- php-scrutinizer-run
- command: phpcs-run
use_website_config: true
- command: './vendor/bin/phpunit --coverage-clover=coverage.xml'
coverage:
file: coverage.xml
format: clover
filter:
excluded_paths:
- 'tests/*'
Expand All @@ -35,4 +31,4 @@ coding_style:
around_operators:
concatenation: true
other:
after_type_cast: false
after_type_cast: false
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ before_script:
- composer install

script:
- vendor/bin/phpunit --coverage-clover=coverage.xml
- vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover

after_script:
- php vendor/bin/ocular code-coverage:upload --format=php-clover coverage.clover
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[![Latest Stable Version](https://poser.pugx.org/glorand/laravel-eloquent-model-uuid/v/stable)](https://packagist.org/packages/glorand/laravel-model-settings)
[![Build Status](https://travis-ci.com/glorand/laravel-eloquent-model-uuid.svg?branch=master)](https://travis-ci.com/glorand/laravel-eloquent-model-uuid)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)](LICENSE.md)
[![Build Status](https://scrutinizer-ci.com/g/glorand/laravel-eloquent-model-uuid/badges/build.png?b=master)](https://scrutinizer-ci.com/g/glorand/laravel-eloquent-model-uuid/build-status/master)
[![StyleCI](https://github.styleci.io/repos/194731086/shield?branch=master)](https://github.styleci.io/repos/194731086)
[![Code Intelligence Status](https://scrutinizer-ci.com/g/glorand/laravel-eloquent-model-uuid/badges/code-intelligence.svg?b=master)](https://scrutinizer-ci.com/code-intelligence)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/glorand/laravel-eloquent-model-uuid/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/glorand/laravel-eloquent-model-uuid/?branch=master)

Expand All @@ -25,6 +25,7 @@ $table->primary('id');
$table->uuid('id')->primary();
```

### Use model class provided by this package
Instead of extending the standard Laravel model class,
extend from the model class provided by this package:
```php
Expand All @@ -37,7 +38,7 @@ class Entity extends Model
}
```

Use Trait on model class:
### Use Trait on model class:
```php
<?php
use Illuminate\Database\Eloquent\Model;
Expand Down Expand Up @@ -84,4 +85,4 @@ If you discover any security related issues, please email [email protected]

## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
17 changes: 11 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
],
"require": {
"php": ">=7.1.3",
"illuminate/database": "~5.5.0|~5.6.0|~5.7.0|~5.8.0",
"illuminate/support": "~5.5.0|~5.6.0|~5.7.0|~5.8.0"
"illuminate/database": "~5.5.0|~5.6.0|~5.7.0|~5.8.0|^6.0",
"illuminate/support": "~5.5.0|~5.6.0|~5.7.0|~5.8.0|^6.0"
},
"require-dev": {
"phpunit/phpunit": "^7.5",
"orchestra/testbench": "~3.8.0",
"friendsofphp/php-cs-fixer": "^2.15"
"phpunit/phpunit": "^7.5|^8.0",
"orchestra/testbench": "~3.8.0|^4.0",
"friendsofphp/php-cs-fixer": "^2.16@dev"
},
"autoload": {
"psr-4": {
Expand All @@ -39,7 +39,12 @@
}
},
"scripts": {
"test": "vendor/bin/phpunit"
"test": "vendor/bin/phpunit",
"test:coverage:text": "vendor/bin/phpunit --coverage-text",
"test:coverage:html": "vendor/bin/phpunit --coverage-html coverage",
"test:style": "@php vendor/bin/php-cs-fixer fix --config=.php_cs --allow-risky=yes --dry-run --diff --verbose",
"test:unit": "@php vendor/bin/phpunit",
"fix:style": "@php vendor/bin/php-cs-fixer fix --config=.php_cs --allow-risky=yes --diff --verbose"
},
"config": {
"sort-packages": true
Expand Down
3 changes: 2 additions & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Orchestra\Testbench\TestCase as OrchestraTestCase;
use Illuminate\Support\Arr;

class TestCase extends OrchestraTestCase
{
Expand All @@ -20,7 +21,7 @@ public function setUp(): void
protected function checkRequirements()
{
collect($this->getAnnotations())->filter(function ($location) {
return in_array('!Travis', array_get($location, 'requires', []));
return in_array('!Travis', Arr::get($location, 'requires', []));
})->each(function ($location) {
$this->markTestSkipped('Travis will not run this test.');
});
Expand Down

0 comments on commit 26cccc2

Please sign in to comment.