From 4561e67d73db2a8db30f0ebccaeef988927b4220 Mon Sep 17 00:00:00 2001 From: Marcus Olsson Date: Tue, 8 Feb 2022 18:55:52 +0100 Subject: [PATCH] Compat-check against Laravel 9 (#11) * Compat-check against Laravel 9 * Delete .scrutinizer.yml --- .github/workflows/run-tests.yml | 4 +++- .scrutinizer.yml | 23 ----------------------- README.md | 5 +---- composer.json | 5 +++-- tests/SwedishEntityTest.php | 2 +- 5 files changed, 8 insertions(+), 31 deletions(-) delete mode 100644 .scrutinizer.yml diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index cd47216..10607ec 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -10,7 +10,9 @@ jobs: matrix: include: - php: 8.1 - testbench: 6.* + testbench: 7.* + - php: 8.0 + testbench: 7.* - php: 8.0 testbench: 6.* - php: 7.4 diff --git a/.scrutinizer.yml b/.scrutinizer.yml deleted file mode 100644 index 5a56f59..0000000 --- a/.scrutinizer.yml +++ /dev/null @@ -1,23 +0,0 @@ -filter: - excluded_paths: [tests/*] - -build: - environment: - php: - version: 7.4 - -checks: - php: - remove_extra_empty_lines: true - remove_php_closing_tag: true - remove_trailing_whitespace: true - fix_use_statements: - remove_unused: true - preserve_multiple: false - preserve_blanklines: true - order_alphabetically: true - fix_php_opening_tag: true - fix_linefeed: true - fix_line_ending: true - fix_identation_4spaces: true - fix_doc_comments: true \ No newline at end of file diff --git a/README.md b/README.md index 678b01b..45c9035 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,6 @@ [![Latest Version on Packagist][version-ico]][packagist-link] [![PHP version][php-ico]][packagist-link] [![Build Status][build-ico]][build-link] -[![Scrutinizer Score][scrutinizer-ico]][scrutinizer-link] [![Software License][license-ico]](LICENSE.md) **Validate, format and extract data for Swedish personnummer (social security numbers) and organisationsnummer (organizational numbers).** @@ -256,14 +255,12 @@ if($entity::class == Person::class) { The MIT License (MIT). Please see the [License File](LICENSE.md) for more information. -© 2021 [Marcus Olsson](https://marcusolsson.me). +© 2022 [Marcus Olsson](https://marcusolsson.me). [version-ico]: https://img.shields.io/packagist/v/olssonm/swedish-entity.svg?style=flat-square [build-ico]: https://img.shields.io/github/workflow/status/olssonm/swedish-entity/Run%20tests.svg?style=flat-square&label=tests [license-ico]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square [php-ico]: https://img.shields.io/packagist/php-v/olssonm/swedish-entity.svg?style=flat-square -[scrutinizer-ico]: https://img.shields.io/scrutinizer/g/olssonm/swedish-entity.svg?style=flat-square [packagist-link]: https://packagist.org/packages/olssonm/swedish-entity [build-link]: https://github.com/olssonm/swedish-entity/actions?query=workflow%3A%22Run+tests%22 -[scrutinizer-link]: https://scrutinizer-ci.com/g/olssonm/swedish-entity diff --git a/composer.json b/composer.json index 2371e51..202ed26 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,7 @@ "laravel/framework": "For Laravel-integration" }, "require-dev": { - "orchestra/testbench": "^4.0|^5.0|^6.0", + "orchestra/testbench": "^4.0|^5.0|^6.0|^7.0", "squizlabs/php_codesniffer": "^3.5" }, "autoload": { @@ -56,5 +56,6 @@ ] } }, - "minimum-stability": "stable" + "minimum-stability": "dev", + "prefer-stable": true } diff --git a/tests/SwedishEntityTest.php b/tests/SwedishEntityTest.php index 3d525c5..118f2a9 100644 --- a/tests/SwedishEntityTest.php +++ b/tests/SwedishEntityTest.php @@ -69,7 +69,7 @@ public function testPersonAttributes() $this->assertEquals(11, $person1->day); $this->assertEquals(817, $person1->num); $this->assertEquals(7, $person1->check); - $this->assertEquals(Carbon::now()->setYear('1960')->diffInYears(Carbon::now()), $person1->age); + $this->assertEquals(Carbon::now()->setYear('1960')->diffInYears(Carbon::now()->setYear('2021')), $person1->age); $this->assertEquals('Personnummer', $person1->type); $this->assertEquals('Apr-11', $person1->birthday->format('M-d')); $this->assertEquals('male', $person1->gender);