File tree Expand file tree Collapse file tree 3 files changed +26
-37
lines changed
Expand file tree Collapse file tree 3 files changed +26
-37
lines changed Original file line number Diff line number Diff line change 2626 "illuminate/console" : " ^7.13|^8.0" ,
2727 "illuminate/http" : " ^7.13|^8.0" ,
2828 "illuminate/support" : " ^7.13|^8.0" ,
29- "nesbot/carbon" : " ^2.35"
29+ "nesbot/carbon" : " ^2.35" ,
30+ "spatie/laravel-package-tools" : " ^1.1"
3031 },
3132 "require-dev" : {
3233 "laravel/framework" : " ^7.13|^8.0" ,
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" UTF-8" ?>
2- <phpunit bootstrap =" vendor/autoload.php"
3- backupGlobals =" false"
4- backupStaticAttributes =" false"
5- colors =" true"
6- verbose =" true"
7- convertErrorsToExceptions =" true"
8- convertNoticesToExceptions =" true"
9- convertWarningsToExceptions =" true"
10- processIsolation =" false"
11- stopOnFailure =" false" >
12- <testsuites >
13- <testsuite name =" League Test Suite" >
14- <directory >tests</directory >
15- </testsuite >
16- </testsuites >
17- <filter >
18- <whitelist >
19- <directory suffix =" .php" >src/</directory >
20- </whitelist >
21- </filter >
2+ <phpunit xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" bootstrap =" vendor/autoload.php" backupGlobals =" false" backupStaticAttributes =" false" colors =" true" verbose =" true" convertErrorsToExceptions =" true" convertNoticesToExceptions =" true" convertWarningsToExceptions =" true" processIsolation =" false" stopOnFailure =" false" xsi : noNamespaceSchemaLocation =" https://schema.phpunit.de/9.3/phpunit.xsd" >
3+ <coverage >
4+ <include >
5+ <directory suffix =" .php" >src/</directory >
6+ </include >
7+ </coverage >
8+ <testsuites >
9+ <testsuite name =" League Test Suite" >
10+ <directory >tests</directory >
11+ </testsuite >
12+ </testsuites >
2213</phpunit >
Original file line number Diff line number Diff line change 55use Illuminate \Cache \Repository ;
66use Illuminate \Container \Container ;
77use Illuminate \Support \ServiceProvider ;
8+ use Spatie \LaravelPackageTools \Package ;
9+ use Spatie \LaravelPackageTools \PackageServiceProvider ;
810use Spatie \ResponseCache \CacheProfiles \CacheProfile ;
911use Spatie \ResponseCache \Commands \ClearCommand ;
1012use Spatie \ResponseCache \Hasher \RequestHasher ;
1113use Spatie \ResponseCache \Serializers \Serializer ;
1214
13- class ResponseCacheServiceProvider extends ServiceProvider
15+ class ResponseCacheServiceProvider extends PackageServiceProvider
1416{
15- public function boot ()
17+ public function configurePackage ( Package $ package ): void
1618 {
17- $ this ->publishes ([
18- __DIR__ .'/../config/responsecache.php ' => config_path ('responsecache.php ' ),
19- ], 'config ' );
19+ $ package
20+ ->name ('laravel-responsecache ' )
21+ ->hasConfigFile ()
22+ ->hasCommands ([
23+ ClearCommand::class,
24+ ]);
25+ }
2026
27+ public function packageBooted ()
28+ {
2129 $ this ->app ->bind (CacheProfile::class, function (Container $ app ) {
2230 return $ app ->make (config ('responsecache.cache_profile ' ));
2331 });
@@ -42,16 +50,5 @@ public function boot()
4250 });
4351
4452 $ this ->app ->singleton ('responsecache ' , ResponseCache::class);
45-
46- if ($ this ->app ->runningInConsole ()) {
47- $ this ->commands ([
48- ClearCommand::class,
49- ]);
50- }
51- }
52-
53- public function register ()
54- {
55- $ this ->mergeConfigFrom (__DIR__ .'/../config/responsecache.php ' , 'responsecache ' );
5653 }
5754}
You can’t perform that action at this time.
0 commit comments