From 4730db4955d8853c455ce1bc25c0001088b95bf5 Mon Sep 17 00:00:00 2001 From: Gummibeer Date: Fri, 23 Aug 2019 11:31:47 +0200 Subject: [PATCH 1/6] add laravel 6-dev --- .circleci/config.yml | 27 ++++++++++++++++++++++++++- composer.json | 9 +++++---- tests/TestsBase.php | 2 +- 3 files changed, 32 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2438d00d..0e886dbf 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -183,11 +183,36 @@ jobs: MYSQL_ALLOW_EMPTY_PASSWORD: true <<: *defaults + build-php72-laravel6: + docker: + - image: 'circleci/php:7.2' + environment: + LARAVEL_VERSION: '^6.0@dev' + - image: 'circleci/mysql:5.7' + command: 'mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_bin --innodb-large-prefix=true --innodb-file-format=Barracuda' + environment: + MYSQL_USER: 'root' + MYSQL_ALLOW_EMPTY_PASSWORD: true + <<: *defaults + + build-php73-laravel6: + docker: + - image: 'circleci/php:7.2' + environment: + LARAVEL_VERSION: '^6.0@dev' + - image: 'circleci/mysql:5.7' + command: 'mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_bin --innodb-large-prefix=true --innodb-file-format=Barracuda' + environment: + MYSQL_USER: 'root' + MYSQL_ALLOW_EMPTY_PASSWORD: true + <<: *defaults + workflows: version: 2 build_all: jobs: - - build-php73-laravel58 + - build-php73-laravel6 + - build-php72-laravel6 - build-php72-laravel58 - build-php72-laravel57 - build-php72-laravel56 diff --git a/composer.json b/composer.json index f7003fb2..c30d5d1a 100644 --- a/composer.json +++ b/composer.json @@ -22,12 +22,13 @@ }, "require": { "php": ">=7.1.3", - "illuminate/contracts": "5.6.*|5.7.*|5.8.*", - "illuminate/database": "5.6.*|5.7.*|5.8.*", - "illuminate/support": "5.6.*|5.7.*|5.8.*" + "illuminate/contracts": "5.6.*|5.7.*|5.8.*|^6.0@dev", + "illuminate/database": "5.6.*|5.7.*|5.8.*|^6.0@dev", + "illuminate/support": "5.6.*|5.7.*|5.8.*|^6.0@dev" }, "require-dev": { - "orchestra/testbench": "3.6.*|3.7.*|3.8.*" + "orchestra/testbench": "3.6.*|3.7.*|3.8.*|^4.0@dev", + "orchestra/testbench-core": "3.6.*|3.7.*|3.8.*|^4.0@dev" }, "autoload": { "psr-4": { diff --git a/tests/TestsBase.php b/tests/TestsBase.php index f2116d19..4893c5c0 100644 --- a/tests/TestsBase.php +++ b/tests/TestsBase.php @@ -4,7 +4,7 @@ use Illuminate\Contracts\Console\Kernel; use Astrotomic\Translatable\TranslatableServiceProvider; -class TestsBase extends TestCase +abstract class TestsBase extends TestCase { protected $queriesCount; protected static $db2Setup = false; From be178129d3cc3c675515b80450c0767332cdcf57 Mon Sep 17 00:00:00 2001 From: Gummibeer Date: Wed, 4 Sep 2019 00:02:45 +0200 Subject: [PATCH 2/6] make tests final --- tests/LocalesTest.php | 2 +- tests/ScopesTest.php | 2 +- tests/TestCoreModelExtension.php | 2 +- tests/TranslatableTest.php | 2 +- tests/ValidationTest.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/LocalesTest.php b/tests/LocalesTest.php index 9d66c5da..a3cf4ef1 100644 --- a/tests/LocalesTest.php +++ b/tests/LocalesTest.php @@ -2,7 +2,7 @@ use Astrotomic\Translatable\Locales; -class LocalesTest extends TestsBase +final class LocalesTest extends TestsBase { public function test_singleton() { diff --git a/tests/ScopesTest.php b/tests/ScopesTest.php index a2f5f6e6..840b1a44 100644 --- a/tests/ScopesTest.php +++ b/tests/ScopesTest.php @@ -3,7 +3,7 @@ use Astrotomic\Translatable\Test\Model\Country; use Astrotomic\Translatable\Test\Model\Vegetable; -class ScopesTest extends TestsBase +final class ScopesTest extends TestsBase { public function test_translated_in_scope_returns_only_translated_records_for_this_locale() { diff --git a/tests/TestCoreModelExtension.php b/tests/TestCoreModelExtension.php index 504cd258..f5473214 100644 --- a/tests/TestCoreModelExtension.php +++ b/tests/TestCoreModelExtension.php @@ -11,7 +11,7 @@ use Astrotomic\Translatable\Test\Model\CityTranslation; use Astrotomic\Translatable\Test\Model\CountryTranslation; -class TestCoreModelExtension extends TestsBase +final class TestCoreModelExtension extends TestsBase { // Saving diff --git a/tests/TranslatableTest.php b/tests/TranslatableTest.php index 9eb5848b..cecc1341 100644 --- a/tests/TranslatableTest.php +++ b/tests/TranslatableTest.php @@ -9,7 +9,7 @@ use Astrotomic\Translatable\Test\Model\CountryWithCustomLocaleKey; use Astrotomic\Translatable\Test\Model\CountryWithCustomTranslationModel; -class TranslatableTest extends TestsBase +final class TranslatableTest extends TestsBase { public function test_it_finds_the_default_translation_class() { diff --git a/tests/ValidationTest.php b/tests/ValidationTest.php index 102e96db..5c63ced6 100644 --- a/tests/ValidationTest.php +++ b/tests/ValidationTest.php @@ -3,7 +3,7 @@ use Astrotomic\Translatable\Locales; use Astrotomic\Translatable\Validation\RuleFactory; -class ValidationTest extends TestsBase +final class ValidationTest extends TestsBase { public function test_it_does_not_touch_untranslated_keys() { From ef1f4c0d5d9ac542466f85c5f64cc9f83eaf38df Mon Sep 17 00:00:00 2001 From: Gummibeer Date: Wed, 4 Sep 2019 00:03:10 +0200 Subject: [PATCH 3/6] sort cirlce ci builds --- .circleci/config.yml | 48 ++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0e886dbf..22ff0c78 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -75,6 +75,30 @@ jobs: MYSQL_ALLOW_EMPTY_PASSWORD: true <<: *defaults + build-php73-laravel6: + docker: + - image: 'circleci/php:7.2' + environment: + LARAVEL_VERSION: '^6.0' + - image: 'circleci/mysql:5.7' + command: 'mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_bin --innodb-large-prefix=true --innodb-file-format=Barracuda' + environment: + MYSQL_USER: 'root' + MYSQL_ALLOW_EMPTY_PASSWORD: true + <<: *defaults + + build-php72-laravel6: + docker: + - image: 'circleci/php:7.2' + environment: + LARAVEL_VERSION: '^6.0' + - image: 'circleci/mysql:5.7' + command: 'mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_bin --innodb-large-prefix=true --innodb-file-format=Barracuda' + environment: + MYSQL_USER: 'root' + MYSQL_ALLOW_EMPTY_PASSWORD: true + <<: *defaults + build-php73-laravel58: docker: - image: 'circleci/php:7.3' @@ -183,30 +207,6 @@ jobs: MYSQL_ALLOW_EMPTY_PASSWORD: true <<: *defaults - build-php72-laravel6: - docker: - - image: 'circleci/php:7.2' - environment: - LARAVEL_VERSION: '^6.0@dev' - - image: 'circleci/mysql:5.7' - command: 'mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_bin --innodb-large-prefix=true --innodb-file-format=Barracuda' - environment: - MYSQL_USER: 'root' - MYSQL_ALLOW_EMPTY_PASSWORD: true - <<: *defaults - - build-php73-laravel6: - docker: - - image: 'circleci/php:7.2' - environment: - LARAVEL_VERSION: '^6.0@dev' - - image: 'circleci/mysql:5.7' - command: 'mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_bin --innodb-large-prefix=true --innodb-file-format=Barracuda' - environment: - MYSQL_USER: 'root' - MYSQL_ALLOW_EMPTY_PASSWORD: true - <<: *defaults - workflows: version: 2 build_all: From 3f9c5f4c461030ff815a4f1a47998f846262cc73 Mon Sep 17 00:00:00 2001 From: Gummibeer Date: Wed, 4 Sep 2019 00:03:28 +0200 Subject: [PATCH 4/6] remove dev dependencies --- composer.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index c30d5d1a..62bf32dc 100644 --- a/composer.json +++ b/composer.json @@ -22,13 +22,13 @@ }, "require": { "php": ">=7.1.3", - "illuminate/contracts": "5.6.*|5.7.*|5.8.*|^6.0@dev", - "illuminate/database": "5.6.*|5.7.*|5.8.*|^6.0@dev", - "illuminate/support": "5.6.*|5.7.*|5.8.*|^6.0@dev" + "illuminate/contracts": "5.6.*|5.7.*|5.8.*|^6.0", + "illuminate/database": "5.6.*|5.7.*|5.8.*|^6.0", + "illuminate/support": "5.6.*|5.7.*|5.8.*|^6.0" }, "require-dev": { - "orchestra/testbench": "3.6.*|3.7.*|3.8.*|^4.0@dev", - "orchestra/testbench-core": "3.6.*|3.7.*|3.8.*|^4.0@dev" + "orchestra/testbench": "3.6.*|3.7.*|3.8.*|^4.0", + "orchestra/testbench-core": "3.6.*|3.7.*|3.8.*|^4.0" }, "autoload": { "psr-4": { From ce9064a1b333815daa37c259946ebf1535c460f9 Mon Sep 17 00:00:00 2001 From: Gummibeer Date: Wed, 4 Sep 2019 00:04:43 +0200 Subject: [PATCH 5/6] normalize composer.json --- composer.json | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/composer.json b/composer.json index 62bf32dc..46686958 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,12 @@ { "name": "astrotomic/laravel-translatable", "description": "A Laravel package for multilingual models", - "keywords": ["laravel", "translation", "language", "database"], + "keywords": [ + "laravel", + "translation", + "language", + "database" + ], "license": "MIT", "authors": [ { @@ -17,18 +22,25 @@ "role": "Developer" } ], - "support": { - "issues": "https://github.com/Astrotomic/laravel-translatable/issues" - }, "require": { "php": ">=7.1.3", - "illuminate/contracts": "5.6.*|5.7.*|5.8.*|^6.0", - "illuminate/database": "5.6.*|5.7.*|5.8.*|^6.0", - "illuminate/support": "5.6.*|5.7.*|5.8.*|^6.0" + "illuminate/contracts": "5.6.* || 5.7.* || 5.8.* || ^6.0", + "illuminate/database": "5.6.* || 5.7.* || 5.8.* || ^6.0", + "illuminate/support": "5.6.* || 5.7.* || 5.8.* || ^6.0" }, "require-dev": { - "orchestra/testbench": "3.6.*|3.7.*|3.8.*|^4.0", - "orchestra/testbench-core": "3.6.*|3.7.*|3.8.*|^4.0" + "orchestra/testbench": "3.6.* || 3.7.* || 3.8.* || ^4.0", + "orchestra/testbench-core": "3.6.* || 3.7.* || 3.8.* || ^4.0" + }, + "config": { + "sort-packages": true + }, + "extra": { + "laravel": { + "providers": [ + "Astrotomic\\Translatable\\TranslatableServiceProvider" + ] + } }, "autoload": { "psr-4": { @@ -40,17 +52,10 @@ "tests" ] }, - "extra": { - "laravel": { - "providers": [ - "Astrotomic\\Translatable\\TranslatableServiceProvider" - ] - } - }, - "config": { - "sort-packages": true - }, "scripts": { "csfix": "php-cs-fixer fix --using-cache=no" + }, + "support": { + "issues": "https://github.com/Astrotomic/laravel-translatable/issues" } } From 0e7a49fd9cc1becb9d0985fced09035ddff719f9 Mon Sep 17 00:00:00 2001 From: Gummibeer Date: Wed, 4 Sep 2019 00:10:30 +0200 Subject: [PATCH 6/6] add missing links to composer support --- composer.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 46686958..3eab3ed5 100644 --- a/composer.json +++ b/composer.json @@ -56,6 +56,8 @@ "csfix": "php-cs-fixer fix --using-cache=no" }, "support": { - "issues": "https://github.com/Astrotomic/laravel-translatable/issues" + "issues": "https://github.com/Astrotomic/laravel-translatable/issues", + "source": "https://github.com/Astrotomic/laravel-translatable", + "docs": "https://docs.astrotomic.info/laravel-translatable" } }