Skip to content

Commit cb985cc

Browse files
committed
fix: adds missing imports
1 parent b6890c8 commit cb985cc

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/Files/DTO/File.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
namespace WordPress\AiClient\Files\DTO;
66

7+
use InvalidArgumentException;
8+
use RuntimeException;
79
use WordPress\AiClient\Common\AbstractDataValueObject;
810
use WordPress\AiClient\Files\Enums\FileTypeEnum;
911
use WordPress\AiClient\Files\ValueObjects\MimeType;
@@ -406,7 +408,9 @@ public function toArray(): array
406408
} elseif (!$this->fileType->isRemote() && $this->base64Data !== null) {
407409
$data['base64Data'] = $this->base64Data;
408410
} else {
409-
throw new RuntimeException('File requires either url or base64Data. This should not be a possible condition.');
411+
throw new RuntimeException(
412+
'File requires either url or base64Data. This should not be a possible condition.'
413+
);
410414
}
411415

412416
return $data;

src/Messages/DTO/MessagePart.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,10 @@ public function toArray(): array
239239
} elseif ($this->functionResponse !== null) {
240240
$data['functionResponse'] = $this->functionResponse->toArray();
241241
} else {
242-
throw new RuntimeException('MessagePart requires one of: text, file, functionCall, or functionResponse. This should not be a possible condition.');
242+
throw new RuntimeException(
243+
'MessagePart requires one of: text, file, functionCall, or functionResponse. '
244+
. 'This should not be a possible condition.'
245+
);
243246
}
244247

245248
return $data;

0 commit comments

Comments
 (0)