Skip to content

Commit 5821bb2

Browse files
committed
chore: fixes doc formatting
1 parent 5414454 commit 5821bb2

21 files changed

+369
-289
lines changed

src/Common/Contracts/WithJsonSchema.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace WordPress\AiClient\Common\Contracts;
66

77
/**
8-
* Interface for objects that can provide their JSON schema representation
8+
* Interface for objects that can provide their JSON schema representation.
99
*
1010
* This interface is implemented by DTOs to provide a consistent way to retrieve
1111
* their JSON schema for validation and serialization purposes.
@@ -15,10 +15,11 @@
1515
interface WithJsonSchema
1616
{
1717
/**
18-
* Get the JSON schema representation of the object
18+
* Gets the JSON schema representation of the object.
1919
*
2020
* @since n.e.x.t
21-
* @return array<string, mixed> The JSON schema as an associative array
21+
*
22+
* @return array<string, mixed> The JSON schema as an associative array.
2223
*/
2324
public static function getJsonSchema(): array;
2425
}

src/Files/Contracts/FileInterface.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace WordPress\AiClient\Files\Contracts;
66

77
/**
8-
* Interface for file representations in the AI client
8+
* Interface for file representations in the AI client.
99
*
1010
* This interface defines the common contract for various file types that can be
1111
* used as input or output in AI operations.
@@ -15,10 +15,10 @@
1515
interface FileInterface
1616
{
1717
/**
18-
* Get the MIME type of the file
18+
* Gets the MIME type of the file.
1919
*
2020
* @since n.e.x.t
21-
* @return string The MIME type (e.g., 'image/png', 'audio/mp3')
21+
* @return string The MIME type (e.g., 'image/png', 'audio/mp3').
2222
*/
2323
public function getMimeType(): string;
2424
}

src/Files/DTO/InlineFile.php

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use WordPress\AiClient\Files\Contracts\FileInterface;
99

1010
/**
11-
* Represents a file with inline base64-encoded data
11+
* Represents a file with inline base64-encoded data.
1212
*
1313
* This DTO is used for files that are embedded directly in the request as base64 data,
1414
* commonly used for small files or when direct data transfer is preferred.
@@ -18,21 +18,22 @@
1818
class InlineFile implements FileInterface, WithJsonSchema
1919
{
2020
/**
21-
* @var string The MIME type of the file
21+
* @var string The MIME type of the file.
2222
*/
2323
private string $mimeType;
2424

2525
/**
26-
* @var string The base64-encoded file data
26+
* @var string The base64-encoded file data.
2727
*/
2828
private string $base64Data;
2929

3030
/**
31-
* Constructor
31+
* Constructor.
3232
*
3333
* @since n.e.x.t
34-
* @param string $mimeType The MIME type of the file
35-
* @param string $base64Data The base64-encoded file data
34+
*
35+
* @param string $mimeType The MIME type of the file.
36+
* @param string $base64Data The base64-encoded file data.
3637
*/
3738
public function __construct(string $mimeType, string $base64Data)
3839
{
@@ -41,21 +42,23 @@ public function __construct(string $mimeType, string $base64Data)
4142
}
4243

4344
/**
44-
* Get the MIME type of the file
45+
* Gets the MIME type of the file.
4546
*
4647
* @since n.e.x.t
47-
* @return string The MIME type
48+
*
49+
* @return string The MIME type.
4850
*/
4951
public function getMimeType(): string
5052
{
5153
return $this->mimeType;
5254
}
5355

5456
/**
55-
* Get the base64-encoded data
57+
* Gets the base64-encoded data.
5658
*
5759
* @since n.e.x.t
58-
* @return string The base64-encoded data
60+
*
61+
* @return string The base64-encoded data.
5962
*/
6063
public function getBase64Data(): string
6164
{
@@ -74,11 +77,11 @@ public static function getJsonSchema(): array
7477
'properties' => [
7578
'mimeType' => [
7679
'type' => 'string',
77-
'description' => 'The MIME type of the file',
80+
'description' => 'The MIME type of the file.',
7881
],
7982
'base64Data' => [
8083
'type' => 'string',
81-
'description' => 'The base64-encoded file data',
84+
'description' => 'The base64-encoded file data.',
8285
],
8386
],
8487
'required' => ['mimeType', 'base64Data'],

src/Files/DTO/LocalFile.php

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use WordPress\AiClient\Files\Contracts\FileInterface;
99

1010
/**
11-
* Represents a file stored locally on the filesystem
11+
* Represents a file stored locally on the filesystem.
1212
*
1313
* This DTO is used for files that are referenced by their local path,
1414
* typically used when working with files already present on the server.
@@ -18,21 +18,22 @@
1818
class LocalFile implements FileInterface, WithJsonSchema
1919
{
2020
/**
21-
* @var string The MIME type of the file
21+
* @var string The MIME type of the file.
2222
*/
2323
private string $mimeType;
2424

2525
/**
26-
* @var string The local filesystem path to the file
26+
* @var string The local filesystem path to the file.
2727
*/
2828
private string $path;
2929

3030
/**
31-
* Constructor
31+
* Constructor.
3232
*
3333
* @since n.e.x.t
34-
* @param string $mimeType The MIME type of the file
35-
* @param string $path The local filesystem path to the file
34+
*
35+
* @param string $mimeType The MIME type of the file.
36+
* @param string $path The local filesystem path to the file.
3637
*/
3738
public function __construct(string $mimeType, string $path)
3839
{
@@ -41,21 +42,23 @@ public function __construct(string $mimeType, string $path)
4142
}
4243

4344
/**
44-
* Get the MIME type of the file
45+
* Gets the MIME type of the file.
4546
*
4647
* @since n.e.x.t
47-
* @return string The MIME type
48+
*
49+
* @return string The MIME type.
4850
*/
4951
public function getMimeType(): string
5052
{
5153
return $this->mimeType;
5254
}
5355

5456
/**
55-
* Get the local filesystem path
57+
* Gets the local filesystem path.
5658
*
5759
* @since n.e.x.t
58-
* @return string The local path
60+
*
61+
* @return string The local path.
5962
*/
6063
public function getPath(): string
6164
{
@@ -74,11 +77,11 @@ public static function getJsonSchema(): array
7477
'properties' => [
7578
'mimeType' => [
7679
'type' => 'string',
77-
'description' => 'The MIME type of the file',
80+
'description' => 'The MIME type of the file.',
7881
],
7982
'path' => [
8083
'type' => 'string',
81-
'description' => 'The local filesystem path to the file',
84+
'description' => 'The local filesystem path to the file.',
8285
],
8386
],
8487
'required' => ['mimeType', 'path'],

src/Files/DTO/RemoteFile.php

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use WordPress\AiClient\Files\Contracts\FileInterface;
99

1010
/**
11-
* Represents a file accessible via a remote URL
11+
* Represents a file accessible via a remote URL.
1212
*
1313
* This DTO is used for files that are hosted remotely and accessed via HTTP/HTTPS,
1414
* commonly used for media files stored on CDNs or external services.
@@ -18,21 +18,22 @@
1818
class RemoteFile implements FileInterface, WithJsonSchema
1919
{
2020
/**
21-
* @var string The MIME type of the file
21+
* @var string The MIME type of the file.
2222
*/
2323
private string $mimeType;
2424

2525
/**
26-
* @var string The URL to the remote file
26+
* @var string The URL to the remote file.
2727
*/
2828
private string $url;
2929

3030
/**
31-
* Constructor
31+
* Constructor.
3232
*
3333
* @since n.e.x.t
34-
* @param string $mimeType The MIME type of the file
35-
* @param string $url The URL to the remote file
34+
*
35+
* @param string $mimeType The MIME type of the file.
36+
* @param string $url The URL to the remote file.
3637
*/
3738
public function __construct(string $mimeType, string $url)
3839
{
@@ -41,21 +42,23 @@ public function __construct(string $mimeType, string $url)
4142
}
4243

4344
/**
44-
* Get the MIME type of the file
45+
* Gets the MIME type of the file.
4546
*
4647
* @since n.e.x.t
47-
* @return string The MIME type
48+
*
49+
* @return string The MIME type.
4850
*/
4951
public function getMimeType(): string
5052
{
5153
return $this->mimeType;
5254
}
5355

5456
/**
55-
* Get the URL to the remote file
57+
* Gets the URL to the remote file.
5658
*
5759
* @since n.e.x.t
58-
* @return string The URL
60+
*
61+
* @return string The URL.
5962
*/
6063
public function getUrl(): string
6164
{
@@ -74,12 +77,12 @@ public static function getJsonSchema(): array
7477
'properties' => [
7578
'mimeType' => [
7679
'type' => 'string',
77-
'description' => 'The MIME type of the file',
80+
'description' => 'The MIME type of the file.',
7881
],
7982
'url' => [
8083
'type' => 'string',
8184
'format' => 'uri',
82-
'description' => 'The URL to the remote file',
85+
'description' => 'The URL to the remote file.',
8386
],
8487
],
8588
'required' => ['mimeType', 'url'],

src/Messages/DTO/Message.php

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use WordPress\AiClient\Messages\Enums\MessageRoleEnum;
99

1010
/**
11-
* Represents a message in an AI conversation
11+
* Represents a message in an AI conversation.
1212
*
1313
* Messages are the fundamental unit of communication with AI models,
1414
* containing a role and one or more parts with different content types.
@@ -18,21 +18,22 @@
1818
class Message implements WithJsonSchema
1919
{
2020
/**
21-
* @var MessageRoleEnum The role of the message sender
21+
* @var MessageRoleEnum The role of the message sender.
2222
*/
2323
protected MessageRoleEnum $role;
2424

2525
/**
26-
* @var MessagePart[] The parts that make up this message
26+
* @var MessagePart[] The parts that make up this message.
2727
*/
2828
protected array $parts;
2929

3030
/**
31-
* Constructor
31+
* Constructor.
3232
*
3333
* @since n.e.x.t
34-
* @param MessageRoleEnum $role The role of the message sender
35-
* @param MessagePart[] $parts The parts that make up this message
34+
*
35+
* @param MessageRoleEnum $role The role of the message sender.
36+
* @param MessagePart[] $parts The parts that make up this message.
3637
*/
3738
public function __construct(MessageRoleEnum $role, array $parts)
3839
{
@@ -41,11 +42,12 @@ public function __construct(MessageRoleEnum $role, array $parts)
4142
}
4243

4344
/**
44-
* Create a message from a simple text string
45+
* Creates a message from a simple text string.
4546
*
4647
* @since n.e.x.t
47-
* @param MessageRoleEnum $role The role of the message sender
48-
* @param string $text The text content
48+
*
49+
* @param MessageRoleEnum $role The role of the message sender.
50+
* @param string $text The text content.
4951
* @return self
5052
*/
5153
public static function fromText(MessageRoleEnum $role, string $text): self
@@ -54,21 +56,23 @@ public static function fromText(MessageRoleEnum $role, string $text): self
5456
}
5557

5658
/**
57-
* Get the role of the message sender
59+
* Gets the role of the message sender.
5860
*
5961
* @since n.e.x.t
60-
* @return MessageRoleEnum The role
62+
*
63+
* @return MessageRoleEnum The role.
6164
*/
6265
public function getRole(): MessageRoleEnum
6366
{
6467
return $this->role;
6568
}
6669

6770
/**
68-
* Get the message parts
71+
* Gets the message parts.
6972
*
7073
* @since n.e.x.t
71-
* @return MessagePart[] The message parts
74+
*
75+
* @return MessagePart[] The message parts.
7276
*/
7377
public function getParts(): array
7478
{
@@ -88,13 +92,13 @@ public static function getJsonSchema(): array
8892
'role' => [
8993
'type' => 'string',
9094
'enum' => ['user', 'model', 'system'],
91-
'description' => 'The role of the message sender',
95+
'description' => 'The role of the message sender.',
9296
],
9397
'parts' => [
9498
'type' => 'array',
9599
'items' => MessagePart::getJsonSchema(),
96100
'minItems' => 1,
97-
'description' => 'The parts that make up this message',
101+
'description' => 'The parts that make up this message.',
98102
],
99103
],
100104
'required' => ['role', 'parts'],

0 commit comments

Comments
 (0)