File tree Expand file tree Collapse file tree 4 files changed +15
-15
lines changed Expand file tree Collapse file tree 4 files changed +15
-15
lines changed Original file line number Diff line number Diff line change 22
33declare (strict_types=1 );
44
5- namespace DragonCode \LaravelHttpMacros \Macroses ;
5+ namespace DragonCode \LaravelHttpMacros \Macros ;
66
77use Closure ;
88
99/** @mixin \Illuminate\Http\Client\Response */
10- abstract class Macros
10+ abstract class Macro
1111{
1212 abstract public static function callback (): Closure ;
1313
Original file line number Diff line number Diff line change 22
33declare (strict_types=1 );
44
5- namespace DragonCode \LaravelHttpMacros \Macroses ;
5+ namespace DragonCode \LaravelHttpMacros \Macros ;
66
77use Closure ;
88use Illuminate \Support \Collection ;
99
1010/**
1111 * Get the JSON decoded body of the response as a collection.
1212 */
13- class ToDataCollectionMacros extends Macros
13+ class ToDataCollectionMacro extends Macro
1414{
1515 public static function callback (): Closure
1616 {
Original file line number Diff line number Diff line change 22
33declare (strict_types=1 );
44
5- namespace DragonCode \LaravelHttpMacros \Macroses ;
5+ namespace DragonCode \LaravelHttpMacros \Macros ;
66
77use Closure ;
88
99/**
1010 * Get the JSON decoded body of the response as a class instance.
1111 */
12- class ToDataMacros extends Macros
12+ class ToDataMacro extends Macro
1313{
1414 public static function callback (): Closure
1515 {
Original file line number Diff line number Diff line change 44
55namespace DragonCode \LaravelHttpMacros ;
66
7- use DragonCode \LaravelHttpMacros \Macroses \ Macros ;
8- use DragonCode \LaravelHttpMacros \Macroses \ ToDataCollectionMacros ;
9- use DragonCode \LaravelHttpMacros \Macroses \ ToDataMacros ;
7+ use DragonCode \LaravelHttpMacros \Macros \ Macro ;
8+ use DragonCode \LaravelHttpMacros \Macros \ ToDataCollectionMacro ;
9+ use DragonCode \LaravelHttpMacros \Macros \ ToDataMacro ;
1010use Illuminate \Http \Client \Response ;
1111use Illuminate \Support \ServiceProvider as BaseServiceProvider ;
1212
1313class ServiceProvider extends BaseServiceProvider
1414{
15- /** @var array<string|Macros > */
16- protected array $ macroses = [
17- ToDataMacros ::class,
18- ToDataCollectionMacros ::class,
15+ /** @var array<string|Macro > */
16+ protected array $ macros = [
17+ ToDataMacro ::class,
18+ ToDataCollectionMacro ::class,
1919 ];
2020
2121 public function boot (): void
2222 {
23- foreach ($ this ->macroses as $ macros ) {
23+ foreach ($ this ->macros as $ macros ) {
2424 $ this ->bootMacros ($ macros );
2525 }
2626 }
2727
28- protected function bootMacros (Macros |string $ macros ): void
28+ protected function bootMacros (Macro |string $ macros ): void
2929 {
3030 Response::macro ($ macros ::name (), $ macros ::callback ());
3131 }
You can’t perform that action at this time.
0 commit comments