Skip to content

Commit 36aa74e

Browse files
committed
feat: warning PHP
1 parent 5001b38 commit 36aa74e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

templates/php/src/Client.php.twig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,13 @@ class Client
176176
$responseBody = curl_exec($ch);
177177
$contentType = $responseHeaders['content-type'] ?? '';
178178
$responseStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE);
179+
180+
$warnings = $responseHeaders['x-{{spec.title | caseLower}}-warning'] ?? '';
181+
if ($warnings) {
182+
foreach(explode(';', $warnings) as $warning) {
183+
trigger_error($warning, E_USER_WARNING);
184+
}
185+
}
179186
180187
switch(substr($contentType, 0, strpos($contentType, ';'))) {
181188
case 'application/json':

0 commit comments

Comments
 (0)