@@ -82,23 +82,25 @@ public function handle(Context $context): ?ResponseInterface
82
82
83
83
if ($ asyncResult !== null ) {
84
84
if (is_string ($ asyncResult )) {
85
- $ response = $ context ->createResponse ($ this ->buildDocument ($ context ))->withHeader (
86
- 'Location ' ,
87
- $ context ->api ->basePath . '/ ' . ltrim ($ asyncResult , '/ ' ),
88
- );
85
+ $ response = $ context
86
+ ->createResponse ($ this ->buildDocument ($ context ))
87
+ ->withHeader (
88
+ 'Location ' ,
89
+ $ context ->api ->basePath . '/ ' . ltrim ($ asyncResult , '/ ' ),
90
+ );
89
91
} else {
90
92
$ context = $ context ->forModel ([$ this ->asyncCollection ], $ asyncResult );
91
93
92
- $ response = $ context-> createResponse (
93
- $ this ->buildResourceDocument ($ asyncResult , $ context ),
94
- ) ->withHeader (
95
- 'Content-Location ' ,
96
- implode ('/ ' , [
97
- $ context ->api ->basePath ,
98
- $ context ->collection ->name (),
99
- $ context ->id ($ context ->resource , $ asyncResult ),
100
- ]),
101
- );
94
+ $ response = $ context
95
+ -> createResponse ( $ this ->buildResourceDocument ($ asyncResult , $ context ))
96
+ ->withHeader (
97
+ 'Content-Location ' ,
98
+ implode ('/ ' , [
99
+ $ context ->api ->basePath ,
100
+ $ context ->collection ->name (),
101
+ $ context ->id ($ context ->resource , $ asyncResult ),
102
+ ]),
103
+ );
102
104
}
103
105
104
106
return $ response ->withStatus (202 );
0 commit comments