From 5c3e3416a33778171a002a1182834b4717a59bf2 Mon Sep 17 00:00:00 2001 From: ARCANEDEV Date: Fri, 26 Feb 2021 19:37:55 +0100 Subject: [PATCH 1/3] Preparing develop branch --- .github/workflows/run-tests.yml | 2 +- .scrutinizer.yml | 2 +- composer.json | 12 ++++++------ phpunit.xml.dist | 1 + tests/Stubs/PagesRoutes.php | 2 +- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 554946a..12435c6 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -9,7 +9,7 @@ jobs: strategy: fail-fast: true matrix: - php: [7.3, 7.4, 8.0] + php: [7.4, 8.0] dependency-version: [prefer-lowest, prefer-stable] name: PHP ${{ matrix.php }} - ${{ matrix.dependency-version }} diff --git a/.scrutinizer.yml b/.scrutinizer.yml index 99369b6..3c0ca63 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -21,7 +21,7 @@ checks: tools: external_code_coverage: timeout: 600 - runs: 6 + runs: 4 php_code_sniffer: enabled: true config: diff --git a/composer.json b/composer.json index afe9b4f..de71425 100644 --- a/composer.json +++ b/composer.json @@ -13,13 +13,13 @@ "type": "library", "license": "MIT", "require": { - "php": "^7.3|^8.0", - "illuminate/contracts": "^8.0", - "illuminate/support": "^8.0" + "php": "^7.4|^8.0", + "illuminate/contracts": "^9.0", + "illuminate/support": "^9.0" }, "require-dev": { - "laravel/framework": "^8.19", - "orchestra/testbench-core": "^6.4", + "laravel/framework": "^9.0", + "orchestra/testbench-core": "^7.0", "phpunit/phpunit": "^9.3.3" }, "autoload": { @@ -40,7 +40,7 @@ }, "extra": { "branch-alias": { - "dev-develop": "8.x-dev" + "dev-develop": "9.x-dev" } }, "config": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 61fd5bd..6e67c91 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -21,6 +21,7 @@ + diff --git a/tests/Stubs/PagesRoutes.php b/tests/Stubs/PagesRoutes.php index 34e9848..08657c2 100644 --- a/tests/Stubs/PagesRoutes.php +++ b/tests/Stubs/PagesRoutes.php @@ -27,7 +27,7 @@ public function bindings(): void public function map(): void { - $this->name('public::')->middleware('bindings')->group(function () { + $this->name('public::')->middleware('web')->group(function () { $this->get('/', function () { return 'Welcome'; })->name('index'); // public::index From 2f8128d348a550d024a58fe5b0ceff522edc45bd Mon Sep 17 00:00:00 2001 From: ARCANEDEV Date: Thu, 10 Feb 2022 15:09:02 +0100 Subject: [PATCH 2/3] Adding Laravel 9 Support --- .github/workflows/run-tests.yml | 4 ++-- README.md | 2 +- _docs/0-Home.md | 8 ------- _docs/1-Requirements.md | 11 ---------- _docs/1.Installation-and-Setup.md | 8 +++++++ _docs/2-Version-Compatibility.md | 14 ------------ _docs/2.Usage.md | 8 +++++++ _docs/3-Installation-and-Setup.md | 1 - _docs/4-Usage.md | 1 - composer.json | 6 ++--- src/Providers/Concerns/HasTranslations.php | 22 +++++++++++-------- .../Providers/PackageServiceProviderTest.php | 7 ------ 12 files changed, 35 insertions(+), 57 deletions(-) delete mode 100644 _docs/0-Home.md delete mode 100644 _docs/1-Requirements.md create mode 100644 _docs/1.Installation-and-Setup.md delete mode 100644 _docs/2-Version-Compatibility.md create mode 100644 _docs/2.Usage.md delete mode 100644 _docs/3-Installation-and-Setup.md delete mode 100644 _docs/4-Usage.md diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 12435c6..87c9f67 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -9,7 +9,7 @@ jobs: strategy: fail-fast: true matrix: - php: [7.4, 8.0] + php: [8.0, 8.1] dependency-version: [prefer-lowest, prefer-stable] name: PHP ${{ matrix.php }} - ${{ matrix.dependency-version }} @@ -31,8 +31,8 @@ jobs: with: php-version: ${{ matrix.php }} extensions: curl, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, iconv - coverage: xdebug tools: composer:v2 + coverage: pcov - name: Install dependencies run: composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction diff --git a/README.md b/README.md index ef01fa3..27be06f 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ If you discover any security related issues, please email arcanedev.maroc@gmail. - [All Contributors][link-contributors] [badge_license]: http://img.shields.io/packagist/l/arcanedev/support.svg?style=flat-square -[badge_laravel]: https://img.shields.io/badge/Laravel-5.1%20to%208.0-orange.svg?style=flat-square +[badge_laravel]: https://img.shields.io/badge/Laravel-5.1%20to%209.x-orange.svg?style=flat-square [badge_build]: https://img.shields.io/github/workflow/status/ARCANEDEV/Support/run-tests?style=flat-square [badge_coverage]: https://img.shields.io/scrutinizer/coverage/g/ARCANEDEV/Support.svg?style=flat-square [badge_quality]: https://img.shields.io/scrutinizer/g/ARCANEDEV/Support.svg?style=flat-square diff --git a/_docs/0-Home.md b/_docs/0-Home.md deleted file mode 100644 index 1c59d00..0000000 --- a/_docs/0-Home.md +++ /dev/null @@ -1,8 +0,0 @@ -# Support - -## Table of contents - - 1. [Requirements](1-Requirements.md) - 2. [Version Compatibility](2-Version-Compatibility.md) - 3. [Installation and Setup](3-Installation-and-Setup.md) - 4. [Usage](4-Usage.md) diff --git a/_docs/1-Requirements.md b/_docs/1-Requirements.md deleted file mode 100644 index 199bcea..0000000 --- a/_docs/1-Requirements.md +++ /dev/null @@ -1,11 +0,0 @@ -# 1. Requirements - - - PHP >= 5.6 - - ext-curl: * - - ext-json: * - -To use reCAPTCHA, you need to have a `site key` and a `secret key`. [Click here](https://www.google.com/recaptcha/admin) to setup a domain and get your keys. - -The `site key` is using for the widget and the `secret key` is used to validate the response we get from Google. - -For more details, check the [official documentation](https://developers.google.com/recaptcha/). diff --git a/_docs/1.Installation-and-Setup.md b/_docs/1.Installation-and-Setup.md new file mode 100644 index 0000000..806383c --- /dev/null +++ b/_docs/1.Installation-and-Setup.md @@ -0,0 +1,8 @@ +## Table of contents + +1. [Installation and Setup](1.Installation-and-Setup.md) +2. [Usage](2.Usage.md) + +# 1. Installation + +> WIP diff --git a/_docs/2-Version-Compatibility.md b/_docs/2-Version-Compatibility.md deleted file mode 100644 index 003af07..0000000 --- a/_docs/2-Version-Compatibility.md +++ /dev/null @@ -1,14 +0,0 @@ -# 2. Version Compatibility - -| Support | Laravel | -|:-----------------------------|:---------------------------------------------------------------------------------------| -| ![support v3.x][support_3_x] | ![Laravel v5.1][laravel_5_1] ![Laravel v5.2][laravel_5_2] ![Laravel v5.3][laravel_5_3] | -| ![support v4.x][support_4_x] | ![Laravel v5.4][laravel_5_4] | - -[laravel_5_1]: https://img.shields.io/badge/v5.1-supported-brightgreen.svg?style=flat-square "Laravel v5.1" -[laravel_5_2]: https://img.shields.io/badge/v5.2-supported-brightgreen.svg?style=flat-square "Laravel v5.2" -[laravel_5_3]: https://img.shields.io/badge/v5.3-supported-brightgreen.svg?style=flat-square "Laravel v5.3" -[laravel_5_4]: https://img.shields.io/badge/v5.4-supported-brightgreen.svg?style=flat-square "Laravel v5.4" - -[support_3_x]: https://img.shields.io/badge/version-3.*-blue.svg?style=flat-square "Support v3.*" -[support_4_x]: https://img.shields.io/badge/version-4.*-blue.svg?style=flat-square "Support v4.*" diff --git a/_docs/2.Usage.md b/_docs/2.Usage.md new file mode 100644 index 0000000..ee386f6 --- /dev/null +++ b/_docs/2.Usage.md @@ -0,0 +1,8 @@ +## Table of contents + +1. [Installation and Setup](1.Installation-and-Setup.md) +2. [Usage](2.Usage.md) + +# 2. Usage + +> WIP diff --git a/_docs/3-Installation-and-Setup.md b/_docs/3-Installation-and-Setup.md deleted file mode 100644 index 5f0dbda..0000000 --- a/_docs/3-Installation-and-Setup.md +++ /dev/null @@ -1 +0,0 @@ -# 3. Installation diff --git a/_docs/4-Usage.md b/_docs/4-Usage.md deleted file mode 100644 index 688a32b..0000000 --- a/_docs/4-Usage.md +++ /dev/null @@ -1 +0,0 @@ -# 4. Usage diff --git a/composer.json b/composer.json index de71425..3734906 100644 --- a/composer.json +++ b/composer.json @@ -13,14 +13,14 @@ "type": "library", "license": "MIT", "require": { - "php": "^7.4|^8.0", + "php": "^8.0.2", "illuminate/contracts": "^9.0", "illuminate/support": "^9.0" }, "require-dev": { "laravel/framework": "^9.0", "orchestra/testbench-core": "^7.0", - "phpunit/phpunit": "^9.3.3" + "phpunit/phpunit": "^9.5.8" }, "autoload": { "psr-4": { @@ -40,7 +40,7 @@ }, "extra": { "branch-alias": { - "dev-develop": "9.x-dev" + "dev-develop": "10.x-dev" } }, "config": { diff --git a/src/Providers/Concerns/HasTranslations.php b/src/Providers/Concerns/HasTranslations.php index 41a29ba..78f98d4 100644 --- a/src/Providers/Concerns/HasTranslations.php +++ b/src/Providers/Concerns/HasTranslations.php @@ -17,29 +17,33 @@ trait HasTranslations */ /** - * Get the translations path. - * - * @return string + * Get the translations' folder name. + */ + protected function getTranslationsFolderName(): string + { + return 'translations'; + } + + /** + * Get the translations' path. */ protected function getTranslationsPath(): string { - return $this->getBasePath().DIRECTORY_SEPARATOR.'translations'; + return $this->getBasePath().DIRECTORY_SEPARATOR.$this->getTranslationsFolderName(); } /** * Get the destination views path. - * - * @return string */ protected function getTranslationsDestinationPath(): string { - return $this->app['path.lang'].DIRECTORY_SEPARATOR.'vendor'.DIRECTORY_SEPARATOR.$this->getPackageName(); + return $this->app->langPath( + 'vendor'.DIRECTORY_SEPARATOR.$this->getPackageName() + ); } /** * Publish the translations. - * - * @param string|null $path */ protected function publishTranslations(?string $path = null): void { diff --git a/tests/Providers/PackageServiceProviderTest.php b/tests/Providers/PackageServiceProviderTest.php index 20938d0..6ebe594 100644 --- a/tests/Providers/PackageServiceProviderTest.php +++ b/tests/Providers/PackageServiceProviderTest.php @@ -37,13 +37,6 @@ public function setUp(): void $this->provider->register(); } - public function tearDown(): void - { - unset($this->provider); - - parent::tearDown(); - } - /* ----------------------------------------------------------------- | Tests | ----------------------------------------------------------------- From ab75eab966194b2deb3ccb303d9e56014cfa243b Mon Sep 17 00:00:00 2001 From: ARCANEDEV Date: Thu, 10 Feb 2022 20:51:46 +0100 Subject: [PATCH 3/3] Disable temporarily Scrutinizer CI --- .github/workflows/run-tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 87c9f67..41744f5 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -42,7 +42,7 @@ jobs: mkdir -p build/logs vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover - - name: Scrutinizer CI - run: | - composer require scrutinizer/ocular --dev - vendor/bin/ocular code-coverage:upload --format=php-clover coverage.clover +# - name: Scrutinizer CI +# run: | +# composer require scrutinizer/ocular --dev +# vendor/bin/ocular code-coverage:upload --format=php-clover coverage.clover