@@ -82,23 +82,25 @@ public function handle(Context $context): ?ResponseInterface
8282
8383 if ($ asyncResult !== null ) {
8484 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+ );
8991 } else {
9092 $ context = $ context ->forModel ([$ this ->asyncCollection ], $ asyncResult );
9193
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+ );
102104 }
103105
104106 return $ response ->withStatus (202 );
0 commit comments