Skip to content

Commit 1141ebb

Browse files
committed
Resolve PHPStan Errors
1 parent 7de4adc commit 1141ebb

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/AbstractProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ abstract class AbstractProvider implements ProviderInterface
5252
/**
5353
* Constructor.
5454
*
55-
* @param array|\ArrayAccess $options Provider options array.
55+
* @param mixed $options Provider options array.
5656
* @param HttpFactory $httpFactory The http factory
5757
*
5858
* @throws \InvalidArgumentException

src/Provider/OpenAIProvider.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Joomla\AI\Interface\ProviderInterface;
1717
use Joomla\AI\Interface\AudioInterface;
1818
use Joomla\AI\Interface\ChatInterface;
19+
use Joomla\AI\Interface\EmbeddingInterface;
1920
use Joomla\AI\Interface\ImageInterface;
2021
use Joomla\AI\Interface\ModelInterface;
2122
use Joomla\AI\Interface\ModerationInterface;
@@ -27,7 +28,7 @@
2728
*
2829
* @since __DEPLOY_VERSION__
2930
*/
30-
class OpenAIProvider extends AbstractProvider implements ProviderInterface, ChatInterface, ModelInterface, ImageInterface, AudioInterface, ModerationInterface
31+
class OpenAIProvider extends AbstractProvider implements ProviderInterface, ChatInterface, ModelInterface, ImageInterface, EmbeddingInterface, AudioInterface, ModerationInterface
3132
{
3233
/**
3334
* Custom base URL for API requests

src/Response/Response.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public function saveFile(string $filename)
101101
$ext = pathinfo($filename, PATHINFO_EXTENSION) ?: 'png';
102102

103103
$data = json_decode($content, true);
104-
if ($imageCount === 1 && is_string($content)) {
104+
if ($imageCount === 1) {
105105
$decodedContent = base64_decode($content);
106106
if (File::write($filename, $decodedContent)) {
107107
$savedFiles[] = $filename;
@@ -124,7 +124,7 @@ public function saveFile(string $filename)
124124
$data = json_decode($content, true);
125125

126126
$lines = [];
127-
if ($imageCount === 1 && is_string($content)) {
127+
if ($imageCount === 1) {
128128
$lines[] = " Image URL: " . $content;
129129
} elseif (is_array($data)) {
130130
foreach ($data as $index => $url) {
@@ -150,7 +150,7 @@ public function saveFile(string $filename)
150150
}
151151

152152
// For all other content
153-
if ($content !== null) {
153+
if ($content !== '') {
154154
if (File::write($filename, $content)) {
155155
return [$filename];
156156
}

0 commit comments

Comments
 (0)