Skip to content

Commit 7f2cfd5

Browse files
Merge pull request #12 from TheDragonCode/1.x
Added information about requests to the configuration section
2 parents c5c4c31 + 828c867 commit 7f2cfd5

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,29 +35,40 @@ You can also redefine macro names using an associative array. For example:
3535
// Config
3636
return [
3737
'macros' => [
38+
'request' => [
39+
WithLoggerMacro::class,
40+
],
3841
'response' => [
3942
ToDataMacro::class,
4043
],
4144
],
4245
];
4346

4447
// Macro
48+
Http::withLogger('some')->get();
49+
Http::withLogger('some')->get()->toData(...);
4550
Http::get()->toData(...);
4651
```
47-
4852
```php
4953
// Config
5054
return [
5155
'macros' => [
56+
'request' => [
57+
'qwerty' => WithLoggerMacro::class,
58+
],
5259
'response' => [
5360
'qwerty' => ToDataMacro::class,
5461
],
5562
],
5663
];
5764

5865
// Macro
66+
Http::qwerty('some')->get();
67+
Http::qwerty('some')->get()->qwerty(...);
68+
Http::qwerty('some')->get()->toData(...); // method not found
69+
5970
Http::get()->qwerty(...);
60-
Http::get()->toData(...); // will be method not found exception
71+
Http::get()->toData(...); // method not found
6172
```
6273

6374
> Note

0 commit comments

Comments
 (0)