Skip to content

Commit 742152a

Browse files
committed
chore: adds since tags
1 parent 006baa1 commit 742152a

File tree

10 files changed

+29
-0
lines changed

10 files changed

+29
-0
lines changed

src/Common/AbstractEnum.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
* $enum->equals('first'); // Returns true
3030
* $enum->is(PersonEnum::firstName()); // Returns true
3131
* PersonEnum::cases(); // Returns array of all enum instances
32+
*
33+
* @since n.e.x.t
3234
*/
3335
abstract class AbstractEnum
3436
{
@@ -55,6 +57,7 @@ abstract class AbstractEnum
5557
/**
5658
* Constructor is private to ensure instances are created through static methods
5759
*
60+
* @since n.e.x.t
5861
* @param string|int $value The enum value
5962
* @param string $name The constant name
6063
*/
@@ -67,6 +70,7 @@ final private function __construct($value, string $name)
6770
/**
6871
* Magic getter to provide read-only access to properties
6972
*
73+
* @since n.e.x.t
7074
* @param string $property The property name
7175
* @return mixed
7276
* @throws BadMethodCallException If property doesn't exist
@@ -85,6 +89,7 @@ final public function __get(string $property)
8589
/**
8690
* Magic setter to prevent property modification
8791
*
92+
* @since n.e.x.t
8893
* @param string $property The property name
8994
* @param mixed $value The value to set
9095
* @throws BadMethodCallException Always, as enum properties are read-only
@@ -99,6 +104,7 @@ final public function __set(string $property, $value): void
99104
/**
100105
* Create an enum instance from a value, throws exception if invalid
101106
*
107+
* @since n.e.x.t
102108
* @param string|int $value The enum value
103109
* @return static
104110
* @throws InvalidArgumentException If the value is not valid
@@ -117,6 +123,7 @@ final public static function from($value): self
117123
/**
118124
* Try to create an enum instance from a value, returns null if invalid
119125
*
126+
* @since n.e.x.t
120127
* @param string|int $value The enum value
121128
* @return static|null
122129
*/
@@ -134,6 +141,7 @@ final public static function tryFrom($value): ?self
134141
/**
135142
* Get all enum cases
136143
*
144+
* @since n.e.x.t
137145
* @return static[]
138146
*/
139147
final public static function cases(): array
@@ -149,6 +157,7 @@ final public static function cases(): array
149157
/**
150158
* Check if this enum has the same value as the given value
151159
*
160+
* @since n.e.x.t
152161
* @param string|int|self $other The value or enum to compare
153162
* @return bool
154163
*/
@@ -164,6 +173,7 @@ final public function equals($other): bool
164173
/**
165174
* Check if this enum is the same instance type and value as another enum
166175
*
176+
* @since n.e.x.t
167177
* @param self $other The other enum to compare
168178
* @return bool
169179
*/
@@ -175,6 +185,7 @@ final public function is(self $other): bool
175185
/**
176186
* Get all valid values for this enum
177187
*
188+
* @since n.e.x.t
178189
* @return array<string, string|int>
179190
*/
180191
final public static function getValues(): array
@@ -185,6 +196,7 @@ final public static function getValues(): array
185196
/**
186197
* Check if a value is valid for this enum
187198
*
199+
* @since n.e.x.t
188200
* @param string|int $value The value to check
189201
* @return bool
190202
*/
@@ -196,6 +208,7 @@ final public static function isValidValue($value): bool
196208
/**
197209
* Get or create a singleton instance for the given value and name
198210
*
211+
* @since n.e.x.t
199212
* @param string|int $value The enum value
200213
* @param string $name The constant name
201214
* @return static
@@ -220,6 +233,7 @@ private static function getInstance($value, string $name): self
220233
/**
221234
* Get all constants for this enum class
222235
*
236+
* @since n.e.x.t
223237
* @return array<string, string|int>
224238
* @throws \RuntimeException If invalid constant found
225239
*/
@@ -270,6 +284,7 @@ final protected static function getConstants(): array
270284
/**
271285
* Handle dynamic method calls for enum checking
272286
*
287+
* @since n.e.x.t
273288
* @param string $name The method name
274289
* @param array<mixed> $arguments The method arguments
275290
* @return bool
@@ -295,6 +310,7 @@ final public function __call(string $name, array $arguments): bool
295310
/**
296311
* Handle static method calls for enum creation
297312
*
313+
* @since n.e.x.t
298314
* @param string $name The method name
299315
* @param array<mixed> $arguments The method arguments
300316
* @return static
@@ -317,6 +333,7 @@ final public static function __callStatic(string $name, array $arguments): self
317333
/**
318334
* Convert camelCase to CONSTANT_CASE
319335
*
336+
* @since n.e.x.t
320337
* @param string $camelCase The camelCase string
321338
* @return string The CONSTANT_CASE version
322339
*/
@@ -332,6 +349,7 @@ private static function camelCaseToConstant(string $camelCase): string
332349
/**
333350
* String representation of the enum
334351
*
352+
* @since n.e.x.t
335353
* @return string
336354
*/
337355
final public function __toString(): string

src/Messages/Enums/MessagePartTypeEnum.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
/**
1010
* Enum for message part types
1111
*
12+
* @since n.e.x.t
1213
* @method static self text() Create an instance for TEXT type
1314
* @method static self inlineFile() Create an instance for INLINE_FILE type
1415
* @method static self remoteFile() Create an instance for REMOTE_FILE type

src/Messages/Enums/MessageRoleEnum.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
/**
1010
* Enum for message roles in AI conversations
1111
*
12+
* @since n.e.x.t
1213
* @method static self user() Create an instance for USER role
1314
* @method static self model() Create an instance for MODEL role
1415
* @method static self system() Create an instance for SYSTEM role

src/Messages/Enums/ModalityEnum.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
/**
1010
* Enum for input/output modalities
1111
*
12+
* @since n.e.x.t
1213
* @method static self text() Create an instance for TEXT modality
1314
* @method static self document() Create an instance for DOCUMENT modality
1415
* @method static self image() Create an instance for IMAGE modality

src/Operations/Enums/OperationStateEnum.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
/**
1010
* Enum for operation states
1111
*
12+
* @since n.e.x.t
1213
* @method static self starting() Create an instance for STARTING state
1314
* @method static self processing() Create an instance for PROCESSING state
1415
* @method static self succeeded() Create an instance for SUCCEEDED state

src/Providers/Enums/ProviderTypeEnum.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
/**
1010
* Enum for provider types
1111
*
12+
* @since n.e.x.t
1213
* @method static self cloud() Create an instance for CLOUD type
1314
* @method static self server() Create an instance for SERVER type
1415
* @method static self client() Create an instance for CLIENT type

src/Providers/Enums/ToolTypeEnum.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
/**
1010
* Enum for tool types
1111
*
12+
* @since n.e.x.t
1213
* @method static self functionDeclarations() Create an instance for FUNCTION_DECLARATIONS type
1314
* @method static self webSearch() Create an instance for WEB_SEARCH type
1415
* @method bool isFunctionDeclarations() Check if the type is FUNCTION_DECLARATIONS

src/Providers/Models/Enums/CapabilityEnum.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
/**
1010
* Enum for model capabilities
1111
*
12+
* @since n.e.x.t
13+
*
1214
* @method static self textGeneration() Create an instance for TEXT_GENERATION capability
1315
* @method static self imageGeneration() Create an instance for IMAGE_GENERATION capability
1416
* @method static self textToSpeechConversion() Create an instance for TEXT_TO_SPEECH_CONVERSION capability

src/Providers/Models/Enums/OptionEnum.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
/**
1010
* Enum for model options
1111
*
12+
* @since n.e.x.t
13+
*
1214
* @method static self inputModalities() Create an instance for INPUT_MODALITIES option
1315
* @method static self outputModalities() Create an instance for OUTPUT_MODALITIES option
1416
* @method static self systemInstruction() Create an instance for SYSTEM_INSTRUCTION option

src/Results/Enums/FinishReasonEnum.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
/**
1010
* Enum for finish reasons of AI generation
1111
*
12+
* @since n.e.x.t
1213
* @method static self stop() Create an instance for STOP reason
1314
* @method static self length() Create an instance for LENGTH reason
1415
* @method static self contentFilter() Create an instance for CONTENT_FILTER reason

0 commit comments

Comments
 (0)