File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -35,29 +35,40 @@ You can also redefine macro names using an associative array. For example:
35
35
// Config
36
36
return [
37
37
'macros' => [
38
+ 'request' => [
39
+ WithLoggerMacro::class,
40
+ ],
38
41
'response' => [
39
42
ToDataMacro::class,
40
43
],
41
44
],
42
45
];
43
46
44
47
// Macro
48
+ Http::withLogger('some')->get();
49
+ Http::withLogger('some')->get()->toData(...);
45
50
Http::get()->toData(...);
46
51
```
47
-
48
52
``` php
49
53
// Config
50
54
return [
51
55
'macros' => [
56
+ 'request' => [
57
+ 'qwerty' => WithLoggerMacro::class,
58
+ ],
52
59
'response' => [
53
60
'qwerty' => ToDataMacro::class,
54
61
],
55
62
],
56
63
];
57
64
58
65
// Macro
66
+ Http::qwerty('some')->get();
67
+ Http::qwerty('some')->get()->qwerty(...);
68
+ Http::qwerty('some')->get()->toData(...); // method not found
69
+
59
70
Http::get()->qwerty(...);
60
- Http::get()->toData(...); // will be method not found exception
71
+ Http::get()->toData(...); // method not found
61
72
```
62
73
63
74
> Note
You can’t perform that action at this time.
0 commit comments