Skip to content

Commit 971b3f8

Browse files
Merge pull request #37 from ARCANEDEV/develop
Starting Laravel 8 support
2 parents dc29d1c + f46ae69 commit 971b3f8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+50
-106
lines changed

.github/workflows/run-tests.yml

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

1515
name: PHP ${{ matrix.php }} - ${{ matrix.dependency-version }}
1616

1717
steps:
1818
- name: Checkout code
19-
uses: actions/checkout@v1
19+
uses: actions/checkout@v2
2020

2121
- name: Cache dependencies
22-
uses: actions/cache@v1
22+
uses: actions/cache@v2
2323
with:
2424
path: ~/.composer/cache/files
25-
key: dependencies-laravel-7.x-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
25+
key: dependencies-laravel-8-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
2626

2727
- name: Setup PHP
2828
uses: shivammathur/setup-php@v2

.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:

LICENSE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2015-2019 | ARCANEDEV <arcanedev.maroc@gmail.com> - Support
3+
Copyright (c) 2015-2020 | ARCANEDEV <arcanedev.maroc@gmail.com> - Support
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

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%207.0-orange.svg?style=flat-square
33+
[badge_laravel]: https://img.shields.io/badge/Laravel-5.1%20to%208.0-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

composer.json

+12-6
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,12 @@
1313
"type": "library",
1414
"license": "MIT",
1515
"require": {
16-
"php": "^7.2.5",
17-
"illuminate/filesystem": "^7.0",
18-
"illuminate/support": "^7.0"
16+
"php": "^7.3",
17+
"laravel/framework": "^8.0"
1918
},
2019
"require-dev": {
21-
"orchestra/testbench": "^5.0",
22-
"phpunit/phpunit": "^8.0|^9.0"
20+
"orchestra/testbench": "^6.0",
21+
"phpunit/phpunit": "^9.3"
2322
},
2423
"autoload": {
2524
"psr-4": {
@@ -32,11 +31,18 @@
3231
"Arcanedev\\Support\\Tests\\": "tests/"
3332
}
3433
},
34+
"scripts": {
35+
"test": "phpunit",
36+
"coverage": "phpunit --coverage-html build/coverage/html"
37+
},
3538
"extra": {
3639
"branch-alias": {
37-
"dev-master": "7.x-dev"
40+
"dev-develop": "8.x-dev"
3841
}
3942
},
43+
"config": {
44+
"sort-packages": true
45+
},
4046
"minimum-stability": "dev",
4147
"prefer-stable": true
4248
}

phpunit.xml.dist

+14-20
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,26 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit backupGlobals="false"
3-
backupStaticAttributes="false"
4-
beStrictAboutTestsThatDoNotTestAnything="false"
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
54
bootstrap="vendor/autoload.php"
65
colors="true"
7-
convertErrorsToExceptions="true"
8-
convertNoticesToExceptions="true"
9-
convertWarningsToExceptions="true"
10-
processIsolation="false"
11-
stopOnFailure="false"
12-
verbose="true">
6+
>
137
<testsuites>
148
<testsuite name="Package Test Suite">
15-
<directory suffix=".php">./tests/</directory>
9+
<directory suffix=".php">./tests</directory>
1610
</testsuite>
1711
</testsuites>
18-
<filter>
19-
<whitelist>
20-
<directory suffix=".php">./src/</directory>
21-
</whitelist>
22-
</filter>
12+
<coverage processUncoveredFiles="true">
13+
<include>
14+
<directory suffix=".php">./src</directory>
15+
</include>
16+
<report>
17+
<clover outputFile="build/coverage/clover.xml"/>
18+
<html outputDirectory="build/coverage/html"/>
19+
<text outputFile="build/coverage/coverage.txt" showOnlySummary="true"/>
20+
</report>
21+
</coverage>
2322
<php>
2423
<env name="APP_DEBUG" value="true"/>
2524
<env name="DB_CONNECTION" value="testing"/>
2625
</php>
27-
<logging>
28-
<log type="coverage-clover" target="build/logs/clover.xml"/>
29-
<log type="coverage-text" target="build/logs/coverage.txt"/>
30-
<log type="coverage-html" target="build/logs/coverage"/>
31-
</logging>
3226
</phpunit>

src/Console/Command.php

+1-14
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
/**
1111
* Class Command
1212
*
13-
* @package Arcanedev\Support\Console
1413
* @author ARCANEDEV <arcanedev.maroc@gmail.com>
1514
*/
1615
abstract class Command extends IlluminateCommand
@@ -40,24 +39,12 @@ protected function tableSeparator()
4039
return new TableSeparator;
4140
}
4241

43-
/**
44-
* Display header.
45-
*
46-
* @param string $text
47-
*
48-
* @deprecated Use the frame($text) method instead.
49-
*/
50-
protected function header($text)
51-
{
52-
$this->frame($text);
53-
}
54-
5542
/**
5643
* Display frame the text info.
5744
*
5845
* @param string $text
5946
*/
60-
protected function frame($text)
47+
protected function frame(string $text)
6148
{
6249
$line = '+'.str_repeat('-', strlen($text) + 4).'+';
6350
$this->info($line);

src/Database/Migration.php

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
/**
1212
* Class Migration
1313
*
14-
* @package Arcanedev\Support\Database
1514
* @author ARCANEDEV <arcanedev.maroc@gmail.com>
1615
*/
1716
abstract class Migration extends IlluminateMigration

src/Database/PrefixedModel.php

+7-8
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
/**
1010
* Class PrefixedModel
1111
*
12-
* @package Arcanedev\Support\Database
1312
* @author ARCANEDEV <arcanedev.maroc@gmail.com>
1413
*/
1514
abstract class PrefixedModel extends Model
@@ -38,27 +37,27 @@ abstract class PrefixedModel extends Model
3837
*/
3938
public function getTable()
4039
{
41-
return $this->getPrefix() . parent::getTable();
40+
return $this->getPrefix().parent::getTable();
4241
}
4342

4443
/**
4544
* Get the prefix table associated with the model.
4645
*
47-
* @return null|string
46+
* @return string
4847
*/
49-
public function getPrefix()
48+
public function getPrefix(): string
5049
{
5150
return $this->isPrefixed() ? $this->prefix : '';
5251
}
5352

5453
/**
5554
* Set the prefix table associated with the model.
5655
*
57-
* @param string $prefix
56+
* @param string|null $prefix
5857
*
59-
* @return self
58+
* @return $this
6059
*/
61-
public function setPrefix($prefix)
60+
public function setPrefix(?string $prefix)
6261
{
6362
$this->prefix = $prefix;
6463

@@ -75,7 +74,7 @@ public function setPrefix($prefix)
7574
*
7675
* @return bool
7776
*/
78-
public function isPrefixed()
77+
public function isPrefixed(): bool
7978
{
8079
return ! is_null($this->prefix);
8180
}

src/Database/Seeder.php

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
/**
1111
* Class Seeder
1212
*
13-
* @package Arcanedev\Support\Database
1413
* @author ARCANEDEV <arcanedev.maroc@gmail.com>
1514
*/
1615
abstract class Seeder extends IlluminateSeeder

src/Exceptions/PackageException.php

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
/**
1010
* Class PackageException
1111
*
12-
* @package Arcanedev\Support\Exceptions
1312
* @author ARCANEDEV <arcanedev.maroc@gmail.com>
1413
*/
1514
class PackageException extends Exception

src/Middleware/VerifyJsonRequest.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@
55
namespace Arcanedev\Support\Middleware;
66

77
use Closure;
8-
use Illuminate\Http\{Request, Response};
8+
use Illuminate\Http\{JsonResponse, Request, Response};
99

1010
/**
1111
* Class VerifyJsonRequest
1212
*
13-
* @package Arcanedev\Support\Middleware
1413
* @author ARCANEDEV <arcanedev.maroc@gmail.com>
1514
*/
1615
class VerifyJsonRequest
@@ -21,6 +20,7 @@ class VerifyJsonRequest
2120
*/
2221

2322
/**
23+
* Supported request method verbs.
2424
*
2525
* @var array
2626
*/
@@ -57,8 +57,8 @@ public function handle(Request $request, Closure $next, $methods = null)
5757
/**
5858
* Validate json Request.
5959
*
60-
* @param Request $request
61-
* @param string|array|null $methods
60+
* @param \Illuminate\Http\Request $request
61+
* @param string|array|null $methods
6262
*
6363
* @return bool
6464
*/
@@ -91,7 +91,7 @@ protected function jsonErrorResponse()
9191
'message' => 'Request must be JSON',
9292
];
9393

94-
return response()->json($data, $statusCode);
94+
return new JsonResponse($data, $statusCode);
9595
}
9696

9797
/**

src/Providers/AuthorizationServiceProvider.php

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
/**
1111
* Class AuthorizationServiceProvider
1212
*
13-
* @package Arcanedev\Support\Providers
1413
* @author ARCANEDEV <arcanedev.maroc@gmail.com>
1514
*/
1615
abstract class AuthorizationServiceProvider extends AuthServiceProvider

src/Providers/CommandServiceProvider.php

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
/**
88
* Class CommandServiceProvider
99
*
10-
* @package Arcanedev\Support\Providers
1110
* @author ARCANEDEV <arcanedev.maroc@gmail.com>
1211
*/
1312
abstract class CommandServiceProvider extends ServiceProvider

src/Providers/Concerns/HasAssets.php

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
/**
88
* Trait HasAssets
99
*
10-
* @package Arcanedev\Support\Providers\Concerns
1110
* @author ARCANEDEV <arcanedev.maroc@gmail.com>
1211
*/
1312
trait HasAssets

src/Providers/Concerns/HasConfig.php

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
/**
1010
* Trait HasConfig
1111
*
12-
* @package Arcanedev\Support\Providers\Concerns
1312
* @author ARCANEDEV <arcanedev.maroc@gmail.com>
1413
*/
1514
trait HasConfig

src/Providers/Concerns/HasFactories.php

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
/**
88
* Trait HasFactories
99
*
10-
* @package Arcanedev\Support\Providers\Concerns
1110
* @author ARCANEDEV <arcanedev.maroc@gmail.com>
1211
*/
1312
trait HasFactories

src/Providers/Concerns/HasMigrations.php

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
/**
88
* Trait HasMigrations
99
*
10-
* @package Arcanedev\Support\Providers\Concerns
1110
* @author ARCANEDEV <arcanedev.maroc@gmail.com>
1211
*/
1312
trait HasMigrations

src/Providers/Concerns/HasTranslations.php

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
/**
88
* Trait HasTranslations
99
*
10-
* @package Arcanedev\Support\Providers\Concerns
1110
* @author ARCANEDEV <arcanedev.maroc@gmail.com>
1211
*/
1312
trait HasTranslations

src/Providers/Concerns/HasViews.php

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
/**
88
* Trait HasViews
99
*
10-
* @package Arcanedev\Support\Providers\Concerns
1110
* @author ARCANEDEV <arcanedev.maroc@gmail.com>
1211
*/
1312
trait HasViews

src/Providers/Concerns/InteractsWithApplication.php

-3
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@
77
/**
88
* Trait InteractsWithApplication
99
*
10-
* @package Arcanedev\Support\Providers\Concerns
1110
* @author ARCANEDEV <arcanedev.maroc@gmail.com>
12-
*
13-
* @property \Illuminate\Foundation\Application|mixed $app
1411
*/
1512
trait InteractsWithApplication
1613
{

src/Providers/EventServiceProvider.php

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
/**
1010
* Class EventServiceProvider
1111
*
12-
* @package Arcanedev\Support\Laravel\Providers
1312
* @author ARCANEDEV <arcanedev.maroc@gmail.com>
1413
*/
1514
abstract class EventServiceProvider extends ServiceProvider

src/Providers/PackageServiceProvider.php

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
/**
1616
* Class PackageServiceProvider
1717
*
18-
* @package Arcanedev\Support\Providers
1918
* @author ARCANEDEV <arcanedev.maroc@gmail.com>
2019
*/
2120
abstract class PackageServiceProvider extends ServiceProvider

src/Providers/RouteServiceProvider.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@
55
namespace Arcanedev\Support\Providers;
66

77
use Arcanedev\Support\Routing\Concerns\RegistersRouteClasses;
8-
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
8+
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as IlluminateServiceProvider;
99

1010
/**
1111
* Class RouteServiceProvider
1212
*
13-
* @package Arcanedev\Support\Laravel\Providers
1413
* @author ARCANEDEV <arcanedev.maroc@gmail.com>
1514
*/
16-
abstract class RouteServiceProvider extends ServiceProvider
15+
abstract class RouteServiceProvider extends IlluminateServiceProvider
1716
{
1817
/* -----------------------------------------------------------------
1918
| Traits

0 commit comments

Comments
 (0)