Skip to content

Commit 046d87b

Browse files
Merge pull request #40 from ARCANEDEV/laravel_9_support
Adding Laravel 9 support
2 parents 6052efc + ab75eab commit 046d87b

15 files changed

+46
-67
lines changed

.github/workflows/run-tests.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
strategy:
1010
fail-fast: true
1111
matrix:
12-
php: [7.3, 7.4, 8.0]
12+
php: [8.0, 8.1]
1313
dependency-version: [prefer-lowest, prefer-stable]
1414

1515
name: PHP ${{ matrix.php }} - ${{ matrix.dependency-version }}
@@ -31,8 +31,8 @@ jobs:
3131
with:
3232
php-version: ${{ matrix.php }}
3333
extensions: curl, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, iconv
34-
coverage: xdebug
3534
tools: composer:v2
35+
coverage: pcov
3636

3737
- name: Install dependencies
3838
run: composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
@@ -42,7 +42,7 @@ jobs:
4242
mkdir -p build/logs
4343
vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover
4444
45-
- name: Scrutinizer CI
46-
run: |
47-
composer require scrutinizer/ocular --dev
48-
vendor/bin/ocular code-coverage:upload --format=php-clover coverage.clover
45+
# - name: Scrutinizer CI
46+
# run: |
47+
# composer require scrutinizer/ocular --dev
48+
# vendor/bin/ocular code-coverage:upload --format=php-clover coverage.clover

.scrutinizer.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ checks:
2121
tools:
2222
external_code_coverage:
2323
timeout: 600
24-
runs: 6
24+
runs: 4
2525
php_code_sniffer:
2626
enabled: true
2727
config:

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ If you discover any security related issues, please email arcanedev.maroc@gmail.
3030
- [All Contributors][link-contributors]
3131

3232
[badge_license]: http://img.shields.io/packagist/l/arcanedev/support.svg?style=flat-square
33-
[badge_laravel]: https://img.shields.io/badge/Laravel-5.1%20to%208.0-orange.svg?style=flat-square
33+
[badge_laravel]: https://img.shields.io/badge/Laravel-5.1%20to%209.x-orange.svg?style=flat-square
3434
[badge_build]: https://img.shields.io/github/workflow/status/ARCANEDEV/Support/run-tests?style=flat-square
3535
[badge_coverage]: https://img.shields.io/scrutinizer/coverage/g/ARCANEDEV/Support.svg?style=flat-square
3636
[badge_quality]: https://img.shields.io/scrutinizer/g/ARCANEDEV/Support.svg?style=flat-square

_docs/0-Home.md

-8
This file was deleted.

_docs/1-Requirements.md

-11
This file was deleted.

_docs/1.Installation-and-Setup.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
## Table of contents
2+
3+
1. [Installation and Setup](1.Installation-and-Setup.md)
4+
2. [Usage](2.Usage.md)
5+
6+
# 1. Installation
7+
8+
> WIP

_docs/2-Version-Compatibility.md

-14
This file was deleted.

_docs/2.Usage.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
## Table of contents
2+
3+
1. [Installation and Setup](1.Installation-and-Setup.md)
4+
2. [Usage](2.Usage.md)
5+
6+
# 2. Usage
7+
8+
> WIP

_docs/3-Installation-and-Setup.md

-1
This file was deleted.

_docs/4-Usage.md

-1
This file was deleted.

composer.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313
"type": "library",
1414
"license": "MIT",
1515
"require": {
16-
"php": "^7.3|^8.0",
17-
"illuminate/contracts": "^8.0",
18-
"illuminate/support": "^8.0"
16+
"php": "^8.0.2",
17+
"illuminate/contracts": "^9.0",
18+
"illuminate/support": "^9.0"
1919
},
2020
"require-dev": {
21-
"laravel/framework": "^8.19",
22-
"orchestra/testbench-core": "^6.4",
23-
"phpunit/phpunit": "^9.3.3"
21+
"laravel/framework": "^9.0",
22+
"orchestra/testbench-core": "^7.0",
23+
"phpunit/phpunit": "^9.5.8"
2424
},
2525
"autoload": {
2626
"psr-4": {
@@ -40,7 +40,7 @@
4040
},
4141
"extra": {
4242
"branch-alias": {
43-
"dev-develop": "8.x-dev"
43+
"dev-develop": "10.x-dev"
4444
}
4545
},
4646
"config": {

phpunit.xml.dist

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
</coverage>
2222
<php>
2323
<env name="APP_DEBUG" value="true"/>
24+
<env name="APP_KEY" value="AckfSECXIvnK5r28GVIWUAxmbBSjTsmF"/>
2425
<env name="DB_CONNECTION" value="testing"/>
2526
</php>
2627
</phpunit>

src/Providers/Concerns/HasTranslations.php

+13-9
Original file line numberDiff line numberDiff line change
@@ -17,29 +17,33 @@ trait HasTranslations
1717
*/
1818

1919
/**
20-
* Get the translations path.
21-
*
22-
* @return string
20+
* Get the translations' folder name.
21+
*/
22+
protected function getTranslationsFolderName(): string
23+
{
24+
return 'translations';
25+
}
26+
27+
/**
28+
* Get the translations' path.
2329
*/
2430
protected function getTranslationsPath(): string
2531
{
26-
return $this->getBasePath().DIRECTORY_SEPARATOR.'translations';
32+
return $this->getBasePath().DIRECTORY_SEPARATOR.$this->getTranslationsFolderName();
2733
}
2834

2935
/**
3036
* Get the destination views path.
31-
*
32-
* @return string
3337
*/
3438
protected function getTranslationsDestinationPath(): string
3539
{
36-
return $this->app['path.lang'].DIRECTORY_SEPARATOR.'vendor'.DIRECTORY_SEPARATOR.$this->getPackageName();
40+
return $this->app->langPath(
41+
'vendor'.DIRECTORY_SEPARATOR.$this->getPackageName()
42+
);
3743
}
3844

3945
/**
4046
* Publish the translations.
41-
*
42-
* @param string|null $path
4347
*/
4448
protected function publishTranslations(?string $path = null): void
4549
{

tests/Providers/PackageServiceProviderTest.php

-7
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,6 @@ public function setUp(): void
3737
$this->provider->register();
3838
}
3939

40-
public function tearDown(): void
41-
{
42-
unset($this->provider);
43-
44-
parent::tearDown();
45-
}
46-
4740
/* -----------------------------------------------------------------
4841
| Tests
4942
| -----------------------------------------------------------------

tests/Stubs/PagesRoutes.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function bindings(): void
2727

2828
public function map(): void
2929
{
30-
$this->name('public::')->middleware('bindings')->group(function () {
30+
$this->name('public::')->middleware('web')->group(function () {
3131
$this->get('/', function () {
3232
return 'Welcome';
3333
})->name('index'); // public::index

0 commit comments

Comments
 (0)