diff --git a/.scrutinizer.yml b/.scrutinizer.yml index 7432349f..4cae65ad 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -7,14 +7,11 @@ build: version: 7.3.0 dependencies: before: - - sudo composer self-update - - mysql -e 'create database translatable_test;' - - echo "CREATE USER 'homestead'@'localhost' IDENTIFIED BY 'secret'; \n GRANT ALL PRIVILEGES ON * . * TO 'homestead'@'localhost'; \nFLUSH PRIVILEGES; \n" | mysql -u root - - command: 'composer install --prefer-dist' - idle_timeout: 1200 + - mysql -e 'create database translatable_test;' + - echo "CREATE USER 'homestead'@'localhost' IDENTIFIED BY 'secret'; \n GRANT ALL PRIVILEGES ON * . * TO 'homestead'@'localhost'; \nFLUSH PRIVILEGES; \n" | mysql -u root tests: override: - - command: echo 1 + - command: echo 1 tools: external_code_coverage: diff --git a/composer.json b/composer.json index 4a04e4dd..eb431508 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,7 @@ }, "autoload": { "psr-4": { - "Dimsav\\Translatable\\": "src/Translatable/" + "Astrotomic\\Translatable\\": "src/Translatable/" } }, "autoload-dev": { @@ -40,7 +40,7 @@ "extra": { "laravel": { "providers": [ - "Dimsav\\Translatable\\TranslatableServiceProvider" + "Astrotomic\\Translatable\\TranslatableServiceProvider" ] } }, diff --git a/readme.md b/readme.md index 0cbc93f7..b6eb8f6f 100644 --- a/readme.md +++ b/readme.md @@ -2,13 +2,13 @@ Laravel-Translatable ==================== -[![Total Downloads](https://poser.pugx.org/dimsav/laravel-translatable/downloads.svg)](https://packagist.org/packages/dimsav/laravel-translatable) -[![Build Status](https://circleci.com/gh/dimsav/laravel-translatable.png?style=shield)](https://circleci.com/gh/dimsav/laravel-translatable) -[![Code Coverage](https://scrutinizer-ci.com/g/dimsav/laravel-translatable/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/dimsav/laravel-translatable/?branch=master) -[![Latest Stable Version](http://img.shields.io/packagist/v/dimsav/laravel-translatable.svg)](https://packagist.org/packages/dimsav/laravel-translatable) -[![License](https://poser.pugx.org/dimsav/laravel-translatable/license.svg)](https://packagist.org/packages/dimsav/laravel-translatable) -[![SensioLabsInsight](https://insight.sensiolabs.com/projects/c105358a-3211-47e8-b662-94aa98d1eeee/mini.png)](https://insight.sensiolabs.com/projects/c105358a-3211-47e8-b662-94aa98d1eeee) -[![StyleCI](https://styleci.io/repos/16480576/shield)](https://styleci.io/repos/16480576) +![Total Downloads](https://img.shields.io/packagist/dt/astrotomic/laravel-translatable.svg?style=flat-square) +![Build Status](https://img.shields.io/circleci/build/github/Astrotomic/laravel-translatable/master.svg?style=flat-square) +![Code Quality](https://img.shields.io/scrutinizer/quality/g/Astrotomic/laravel-translatable/master.svg?style=flat-square) +![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/Astrotomic/laravel-translatable/master.svg?style=flat-square) +[![Latest Version](http://img.shields.io/packagist/v/astrotomic/laravel-translatable.svg?style=flat-square)](https://packagist.org/packages/astrotomic/laravel-translatable) +![MIT License](https://img.shields.io/github/license/Astrotomic/laravel-translatable.svg?color=blue&style=flat-square) +[![StyleCI](https://styleci.io/repos/192333549/shield)](https://styleci.io/repos/192333549) ![Laravel Translatable](img/laravel-translatable.png) diff --git a/src/Translatable/Exception/LocalesNotDefinedException.php b/src/Translatable/Exception/LocalesNotDefinedException.php index 7812a308..7178028f 100644 --- a/src/Translatable/Exception/LocalesNotDefinedException.php +++ b/src/Translatable/Exception/LocalesNotDefinedException.php @@ -1,6 +1,6 @@ listen('eloquent*', function ($event, $models) use ($that) { - return get_class(reset($models)) == 'Dimsav\Translatable\Test\Model\Country' ? false : true; + return get_class(reset($models)) == 'Astrotomic\Translatable\Test\Model\Country' ? false : true; }); $country = Country::find(1); @@ -77,7 +77,7 @@ public function test_it_returns_false_if_does_not_exist_and_parent_save_returns_ $that = $this; $event = App::make('events'); $event->listen('eloquent*', function ($event, $models) use ($that) { - return get_class(reset($models)) == 'Dimsav\Translatable\Test\Model\Continent' ? false : true; + return get_class(reset($models)) == 'Astrotomic\Translatable\Test\Model\Continent' ? false : true; }); $continent = new Continent(); diff --git a/tests/TestsBase.php b/tests/TestsBase.php index a7da6057..a5aaa2c3 100644 --- a/tests/TestsBase.php +++ b/tests/TestsBase.php @@ -1,7 +1,7 @@ assertEquals( - 'Dimsav\Translatable\Test\Model\CountryTranslation', + 'Astrotomic\Translatable\Test\Model\CountryTranslation', $country->getTranslationModelNameDefault()); } @@ -31,7 +31,7 @@ public function test_it_finds_the_translation_class_with_suffix_set() App::make('config')->set('translatable.translation_suffix', 'Trans'); $country = new Country(); $this->assertEquals( - 'Dimsav\Translatable\Test\Model\CountryTrans', + 'Astrotomic\Translatable\Test\Model\CountryTrans', $country->getTranslationModelName()); } @@ -376,7 +376,7 @@ public function test_getting_translated_field_does_not_create_translation() public function test_if_locales_are_not_defined_throw_exception() { - $this->expectException(Dimsav\Translatable\Exception\LocalesNotDefinedException::class); + $this->expectException(Astrotomic\Translatable\Exception\LocalesNotDefinedException::class); $this->app->config->set('translatable.locales', []); $this->app->make('translatable.locales')->load(); @@ -754,12 +754,12 @@ public function test_numeric_translated_attribute() $this->app->config->set('translatable.fallback_locale', 'de'); $this->app->config->set('translatable.use_fallback', true); - $city = new class extends \Dimsav\Translatable\Test\Model\City { + $city = new class extends \Astrotomic\Translatable\Test\Model\City { protected $fillable = [ 'country_id', ]; protected $table = 'cities'; - public $translationModel = \Dimsav\Translatable\Test\Model\CityTranslation::class; + public $translationModel = \Astrotomic\Translatable\Test\Model\CityTranslation::class; public $translationForeignKey = 'city_id'; protected function isEmptyTranslatableAttribute(string $key, $value): bool diff --git a/tests/models/City.php b/tests/models/City.php index 9b5a9f9d..4ae80fae 100644 --- a/tests/models/City.php +++ b/tests/models/City.php @@ -1,8 +1,8 @@