Skip to content

Commit

Permalink
Merge pull request #40 from ARCANEDEV/laravel_9_support
Browse files Browse the repository at this point in the history
Adding Laravel 9 support
  • Loading branch information
arcanedev-maroc authored Feb 10, 2022
2 parents 6052efc + ab75eab commit 046d87b
Show file tree
Hide file tree
Showing 15 changed files with 46 additions and 67 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [7.3, 7.4, 8.0]
php: [8.0, 8.1]
dependency-version: [prefer-lowest, prefer-stable]

name: PHP ${{ matrix.php }} - ${{ matrix.dependency-version }}
Expand All @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ checks:
tools:
external_code_coverage:
timeout: 600
runs: 6
runs: 4
php_code_sniffer:
enabled: true
config:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 0 additions & 8 deletions _docs/0-Home.md

This file was deleted.

11 changes: 0 additions & 11 deletions _docs/1-Requirements.md

This file was deleted.

8 changes: 8 additions & 0 deletions _docs/1.Installation-and-Setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## Table of contents

1. [Installation and Setup](1.Installation-and-Setup.md)
2. [Usage](2.Usage.md)

# 1. Installation

> WIP
14 changes: 0 additions & 14 deletions _docs/2-Version-Compatibility.md

This file was deleted.

8 changes: 8 additions & 0 deletions _docs/2.Usage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## Table of contents

1. [Installation and Setup](1.Installation-and-Setup.md)
2. [Usage](2.Usage.md)

# 2. Usage

> WIP
1 change: 0 additions & 1 deletion _docs/3-Installation-and-Setup.md

This file was deleted.

1 change: 0 additions & 1 deletion _docs/4-Usage.md

This file was deleted.

14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
"type": "library",
"license": "MIT",
"require": {
"php": "^7.3|^8.0",
"illuminate/contracts": "^8.0",
"illuminate/support": "^8.0"
"php": "^8.0.2",
"illuminate/contracts": "^9.0",
"illuminate/support": "^9.0"
},
"require-dev": {
"laravel/framework": "^8.19",
"orchestra/testbench-core": "^6.4",
"phpunit/phpunit": "^9.3.3"
"laravel/framework": "^9.0",
"orchestra/testbench-core": "^7.0",
"phpunit/phpunit": "^9.5.8"
},
"autoload": {
"psr-4": {
Expand All @@ -40,7 +40,7 @@
},
"extra": {
"branch-alias": {
"dev-develop": "8.x-dev"
"dev-develop": "10.x-dev"
}
},
"config": {
Expand Down
1 change: 1 addition & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
</coverage>
<php>
<env name="APP_DEBUG" value="true"/>
<env name="APP_KEY" value="AckfSECXIvnK5r28GVIWUAxmbBSjTsmF"/>
<env name="DB_CONNECTION" value="testing"/>
</php>
</phpunit>
22 changes: 13 additions & 9 deletions src/Providers/Concerns/HasTranslations.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
7 changes: 0 additions & 7 deletions tests/Providers/PackageServiceProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,6 @@ public function setUp(): void
$this->provider->register();
}

public function tearDown(): void
{
unset($this->provider);

parent::tearDown();
}

/* -----------------------------------------------------------------
| Tests
| -----------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion tests/Stubs/PagesRoutes.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 046d87b

Please sign in to comment.