From 97386a7aec5613f719d474db17c47f6d3d54ba78 Mon Sep 17 00:00:00 2001 From: thelovekesh Date: Sun, 28 Jun 2026 12:12:58 +0530 Subject: [PATCH 01/23] Add `phpstan/phpdoc-parser` --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index acf163ef..f46a7a58 100644 --- a/composer.json +++ b/composer.json @@ -14,6 +14,7 @@ "nikic/php-parser": "^5.5", "php-stubs/generator": "^0.8.6", "phpdocumentor/reflection-docblock": "^6.0", + "phpstan/phpdoc-parser": "^2.3", "phpstan/phpstan": "^2.1", "phpunit/phpunit": "^9.5", "symfony/polyfill-php80": "*", From 576eb4cca2e5a7e40b612f32f0fa8b769f1ac06a Mon Sep 17 00:00:00 2001 From: thelovekesh Date: Sun, 28 Jun 2026 14:06:42 +0530 Subject: [PATCH 02/23] Add phpdoc type name resolver --- src/PhpDocTypeNameResolver.php | 149 +++++++++++++++++++++++++++++++++ 1 file changed, 149 insertions(+) create mode 100644 src/PhpDocTypeNameResolver.php diff --git a/src/PhpDocTypeNameResolver.php b/src/PhpDocTypeNameResolver.php new file mode 100644 index 00000000..a714eec4 --- /dev/null +++ b/src/PhpDocTypeNameResolver.php @@ -0,0 +1,149 @@ + */ + private array $aliases; + + /** @var array */ + private array $skip = []; + + /** @var array */ + private array $templateNames = []; + + /** + * @param array $aliases + */ + public function __construct(array $aliases) + { + $this->aliases = $aliases; + } + + /** + * @return null + */ + public function enterNode(Node $node) + { + if ($node instanceof TemplateTagValueNode) { + $this->templateNames[strtolower($node->name)] = true; + + return null; + } + + if ( + ($node instanceof ArrayShapeItemNode || $node instanceof ObjectShapeItemNode) + && $node->keyName !== null + ) { + $this->skip[spl_object_id($node->keyName)] = true; + } + + if ($node instanceof GenericTypeNode && strtolower($node->type->name) === 'int') { + foreach ($node->genericTypes as $bound) { + if (! ($bound instanceof IdentifierTypeNode) || ! in_array(strtolower($bound->name), ['min', 'max'], true)) { + continue; + } + + $this->skip[spl_object_id($bound)] = true; + } + } + + if ($node instanceof CallableTypeNode) { + $this->skip[spl_object_id($node->identifier)] = true; + } + + if ($node instanceof ConstFetchNode && $node->className !== '') { + if (! isset($this->skip[spl_object_id($node)])) { + $resolved = $this->resolveName($node->className); + if ($resolved !== null) { + $node->className = $resolved; + } + } + + return null; + } + + if (! ($node instanceof IdentifierTypeNode)) { + return null; + } + + if (isset($this->skip[spl_object_id($node)]) || isset($this->templateNames[strtolower($node->name)])) { + return null; + } + + $resolved = $this->resolveName($node->name); + if ($resolved !== null) { + $node->name = $resolved; + } + + return null; + } + + private function resolveName(string $name): ?string + { + if (strncmp($name, '\\', 1) === 0) { + return null; // already fully qualified + } + + $separatorPos = strpos($name, '\\'); + $firstSegment = $separatorPos === false ? $name : substr($name, 0, $separatorPos); + + if (in_array(strtolower($firstSegment), self::RESERVED, true)) { + return null; + } + + $alias = strtolower($firstSegment); + if (! isset($this->aliases[$alias])) { + return null; + } + + $remainder = $separatorPos === false ? '' : substr($name, $separatorPos); + + return sprintf('%s%s', $this->aliases[$alias], $remainder); + } +} From 6c4964f88eb72fe50631705b7b6da9ca8b0a4562 Mon Sep 17 00:00:00 2001 From: thelovekesh Date: Sun, 28 Jun 2026 14:07:42 +0530 Subject: [PATCH 03/23] Add phpdoc rewriter with fully qualified name in phpdoc --- src/PhpDocFqcnRewriter.php | 62 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 src/PhpDocFqcnRewriter.php diff --git a/src/PhpDocFqcnRewriter.php b/src/PhpDocFqcnRewriter.php new file mode 100644 index 00000000..e1c05462 --- /dev/null +++ b/src/PhpDocFqcnRewriter.php @@ -0,0 +1,62 @@ + true, 'indexes' => true, 'comments' => true]); + $constExprParser = new ConstExprParser($config); + + $this->lexer = new Lexer($config); + $this->printer = new Printer(); + $this->docParser = new PhpDocParser($config, new TypeParser($config, $constExprParser), $constExprParser); + } + + /** + * @param array $imports + */ + public function rewrite(string $docComment, array $imports): string + { + if ($imports === []) { + return $docComment; + } + + $aliases = []; + foreach ($imports as $alias => $fqcn) { + $aliases[strtolower($alias)] = $fqcn; + } + + $tokens = new TokenIterator($this->lexer->tokenize($docComment)); + $original = $this->docParser->parse($tokens); + + $rewritten = $this->cloningTraverser()->traverse([$original])[0]; + (new NodeTraverser([new PhpDocTypeNameResolver($aliases)]))->traverse([$rewritten]); + + return $this->printer->printFormatPreserving($rewritten, $original, $tokens); + } + + private function cloningTraverser(): NodeTraverser + { + return new NodeTraverser([new CloningVisitor()]); + } +} From 42767927bb0d60a752c66ef4ee9d629aef07603b Mon Sep 17 00:00:00 2001 From: thelovekesh Date: Sun, 28 Jun 2026 14:10:30 +0530 Subject: [PATCH 04/23] Update visitor to resolve FQCN in phpdoc --- src/Visitor.php | 95 ++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 87 insertions(+), 8 deletions(-) diff --git a/src/Visitor.php b/src/Visitor.php index 1455fcc6..0c47c424 100644 --- a/src/Visitor.php +++ b/src/Visitor.php @@ -30,6 +30,9 @@ use PhpParser\Node\Stmt\Namespace_; use PhpParser\Node\Stmt\Property; use PhpParser\Node\Stmt\Return_ as Stmt_Return; +use PhpParser\Node\Stmt\GroupUse; +use PhpParser\Node\Stmt\Use_; +use PhpParser\Node\UseItem; use StubsGenerator\NodeVisitor; use phpDocumentor\Reflection\DocBlockFactoryInterface; use phpDocumentor\Reflection\DocBlockFactory; @@ -57,13 +60,29 @@ class Visitor extends NodeVisitor /** @var array> */ private array $additionalTagStrings = []; + /** @var array */ + private array $useAliases = []; + private NodeFinder $nodeFinder; + private PhpDocFqcnRewriter $fqcnRewriter; + public function __construct() { $this->docBlockFactory = DocBlockFactory::createInstance(); $this->nodeFinder = new NodeFinder(); $this->functionMap = require sprintf('%s/functionMap.php', dirname(__DIR__)); + $this->fqcnRewriter = new PhpDocFqcnRewriter(); + } + + /** + * @param array<\PhpParser\Node> $nodes + * @return array<\PhpParser\Node>|null + */ + public function beforeTraverse(array $nodes) + { + $this->useAliases = []; + return parent::beforeTraverse($nodes); } /** @@ -75,6 +94,8 @@ public function enterNode(Node $node) parent::enterNode($node); + $this->trackUseStatements($node); + if (! ($node instanceof Function_) && ! ($node instanceof ClassMethod) && ! ($node instanceof Property) && ! ($node instanceof ClassLike)) { return null; } @@ -89,6 +110,7 @@ public function enterNode(Node $node) $symbolName = $this->getSymbolName($node); $node->setAttribute('WPStubs_symbolName', $symbolName); + $node->setAttribute('WPStubs_useAliases', $this->useAliases); $additions = $this->generateAdditionalTagsFromDoc($docComment); if (count($additions) > 0) { @@ -115,6 +137,45 @@ public function enterNode(Node $node) return null; } + private function trackUseStatements(Node $node): void + { + if ($node instanceof Namespace_) { + $this->useAliases = []; + return; + } + + if ($node instanceof Use_) { + foreach ($node->uses as $use) { + $this->addAlias($use, $node->type, ''); + } + + return; + } + + if (! ($node instanceof GroupUse)) { + return; + } + + foreach ($node->uses as $use) { + $this->addAlias($use, $node->type, sprintf('%s\\', $node->prefix->toString())); + } + } + + private function addAlias(UseItem $useItem, int $type, string $prefix): void + { + if ($useItem->type !== Use_::TYPE_UNKNOWN) { + $type = $useItem->type; + } + + if ($type !== Use_::TYPE_NORMAL) { + return; + } + + $alias = strtolower($useItem->getAlias()->toString()); + $fullyQualifiedName = ltrim(sprintf('%s%s', $prefix, $useItem->name->toString()), '\\'); + $this->useAliases[$alias] = sprintf('\\%s', $fullyQualifiedName); + } + private function getSymbolName(Node $node): string { if ((($node instanceof Function_) || ($node instanceof ClassMethod) || ($node instanceof ClassLike)) && $node->name instanceof Identifier) { @@ -187,23 +248,41 @@ private function postProcessNode(Node $node): void $node->setDocComment($newDocComment); } - if (! isset($this->additionalTagStrings[$symbolName])) { - return; + $docComment = $node->getDocComment(); + + if ($docComment instanceof Doc) { + $newDocComment = $this->addStringTags($symbolName, $docComment); + + if ($newDocComment instanceof Doc) { + $node->setDocComment($newDocComment); + } } + $this->rewriteImportedNames($node); + } + + private function rewriteImportedNames(Node $node): void + { $docComment = $node->getDocComment(); if (! ($docComment instanceof Doc)) { return; } - $newDocComment = $this->addStringTags($symbolName, $docComment); + $aliases = $node->getAttribute('WPStubs_useAliases'); + if (! is_array($aliases) || count($aliases) === 0) { + return; + } + + /** @var array $aliases */ + $originalText = $docComment->getText(); + $newText = $this->fqcnRewriter->rewrite($originalText, $aliases); - if (! ($newDocComment instanceof Doc)) { + if ($newText === $originalText) { return; } - $node->setDocComment($newDocComment); + $node->setDocComment(new Doc($newText, $docComment->getStartLine(), $docComment->getStartFilePos())); } /** @@ -457,7 +536,7 @@ private function getAdditionalTagsFromMap(string $symbolName): array foreach ($parameters as $paramName => $paramType) { if (str_starts_with($paramName, '@')) { - $format = ( $paramType === '' ) ? '%s' : '%s %s'; + $format = ($paramType === '') ? '%s' : '%s %s'; $additions[] = sprintf( $format, $paramName, @@ -684,8 +763,8 @@ private static function getTypeNameFromString(string $tagVariable): ?string $tagVariableType = str_replace( [ - 'stdClass', - '\\object', + 'stdClass', + '\\object', ], 'object', $tagVariableType From 3ca9ff8ee7518158e55431b25cafb1ce5d2b9065 Mon Sep 17 00:00:00 2001 From: thelovekesh Date: Sun, 28 Jun 2026 14:33:13 +0530 Subject: [PATCH 05/23] Fix linting errors --- src/PhpDocTypeNameResolver.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/PhpDocTypeNameResolver.php b/src/PhpDocTypeNameResolver.php index a714eec4..f559223e 100644 --- a/src/PhpDocTypeNameResolver.php +++ b/src/PhpDocTypeNameResolver.php @@ -22,6 +22,8 @@ use function strtolower; use function substr; +// phpcs:disable SlevomatCodingStandard.Functions.FunctionLength.FunctionLength + final class PhpDocTypeNameResolver extends AbstractNodeVisitor { private const RESERVED = [ @@ -68,7 +70,7 @@ public function __construct(array $aliases) /** * @return null */ - public function enterNode(Node $node) + public function enterNode(Node $node): ?Node { if ($node instanceof TemplateTagValueNode) { $this->templateNames[strtolower($node->name)] = true; From 3543f1aa415960a6cc0f4cee51b15e7af447b270 Mon Sep 17 00:00:00 2001 From: thelovekesh Date: Sun, 28 Jun 2026 14:54:08 +0530 Subject: [PATCH 06/23] Fix writing bad node to phpdoc --- src/PhpDocFqcnRewriter.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/PhpDocFqcnRewriter.php b/src/PhpDocFqcnRewriter.php index e1c05462..03175dde 100644 --- a/src/PhpDocFqcnRewriter.php +++ b/src/PhpDocFqcnRewriter.php @@ -6,6 +6,7 @@ use PHPStan\PhpDocParser\Ast\NodeTraverser; use PHPStan\PhpDocParser\Ast\NodeVisitor\CloningVisitor; +use PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocNode; use PHPStan\PhpDocParser\Lexer\Lexer; use PHPStan\PhpDocParser\Parser\ConstExprParser; use PHPStan\PhpDocParser\Parser\PhpDocParser; @@ -18,9 +19,9 @@ final class PhpDocFqcnRewriter { - private readonly Lexer $lexer; - private readonly Printer $printer; - private readonly PhpDocParser $docParser; + private Lexer $lexer; + private Printer $printer; + private PhpDocParser $docParser; public function __construct() { @@ -52,6 +53,10 @@ public function rewrite(string $docComment, array $imports): string $rewritten = $this->cloningTraverser()->traverse([$original])[0]; (new NodeTraverser([new PhpDocTypeNameResolver($aliases)]))->traverse([$rewritten]); + if (! $rewritten instanceof PhpDocNode) { + return $docComment; + } + return $this->printer->printFormatPreserving($rewritten, $original, $tokens); } From 156c1510eeff16c3f0cca21cb02e5cbacfc387da Mon Sep 17 00:00:00 2001 From: thelovekesh Date: Sun, 28 Jun 2026 15:08:20 +0530 Subject: [PATCH 07/23] Fix breaking the doc parser for invalid phpdoc --- src/PhpDocFqcnRewriter.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/PhpDocFqcnRewriter.php b/src/PhpDocFqcnRewriter.php index 03175dde..54fc1d2f 100644 --- a/src/PhpDocFqcnRewriter.php +++ b/src/PhpDocFqcnRewriter.php @@ -47,8 +47,12 @@ public function rewrite(string $docComment, array $imports): string $aliases[strtolower($alias)] = $fqcn; } - $tokens = new TokenIterator($this->lexer->tokenize($docComment)); - $original = $this->docParser->parse($tokens); + try { + $tokens = new TokenIterator($this->lexer->tokenize($docComment)); + $original = $this->docParser->parse($tokens); + } catch (\Throwable) { + return $docComment; + } $rewritten = $this->cloningTraverser()->traverse([$original])[0]; (new NodeTraverser([new PhpDocTypeNameResolver($aliases)]))->traverse([$rewritten]); From 35c3210d0f5cf11a11cd4418252f0ee87074c468 Mon Sep 17 00:00:00 2001 From: thelovekesh Date: Sun, 28 Jun 2026 15:09:11 +0530 Subject: [PATCH 08/23] Add test cases for PhpDocFqcnRewriter --- tests/PhpDocFqcnRewriterTest.php | 257 +++++++++++++++++++++++++++++++ 1 file changed, 257 insertions(+) create mode 100644 tests/PhpDocFqcnRewriterTest.php diff --git a/tests/PhpDocFqcnRewriterTest.php b/tests/PhpDocFqcnRewriterTest.php new file mode 100644 index 00000000..823e6a71 --- /dev/null +++ b/tests/PhpDocFqcnRewriterTest.php @@ -0,0 +1,257 @@ + $aliases + */ + public function testFlatten(array $aliases, string $input, string $expected): void + { + $rewriter = new PhpDocFqcnRewriter(); + self::assertSame($expected, $rewriter->rewrite($input, $aliases)); + } + + /** + * @return iterable, string, string}> + */ + public static function provideDocBlocks(): iterable + { + $std = [ + 'Foo' => '\Acme\Foo', + 'Bar' => '\Acme\Bar', + 'Baz' => '\Acme\Baz', + 'Message' => '\Acme\Messages\Message', + 'Coll' => '\Acme\Collection', + 'Sub' => '\Acme\Sub', + 'Qux' => '\Acme\Aliased', + 'Ex' => '\Acme\Exceptions\MyException', + ]; + + // Type annotations in various tags. + yield '@param' => [$std, '/** @param Foo $x */', '/** @param \Acme\Foo $x */']; + yield '@return' => [$std, '/** @return Foo */', '/** @return \Acme\Foo */']; + yield '@var with element name' => [$std, '/** @var Foo $bar */', '/** @var \Acme\Foo $bar */']; + yield '@var without element name' => [$std, '/** @var Foo */', '/** @var \Acme\Foo */']; + yield '@throws' => [$std, '/** @throws Ex */', '/** @throws \Acme\Exceptions\MyException */']; + yield '@property' => [$std, '/** @property Foo $x */', '/** @property \Acme\Foo $x */']; + yield '@property-read' => [$std, '/** @property-read Foo $x */', '/** @property-read \Acme\Foo $x */']; + yield '@property-write' => [$std, '/** @property-write Foo $x */', '/** @property-write \Acme\Foo $x */']; + yield '@method return and param' => [ + $std, + '/** @method Foo doThing(Baz $b) */', + '/** @method \Acme\Foo doThing(\Acme\Baz $b) */', + ]; + yield '@method static return type' => [ + $std, + '/** @method static Foo make() */', + '/** @method static \Acme\Foo make() */', + ]; + yield '@method multiple params' => [ + $std, + '/** @method Bar handle(Foo $a, Baz $b, int $c) */', + '/** @method \Acme\Bar handle(\Acme\Foo $a, \Acme\Baz $b, int $c) */', + ]; + yield '@mixin' => [$std, '/** @mixin Foo */', '/** @mixin \Acme\Foo */']; + + // PHPStan-specific tags. + yield '@phpstan-param' => [$std, '/** @phpstan-param Foo $x */', '/** @phpstan-param \Acme\Foo $x */']; + yield '@phpstan-return' => [$std, '/** @phpstan-return Foo */', '/** @phpstan-return \Acme\Foo */']; + yield '@phpstan-var' => [$std, '/** @phpstan-var Foo $x */', '/** @phpstan-var \Acme\Foo $x */']; + yield '@phpstan-type right-hand side' => [ + $std, + '/** @phpstan-type Prompt Foo|Message|int */', + '/** @phpstan-type Prompt \Acme\Foo|\Acme\Messages\Message|int */', + ]; + yield '@phpstan-import-type from target' => [ + $std, + '/** @phpstan-import-type Shape from Message */', + '/** @phpstan-import-type Shape from \Acme\Messages\Message */', + ]; + yield '@phpstan-import-type with as' => [ + $std, + '/** @phpstan-import-type Shape from Message as Renamed */', + '/** @phpstan-import-type Shape from \Acme\Messages\Message as Renamed */', + ]; + + // Type expressions in various forms. + yield 'union' => [$std, '/** @param Foo|Bar $x */', '/** @param \Acme\Foo|\Acme\Bar $x */']; + yield 'union with builtin' => [$std, '/** @param Foo|null $x */', '/** @param \Acme\Foo|null $x */']; + yield 'nullable shorthand' => [$std, '/** @param ?Foo $x */', '/** @param ?\Acme\Foo $x */']; + yield 'intersection' => [$std, '/** @param Foo&Bar $x */', '/** @param \Acme\Foo&\Acme\Bar $x */']; + yield 'generic list' => [$std, '/** @param list $x */', '/** @param list<\Acme\Foo> $x */']; + yield 'generic array with key' => [ + $std, + '/** @param array $x */', + '/** @param array $x */', + ]; + yield 'generic custom collection' => [ + $std, + '/** @param Coll $x */', + '/** @param \Acme\Collection<\Acme\Foo> $x */', + ]; + yield 'array shape' => [ + $std, + '/** @param array{a: Foo, b?: Bar} $x */', + '/** @param array{a: \Acme\Foo, b?: \Acme\Bar} $x */', + ]; + yield 'nested generics' => [ + $std, + '/** @param array> $x */', + '/** @param array> $x */', + ]; + yield 'callable' => [ + $std, + '/** @param callable(Foo): Bar $x */', + '/** @param callable(\Acme\Foo): \Acme\Bar $x */', + ]; + yield 'variadic' => [$std, '/** @param Foo ...$x */', '/** @param \Acme\Foo ...$x */']; + yield 'by reference' => [$std, '/** @param Foo &$x */', '/** @param \Acme\Foo &$x */']; + yield 'class-string generic' => [ + $std, + '/** @param class-string $x */', + '/** @param class-string<\Acme\Foo> $x */', + ]; + + // Types that are imported via an alias. + yield 'aliased import' => [$std, '/** @param Qux $x */', '/** @param \Acme\Aliased $x */']; + yield 'qualified name, imported first segment' => [ + $std, + '/** @param Sub\Deep $x */', + '/** @param \Acme\Sub\Deep $x */', + ]; + yield 'case-insensitive alias match' => [$std, '/** @param foo $x */', '/** @param \Acme\Foo $x */']; + + // Reserved words and built-in types that should not be rewritten. + yield 'builtin scalar untouched' => [$std, '/** @param string $x */', '/** @param string $x */']; + yield 'builtin array untouched' => [$std, '/** @param array $x */', '/** @param array $x */']; + yield 'reserved static untouched' => [$std, '/** @return static */', '/** @return static */']; + yield 'reserved self untouched' => [$std, '/** @return self */', '/** @return self */']; + yield 'pseudo-type list untouched' => [$std, '/** @return list */', '/** @return list */']; + yield 'already fully qualified untouched' => [ + $std, + '/** @param \Already\Qualified $x */', + '/** @param \Already\Qualified $x */', + ]; + yield 'unimported same-namespace class untouched' => [ + $std, + '/** @param NotImported $x */', + '/** @param NotImported $x */', + ]; + yield 'local type alias untouched' => [$std, '/** @param Prompt $x */', '/** @param Prompt $x */']; + yield 'class name in description untouched' => [ + $std, + '/** @param Foo $x A Foo instance to use. */', + '/** @param \Acme\Foo $x A Foo instance to use. */', + ]; + + // Formatting and layout preservation. + yield 'multi-line layout preserved' => [ + $std, + <<<'DOC' + /** + * Does a thing with a Foo. + * + * @since 1.2.3 + * + * @param Foo $foo The foo to use. + * @param int $count How many. + * @return Bar The result. + * @throws Ex When it breaks. + */ + DOC, + <<<'DOC' + /** + * Does a thing with a Foo. + * + * @since 1.2.3 + * + * @param \Acme\Foo $foo The foo to use. + * @param int $count How many. + * @return \Acme\Bar The result. + * @throws \Acme\Exceptions\MyException When it breaks. + */ + DOC, + ]; + yield 'multiple tags in one block' => [ + $std, + <<<'DOC' + /** + * @param Foo $a + * @param Bar $b + * @return Baz + */ + DOC, + <<<'DOC' + /** + * @param \Acme\Foo $a + * @param \Acme\Bar $b + * @return \Acme\Baz + */ + DOC, + ]; + yield 'empty alias map leaves everything untouched' => [ + [], + '/** @param Foo $x */', + '/** @param Foo $x */', + ]; + yield 'unparseable input returned unchanged' => [ + $std, + 'this is not a doc comment', + 'this is not a doc comment', + ]; + + // Types in array/object shapes. + yield 'shape key matching import left alone' => [ + $std, + '/** @param array{message: string, body: Bar} $x */', + '/** @param array{message: string, body: \Acme\Bar} $x */', + ]; + yield 'object shape key left alone' => [ + $std, + '/** @return object{message: int} */', + '/** @return object{message: int} */', + ]; + yield 'class constant type qualified' => [ + $std, + '/** @return Foo::TYPE_X */', + '/** @return \Acme\Foo::TYPE_X */', + ]; + yield 'enum case wildcard qualified' => [ + $std, + '/** @param Foo::* $x */', + '/** @param \Acme\Foo::* $x */', + ]; + yield 'old-style array suffix' => [ + $std, + '/** @param Foo[] $x */', + '/** @param \Acme\Foo[] $x */', + ]; + + // Template annotations. + yield 'template shadows import' => [ + $std, + <<<'DOC' + /** + * @template Foo + * @param Foo $x + * @return Bar + */ + DOC, + <<<'DOC' + /** + * @template Foo + * @param Foo $x + * @return \Acme\Bar + */ + DOC, + ]; + } +} From 75316655fa6b6b488c0cfc02ea9479215f987eb0 Mon Sep 17 00:00:00 2001 From: thelovekesh Date: Sun, 28 Jun 2026 15:23:46 +0530 Subject: [PATCH 09/23] Add mikey179/vfsstream --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index f46a7a58..cff81ad4 100644 --- a/composer.json +++ b/composer.json @@ -11,6 +11,7 @@ "require-dev": { "php": "^7.4 || ^8.0", "dealerdirect/phpcodesniffer-composer-installer": "^1.0", + "mikey179/vfsstream": "^1.6", "nikic/php-parser": "^5.5", "php-stubs/generator": "^0.8.6", "phpdocumentor/reflection-docblock": "^6.0", From 2fc4a19ad6de0fec290806618ed8f40ab34e8352 Mon Sep 17 00:00:00 2001 From: thelovekesh Date: Sun, 28 Jun 2026 15:24:55 +0530 Subject: [PATCH 10/23] Add integration test for visitor to test fcqn rewrite --- tests/VisitorFqcnRewriteTest.php | 135 +++++++++++++++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 tests/VisitorFqcnRewriteTest.php diff --git a/tests/VisitorFqcnRewriteTest.php b/tests/VisitorFqcnRewriteTest.php new file mode 100644 index 00000000..8705c0f3 --- /dev/null +++ b/tests/VisitorFqcnRewriteTest.php @@ -0,0 +1,135 @@ + The collected messages. + */ + protected array $messages = []; + + /** + * @param Message $message The message to add. + * @param Registry $registry The registry (aliased import). + * @return Message + * @throws InvalidArgumentException When invalid. + */ + public function add(Message $message, Registry $registry): Message + { + return $message; + } + + /** + * @param Message ...$parts The parts. + * @return self + */ + public function withParts(Message ...$parts): self + { + return $this; + } + } + PHP; + + $output = $this->generateStubs($source); + + // Tags are rewritten to fully qualified names. + self::assertStringContainsString('@var list<\Acme\Models\Message>', $output); + self::assertStringContainsString('@param \Acme\Models\Message $message', $output); + self::assertStringContainsString('@param \Acme\Models\ProviderRegistry $registry', $output); + self::assertStringContainsString('@return \Acme\Models\Message', $output); + self::assertStringContainsString('@throws \Acme\Exceptions\InvalidArgumentException When invalid.', $output); + self::assertStringContainsString('@param \Acme\Models\Message ...$parts', $output); + + // Unqualified names no longer appear in the output. + self::assertStringNotContainsString('@param Message ', $output); + self::assertStringNotContainsString('@param Registry ', $output); + self::assertStringNotContainsString('@throws InvalidArgumentException', $output); + self::assertStringNotContainsString('@var list', $output); + + // Type declarations are rewritten to fully qualified names. + self::assertStringContainsString('public function add(\Acme\Models\Message $message', $output); + + // Imports no longer appear in the output. + self::assertStringNotContainsString('use Acme\Models\Message', $output); + + // Descriptions are preserved verbatim. + self::assertStringContainsString('The registry (aliased import).', $output); + } + + public function testShapeKeysConstantsAndTemplatesAreHandled(): void + { + $source = <<<'PHP' + generateStubs($source); + + // Template names are preserved verbatim, even if they match an import. + self::assertStringContainsString('@param Reply $x', $output); + self::assertStringNotContainsString('@param \Acme\Models\Reply $x', $output); + + // Shape keys are preserved verbatim, even if they match an import. + self::assertStringContainsString('status: int', $output); + self::assertStringContainsString('extra: \Acme\Models\Status', $output); + self::assertStringNotContainsString('\Acme\Models\Status: int', $output); + + // Return types that reference constants are rewritten to fully qualified names. + self::assertStringContainsString('@return \Acme\Models\Status::ACTIVE', $output); + } + + private function generateStubs(string $source): string + { + $root = vfsStream::setup('stubs'); + vfsStream::newFile('fixture.php')->at($root)->setContent($source); + + $finder = Finder::create()->in(vfsStream::url('stubs'))->name('*.php'); + return (new StubsGenerator())->generate($finder, new Visitor())->prettyPrint(); + } +} From 1aef4742a4d0b958ab9b4ec3e4adc4c011fb0db2 Mon Sep 17 00:00:00 2001 From: thelovekesh Date: Sun, 28 Jun 2026 17:09:45 +0530 Subject: [PATCH 11/23] Update test function name --- tests/PhpDocFqcnRewriterTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/PhpDocFqcnRewriterTest.php b/tests/PhpDocFqcnRewriterTest.php index 823e6a71..3c723f12 100644 --- a/tests/PhpDocFqcnRewriterTest.php +++ b/tests/PhpDocFqcnRewriterTest.php @@ -13,7 +13,7 @@ final class PhpDocFqcnRewriterTest extends TestCase * @dataProvider provideDocBlocks * @param array $aliases */ - public function testFlatten(array $aliases, string $input, string $expected): void + public function testRewrite(array $aliases, string $input, string $expected): void { $rewriter = new PhpDocFqcnRewriter(); self::assertSame($expected, $rewriter->rewrite($input, $aliases)); From 3c6f2663a2bcc61074ae33d682d9c37dab1240cf Mon Sep 17 00:00:00 2001 From: thelovekesh Date: Sun, 28 Jun 2026 17:11:36 +0530 Subject: [PATCH 12/23] Fix catch support for php7.4 --- src/PhpDocFqcnRewriter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PhpDocFqcnRewriter.php b/src/PhpDocFqcnRewriter.php index 54fc1d2f..2ff4bb4a 100644 --- a/src/PhpDocFqcnRewriter.php +++ b/src/PhpDocFqcnRewriter.php @@ -50,7 +50,7 @@ public function rewrite(string $docComment, array $imports): string try { $tokens = new TokenIterator($this->lexer->tokenize($docComment)); $original = $this->docParser->parse($tokens); - } catch (\Throwable) { + } catch (\Throwable $e) { return $docComment; } From cc56f8b5435a392b74e971eb9ca40819a987a482 Mon Sep 17 00:00:00 2001 From: thelovekesh Date: Sun, 28 Jun 2026 17:11:46 +0530 Subject: [PATCH 13/23] Fix lint error --- tests/PhpDocFqcnRewriterTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/PhpDocFqcnRewriterTest.php b/tests/PhpDocFqcnRewriterTest.php index 3c723f12..086eb233 100644 --- a/tests/PhpDocFqcnRewriterTest.php +++ b/tests/PhpDocFqcnRewriterTest.php @@ -7,6 +7,8 @@ use PhpStubs\WordPress\Core\PhpDocFqcnRewriter; use PHPUnit\Framework\TestCase; +// phpcs:disable SlevomatCodingStandard.Functions.FunctionLength.FunctionLength + final class PhpDocFqcnRewriterTest extends TestCase { /** From ab00b7202647febed3bed8c467dc7e99a90ba20d Mon Sep 17 00:00:00 2001 From: thelovekesh Date: Sun, 28 Jun 2026 17:13:47 +0530 Subject: [PATCH 14/23] Spell fix --- tests/PhpDocFqcnRewriterTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/PhpDocFqcnRewriterTest.php b/tests/PhpDocFqcnRewriterTest.php index 086eb233..f6c3caf4 100644 --- a/tests/PhpDocFqcnRewriterTest.php +++ b/tests/PhpDocFqcnRewriterTest.php @@ -204,7 +204,7 @@ public static function provideDocBlocks(): iterable '/** @param Foo $x */', '/** @param Foo $x */', ]; - yield 'unparseable input returned unchanged' => [ + yield 'unparsable input returned unchanged' => [ $std, 'this is not a doc comment', 'this is not a doc comment', From 57127cf5908ae329a03059bbe00b0692b3d8021e Mon Sep 17 00:00:00 2001 From: thelovekesh Date: Sun, 28 Jun 2026 17:15:08 +0530 Subject: [PATCH 15/23] Update WordPress 7.0.0 stubs with FQCN resolved phpdocs --- wordpress-stubs.php | 1080 +++++++++++++++++++++---------------------- 1 file changed, 540 insertions(+), 540 deletions(-) diff --git a/wordpress-stubs.php b/wordpress-stubs.php index 8c3a7a27..4ddb8ef2 100644 --- a/wordpress-stubs.php +++ b/wordpress-stubs.php @@ -15517,13 +15517,13 @@ class OAuth implements \PHPMailer\PHPMailer\OAuthTokenProvider /** * An instance of the League OAuth Client Provider. * - * @var AbstractProvider + * @var \League\OAuth2\Client\Provider\AbstractProvider */ protected $provider; /** * The current OAuth access token. * - * @var AccessToken + * @var \League\OAuth2\Client\Token\AccessToken */ protected $oauthToken; /** @@ -15563,7 +15563,7 @@ public function __construct($options) /** * Get a new RefreshToken. * - * @return RefreshToken + * @return \League\OAuth2\Client\Grant\RefreshToken */ protected function getGrant() { @@ -15571,7 +15571,7 @@ protected function getGrant() /** * Get a new AccessToken. * - * @return AccessToken + * @return \League\OAuth2\Client\Token\AccessToken */ protected function getToken() { @@ -22278,7 +22278,7 @@ class SimplePie */ public $max_checked_feeds = 10; /** - * @var array|null All the feeds found during the autodiscovery process + * @var array<\SimplePie\HTTP\Response>|null All the feeds found during the autodiscovery process * @see SimplePie::get_all_discovered_feeds() * @access private */ @@ -22497,7 +22497,7 @@ public function enable_cache(bool $enable = true) /** * Set a PSR-16 implementation as cache * - * @param CacheInterface $cache The PSR-16 cache implementation + * @param \Psr\SimpleCache\CacheInterface $cache The PSR-16 cache implementation * * @return void */ @@ -22780,7 +22780,7 @@ public function set_restriction_class(string $class = \SimplePie\Restriction::cl * * @deprecated since SimplePie 1.3, use {@see get_registry()} instead * - * @param class-string $class Name of custom class + * @param class-string<\SimplePie\Content\Type\Sniffer> $class Name of custom class * * @return bool True on success, false otherwise */ @@ -22811,7 +22811,7 @@ public function set_useragent(?string $ua = null) /** * Set a namefilter to modify the cache filename with * - * @param NameFilter $filter + * @param \SimplePie\Cache\NameFilter $filter * * @return void */ @@ -22991,7 +22991,7 @@ public function init() * * If the data is already cached, attempt to fetch it from there instead * - * @param Base|DataCache|false $cache Cache handler, or false to not load from the cache + * @param \SimplePie\Cache\Base|\SimplePie\Cache\DataCache|false $cache Cache handler, or false to not load from the cache * @return array{array, string}|bool Returns true if the data was loaded from the cache, or an array of HTTP headers and sniffed type */ protected function fetch_data(&$cache) @@ -23316,7 +23316,7 @@ public function get_links(string $rel = 'alternate') { } /** - * @return ?array + * @return ?array<\SimplePie\HTTP\Response> */ public function get_all_discovered_feeds() { @@ -23652,7 +23652,7 @@ class Cache * * These receive 3 parameters to their constructor, as documented in * {@see register()} - * @var array> + * @var array> */ protected static $handlers = ['mysql' => \SimplePie\Cache\MySQL::class, 'memcache' => \SimplePie\Cache\Memcache::class, 'memcached' => \SimplePie\Cache\Memcached::class, 'redis' => \SimplePie\Cache\Redis::class]; /** @@ -23660,8 +23660,8 @@ class Cache * * @param string $location URL location (scheme is used to determine handler) * @param string $filename Unique identifier for cache object - * @param Base::TYPE_FEED|Base::TYPE_IMAGE $extension 'spi' or 'spc' - * @return Base Type of object depends on scheme of `$location` + * @param \SimplePie\Cache\Base::TYPE_FEED|\SimplePie\Cache\Base::TYPE_IMAGE $extension 'spi' or 'spc' + * @return \SimplePie\Cache\Base Type of object depends on scheme of `$location` */ public static function get_handler(string $location, string $filename, $extension) { @@ -23672,8 +23672,8 @@ public static function get_handler(string $location, string $filename, $extensio * @deprecated since SimplePie 1.3.1, use {@see get_handler()} instead * @param string $location * @param string $filename - * @param Base::TYPE_FEED|Base::TYPE_IMAGE $extension - * @return Base + * @param \SimplePie\Cache\Base::TYPE_FEED|\SimplePie\Cache\Base::TYPE_IMAGE $extension + * @return \SimplePie\Cache\Base */ public function create(string $location, string $filename, $extension) { @@ -23682,7 +23682,7 @@ public function create(string $location, string $filename, $extension) * Register a handler * * @param string $type DSN type to register for - * @param class-string $class Name of handler class. Must implement Base + * @param class-string<\SimplePie\Cache\Base> $class Name of handler class. Must implement Base * @return void */ public static function register(string $type, $class) @@ -23789,7 +23789,7 @@ abstract class DB implements \SimplePie\Cache\Base * Converts a given {@see SimplePie} object into data to be stored * * @param \SimplePie\SimplePie $data - * @return array{string, array} First item is the serialized data for storage, second item is the unique ID for this item + * @return array{string, array} First item is the serialized data for storage, second item is the unique ID for this item */ protected static function prepare_simplepie_object_for_cache(\SimplePie\SimplePie $data) { @@ -23913,7 +23913,7 @@ class Memcache implements \SimplePie\Cache\Base /** * Memcache instance * - * @var NativeMemcache + * @var \Memcache */ protected $cache; /** @@ -24004,7 +24004,7 @@ class Memcached implements \SimplePie\Cache\Base { /** * NativeMemcached instance - * @var NativeMemcached + * @var \Memcached */ protected $cache; /** @@ -24180,7 +24180,7 @@ class Redis implements \SimplePie\Cache\Base /** * Redis instance * - * @var NativeRedis + * @var \Redis */ protected $cache; /** @@ -24206,7 +24206,7 @@ public function __construct(string $location, string $name, $options = null) { } /** - * @param NativeRedis $cache + * @param \Redis $cache * @return void */ public function setRedisClient(\Redis $cache) @@ -24490,13 +24490,13 @@ class Sniffer /** * File object * - * @var File|Response + * @var \SimplePie\File|\SimplePie\HTTP\Response */ public $file; /** * Create an instance of the class with the input file * - * @param File|Response $file Input file + * @param \SimplePie\File|\SimplePie\HTTP\Response $file Input file */ public function __construct( /* File */ @@ -25847,7 +25847,7 @@ public static function prepareHeaders(string $headers, int $count = 1) /** * @deprecated since SimplePie 1.7.0, use "SimplePie\HTTP\Parser" instead * @template Psr7Compatible of bool - * @extends Parser + * @extends \SimplePie\HTTP\Parser */ class SimplePie_HTTP_Parser extends \SimplePie\HTTP\Parser { @@ -26721,8 +26721,8 @@ public function set_registry(\SimplePie\Registry $registry) } /** * @param SimplePie::LOCATOR_* $type - * @param array|null $working - * @return Response|null + * @param array<\SimplePie\HTTP\Response>|null $working + * @return \SimplePie\HTTP\Response|null */ public function find(int $type = \SimplePie\SimplePie::LOCATOR_ALL, ?array &$working = null) { @@ -26740,15 +26740,15 @@ public function get_base() { } /** - * @return array|null + * @return array<\SimplePie\HTTP\Response>|null */ public function autodiscovery() { } /** * @param string[] $done - * @param array $feeds - * @return array + * @param array $feeds + * @return array */ protected function search_elements_by_tag(string $name, array &$done, array $feeds) { @@ -26769,14 +26769,14 @@ public function get_rel_link(string $rel) } /** * @param string[] $array - * @return array|null + * @return array<\SimplePie\HTTP\Response>|null */ public function extension(array &$array) { } /** * @param string[] $array - * @return array|null + * @return array<\SimplePie\HTTP\Response>|null */ public function body(array &$array) { @@ -27923,7 +27923,7 @@ public function get_data() { } /** - * @param XMLParser|resource|null $parser + * @param \XMLParser|resource|null $parser * @param array $attributes * @return void */ @@ -27931,14 +27931,14 @@ public function tag_open($parser, string $tag, array $attributes) { } /** - * @param XMLParser|resource|null $parser + * @param \XMLParser|resource|null $parser * @return void */ public function cdata($parser, string $cdata) { } /** - * @param XMLParser|resource|null $parser + * @param \XMLParser|resource|null $parser * @return void */ public function tag_close($parser, string $tag) @@ -28276,7 +28276,7 @@ public function set_registry(\SimplePie\Registry $registry) { } /** - * @param (string&(callable(string): string))|NameFilter $cache_name_function + * @param (string&(callable(string): string))|\SimplePie\Cache\NameFilter $cache_name_function * @param class-string $cache_class * @return void */ @@ -28941,7 +28941,7 @@ interface DataCache * * @return array|mixed The value of the item from the cache, or $default in case of cache miss. * - * @throws InvalidArgumentException + * @throws \InvalidArgumentException * MUST be thrown if the $key string is not a legal value. */ public function get_data(string $key, $default = null); @@ -28961,7 +28961,7 @@ public function get_data(string $key, $default = null); * * @return bool True on success and false on failure. * - * @throws InvalidArgumentException + * @throws \InvalidArgumentException * MUST be thrown if the $key string is not a legal value. */ public function set_data(string $key, array $value, ?int $ttl = null): bool; @@ -28977,7 +28977,7 @@ public function set_data(string $key, array $value, ?int $ttl = null): bool; * * @return bool True if the item was successfully removed. False if there was an error. * - * @throws InvalidArgumentException + * @throws \InvalidArgumentException * MUST be thrown if the $key string is not a legal value. */ public function delete_data(string $key): bool; @@ -29005,7 +29005,7 @@ public function __construct(\SimplePie\Cache\Base $cache) * * @return array|mixed The value of the item from the cache, or $default in case of cache miss. * - * @throws InvalidArgumentException + * @throws \InvalidArgumentException * MUST be thrown if the $key string is not a legal value. */ public function get_data(string $key, $default = null) @@ -29027,7 +29027,7 @@ public function get_data(string $key, $default = null) * * @return bool True on success and false on failure. * - * @throws InvalidArgumentException + * @throws \InvalidArgumentException * MUST be thrown if the $key string is not a legal value. */ public function set_data(string $key, array $value, ?int $ttl = null): bool @@ -29045,7 +29045,7 @@ public function set_data(string $key, array $value, ?int $ttl = null): bool * * @return bool True if the item was successfully removed. False if there was an error. * - * @throws InvalidArgumentException + * @throws \InvalidArgumentException * MUST be thrown if the $key string is not a legal value. */ public function delete_data(string $key): bool @@ -29126,7 +29126,7 @@ final class Psr16 implements \SimplePie\Cache\DataCache /** * PSR-16 cache implementation * - * @param CacheInterface $cache + * @param \Psr\SimpleCache\CacheInterface $cache */ public function __construct(\Psr\SimpleCache\CacheInterface $cache) { @@ -29144,7 +29144,7 @@ public function __construct(\Psr\SimpleCache\CacheInterface $cache) * * @return array|mixed The value of the item from the cache, or $default in case of cache miss. * - * @throws InvalidArgumentException&Throwable + * @throws \Psr\SimpleCache\InvalidArgumentException&\Throwable * MUST be thrown if the $key string is not a legal value. */ public function get_data(string $key, $default = null) @@ -29166,7 +29166,7 @@ public function get_data(string $key, $default = null) * * @return bool True on success and false on failure. * - * @throws InvalidArgumentException&Throwable + * @throws \Psr\SimpleCache\InvalidArgumentException&\Throwable * MUST be thrown if the $key string is not a legal value. */ public function set_data(string $key, array $value, ?int $ttl = null): bool @@ -29184,7 +29184,7 @@ public function set_data(string $key, array $value, ?int $ttl = null): bool * * @return bool True if the item was successfully removed. False if there was an error. * - * @throws InvalidArgumentException&Throwable + * @throws \Psr\SimpleCache\InvalidArgumentException&\Throwable * MUST be thrown if the $key string is not a legal value. */ public function delete_data(string $key): bool @@ -31079,7 +31079,7 @@ interface DiscoveryStrategy * @return array The return value is always an array with zero or more elements. Each * element is an array with two keys ['class' => string, 'condition' => mixed]. * - * @throws StrategyUnavailableException if we cannot use this strategy + * @throws \WordPress\AiClientDependencies\Http\Discovery\Exception\StrategyUnavailableException if we cannot use this strategy */ public static function getCandidates($type); } @@ -31128,8 +31128,8 @@ public static function getCandidates($type) * * @since 1.1.0 * - * @param Psr17Factory $psr17Factory The PSR-17 factory for creating HTTP messages. - * @return ClientInterface The PSR-18 HTTP client. + * @param \WordPress\AiClientDependencies\Nyholm\Psr7\Factory\Psr17Factory $psr17Factory The PSR-17 factory for creating HTTP messages. + * @return \WordPress\AiClientDependencies\Psr\Http\Client\ClientInterface The PSR-18 HTTP client. */ abstract protected static function createClient(\WordPress\AiClientDependencies\Nyholm\Psr7\Factory\Psr17Factory $psr17Factory): \WordPress\AiClientDependencies\Psr\Http\Client\ClientInterface; } @@ -31152,8 +31152,8 @@ class WP_AI_Client_Discovery_Strategy extends \WordPress\AiClient\Providers\Http * * @since 7.0.0 * - * @param Psr17Factory $psr17_factory The PSR-17 factory for creating HTTP messages. - * @return ClientInterface The PSR-18 HTTP client. + * @param \WordPress\AiClientDependencies\Nyholm\Psr7\Factory\Psr17Factory $psr17_factory The PSR-17 factory for creating HTTP messages. + * @return \WordPress\AiClientDependencies\Psr\Http\Client\ClientInterface The PSR-18 HTTP client. */ protected static function createClient(\WordPress\AiClientDependencies\Nyholm\Psr7\Factory\Psr17Factory $psr17_factory): \WordPress\AiClientDependencies\Psr\Http\Client\ClientInterface { @@ -31213,9 +31213,9 @@ interface ClientInterface /** * Sends a PSR-7 request and returns a PSR-7 response. * - * @param RequestInterface $request + * @param \WordPress\AiClientDependencies\Psr\Http\Message\RequestInterface $request * - * @return ResponseInterface + * @return \WordPress\AiClientDependencies\Psr\Http\Message\ResponseInterface * * @throws \Psr\Http\Client\ClientExceptionInterface If an error happens while processing the request. */ @@ -31238,9 +31238,9 @@ interface ClientWithOptionsInterface * * @since 0.2.0 * - * @param RequestInterface $request The PSR-7 request to send. - * @param RequestOptions $options The request transport options. Must not be null. - * @return ResponseInterface The PSR-7 response received. + * @param \WordPress\AiClientDependencies\Psr\Http\Message\RequestInterface $request The PSR-7 request to send. + * @param \WordPress\AiClient\Providers\Http\DTO\RequestOptions $options The request transport options. Must not be null. + * @return \WordPress\AiClientDependencies\Psr\Http\Message\ResponseInterface The PSR-7 response received. */ public function sendRequestWithOptions(\WordPress\AiClientDependencies\Psr\Http\Message\RequestInterface $request, \WordPress\AiClient\Providers\Http\DTO\RequestOptions $options): \WordPress\AiClientDependencies\Psr\Http\Message\ResponseInterface; } @@ -31263,8 +31263,8 @@ class WP_AI_Client_HTTP_Client implements \WordPress\AiClientDependencies\Psr\Ht * * @since 7.0.0 * - * @param ResponseFactoryInterface $response_factory PSR-17 Response factory. - * @param StreamFactoryInterface $stream_factory PSR-17 Stream factory. + * @param \WordPress\AiClientDependencies\Psr\Http\Message\ResponseFactoryInterface $response_factory PSR-17 Response factory. + * @param \WordPress\AiClientDependencies\Psr\Http\Message\StreamFactoryInterface $stream_factory PSR-17 Stream factory. */ public function __construct(\WordPress\AiClientDependencies\Psr\Http\Message\ResponseFactoryInterface $response_factory, \WordPress\AiClientDependencies\Psr\Http\Message\StreamFactoryInterface $stream_factory) { @@ -31274,10 +31274,10 @@ public function __construct(\WordPress\AiClientDependencies\Psr\Http\Message\Res * * @since 7.0.0 * - * @param RequestInterface $request The PSR-7 request. - * @return ResponseInterface The PSR-7 response. + * @param \WordPress\AiClientDependencies\Psr\Http\Message\RequestInterface $request The PSR-7 request. + * @return \WordPress\AiClientDependencies\Psr\Http\Message\ResponseInterface The PSR-7 response. * - * @throws NetworkException If the WordPress HTTP request fails. + * @throws \WordPress\AiClient\Providers\Http\Exception\NetworkException If the WordPress HTTP request fails. */ public function sendRequest(\WordPress\AiClientDependencies\Psr\Http\Message\RequestInterface $request): \WordPress\AiClientDependencies\Psr\Http\Message\ResponseInterface { @@ -31287,11 +31287,11 @@ public function sendRequest(\WordPress\AiClientDependencies\Psr\Http\Message\Req * * @since 7.0.0 * - * @param RequestInterface $request The PSR-7 request. - * @param RequestOptions $options Transport options for the request. - * @return ResponseInterface The PSR-7 response. + * @param \WordPress\AiClientDependencies\Psr\Http\Message\RequestInterface $request The PSR-7 request. + * @param \WordPress\AiClient\Providers\Http\DTO\RequestOptions $options Transport options for the request. + * @return \WordPress\AiClientDependencies\Psr\Http\Message\ResponseInterface The PSR-7 response. * - * @throws NetworkException If the WordPress HTTP request fails. + * @throws \WordPress\AiClient\Providers\Http\Exception\NetworkException If the WordPress HTTP request fails. */ public function sendRequestWithOptions(\WordPress\AiClientDependencies\Psr\Http\Message\RequestInterface $request, \WordPress\AiClient\Providers\Http\DTO\RequestOptions $options): \WordPress\AiClientDependencies\Psr\Http\Message\ResponseInterface { @@ -31323,7 +31323,7 @@ public function __construct(...$abilities) * * @since 7.0.0 * - * @param FunctionCall $call The function call to check. + * @param \WordPress\AiClient\Tools\DTO\FunctionCall $call The function call to check. * @return bool True if the function call is an ability call, false otherwise. */ public function is_ability_call(\WordPress\AiClient\Tools\DTO\FunctionCall $call): bool @@ -31338,8 +31338,8 @@ public function is_ability_call(\WordPress\AiClient\Tools\DTO\FunctionCall $call * * @since 7.0.0 * - * @param FunctionCall $call The function call to execute. - * @return FunctionResponse The response from executing the ability. + * @param \WordPress\AiClient\Tools\DTO\FunctionCall $call The function call to execute. + * @return \WordPress\AiClient\Tools\DTO\FunctionResponse The response from executing the ability. */ public function execute_ability(\WordPress\AiClient\Tools\DTO\FunctionCall $call): \WordPress\AiClient\Tools\DTO\FunctionResponse { @@ -31349,7 +31349,7 @@ public function execute_ability(\WordPress\AiClient\Tools\DTO\FunctionCall $call * * @since 7.0.0 * - * @param Message $message The message to check. + * @param \WordPress\AiClient\Messages\DTO\Message $message The message to check. * @return bool True if the message contains ability calls, false otherwise. */ public function has_ability_calls(\WordPress\AiClient\Messages\DTO\Message $message): bool @@ -31360,8 +31360,8 @@ public function has_ability_calls(\WordPress\AiClient\Messages\DTO\Message $mess * * @since 7.0.0 * - * @param Message $message The message containing function calls. - * @return Message A new message with function responses. + * @param \WordPress\AiClient\Messages\DTO\Message $message The message containing function calls. + * @return \WordPress\AiClient\Messages\DTO\Message A new message with function responses. */ public function execute_abilities(\WordPress\AiClient\Messages\DTO\Message $message): \WordPress\AiClient\Messages\DTO\Message { @@ -31410,16 +31410,16 @@ public static function function_name_to_ability_name(string $function_name): str * * @since 7.0.0 * - * @phpstan-import-type Prompt from PromptBuilder + * @phpstan-import-type Prompt from \WordPress\AiClient\Builders\PromptBuilder * * @method self with_text(string $text) Adds text to the current message. * @method self with_file($file, ?string $mimeType = null) Adds a file to the current message. - * @method self with_function_response(FunctionResponse $functionResponse) Adds a function response to the current message. - * @method self with_message_parts(MessagePart ...$parts) Adds message parts to the current message. - * @method self with_history(Message ...$messages) Adds conversation history messages. - * @method self using_model(ModelInterface $model) Sets the model to use for generation. + * @method self with_function_response(\WordPress\AiClient\Tools\DTO\FunctionResponse $functionResponse) Adds a function response to the current message. + * @method self with_message_parts(\WordPress\AiClient\Messages\DTO\MessagePart ...$parts) Adds message parts to the current message. + * @method self with_history(\WordPress\AiClient\Messages\DTO\Message ...$messages) Adds conversation history messages. + * @method self using_model(\WordPress\AiClient\Providers\Models\Contracts\ModelInterface $model) Sets the model to use for generation. * @method self using_model_preference(...$preferredModels) Sets preferred models to evaluate in order. - * @method self using_model_config(ModelConfig $config) Sets the model configuration. + * @method self using_model_config(\WordPress\AiClient\Providers\Models\DTO\ModelConfig $config) Sets the model configuration. * @method self using_provider(string $providerIdOrClassName) Sets the provider to use for generation. * @method self using_system_instruction(string $systemInstruction) Sets the system instruction. * @method self using_max_tokens(int $maxTokens) Sets the maximum number of tokens to generate. @@ -31428,21 +31428,21 @@ public static function function_name_to_ability_name(string $function_name): str * @method self using_top_k(int $topK) Sets the top-k value for generation. * @method self using_stop_sequences(string ...$stopSequences) Sets stop sequences for generation. * @method self using_candidate_count(int $candidateCount) Sets the number of candidates to generate. - * @method self using_function_declarations(FunctionDeclaration ...$functionDeclarations) Sets the function declarations available to the model. + * @method self using_function_declarations(\WordPress\AiClient\Tools\DTO\FunctionDeclaration ...$functionDeclarations) Sets the function declarations available to the model. * @method self using_presence_penalty(float $presencePenalty) Sets the presence penalty for generation. * @method self using_frequency_penalty(float $frequencyPenalty) Sets the frequency penalty for generation. - * @method self using_web_search(WebSearch $webSearch) Sets the web search configuration. - * @method self using_request_options(RequestOptions $options) Sets the request options for HTTP transport. + * @method self using_web_search(\WordPress\AiClient\Tools\DTO\WebSearch $webSearch) Sets the web search configuration. + * @method self using_request_options(\WordPress\AiClient\Providers\Http\DTO\RequestOptions $options) Sets the request options for HTTP transport. * @method self using_top_logprobs(?int $topLogprobs = null) Sets the top log probabilities configuration. * @method self as_output_mime_type(string $mimeType) Sets the output MIME type. * @method self as_output_schema(array $schema) Sets the output schema. - * @method self as_output_modalities(ModalityEnum ...$modalities) Sets the output modalities. - * @method self as_output_file_type(FileTypeEnum $fileType) Sets the output file type. - * @method self as_output_media_orientation(MediaOrientationEnum $orientation) Sets the output media orientation. + * @method self as_output_modalities(\WordPress\AiClient\Messages\Enums\ModalityEnum ...$modalities) Sets the output modalities. + * @method self as_output_file_type(\WordPress\AiClient\Files\Enums\FileTypeEnum $fileType) Sets the output file type. + * @method self as_output_media_orientation(\WordPress\AiClient\Files\Enums\MediaOrientationEnum $orientation) Sets the output media orientation. * @method self as_output_media_aspect_ratio(string $aspectRatio) Sets the output media aspect ratio. * @method self as_output_speech_voice(string $voice) Sets the output speech voice. * @method self as_json_response(?array $schema = null) Configures the prompt for JSON response output. - * @method bool|WP_Error is_supported(?CapabilityEnum $capability = null) Checks if the prompt is supported for the given capability. + * @method bool|WP_Error is_supported(?\WordPress\AiClient\Providers\Models\Enums\CapabilityEnum $capability = null) Checks if the prompt is supported for the given capability. * @method bool is_supported_for_text_generation() Checks if the prompt is supported for text generation. * @method bool is_supported_for_image_generation() Checks if the prompt is supported for image generation. * @method bool is_supported_for_text_to_speech_conversion() Checks if the prompt is supported for text to speech conversion. @@ -31450,22 +31450,22 @@ public static function function_name_to_ability_name(string $function_name): str * @method bool is_supported_for_speech_generation() Checks if the prompt is supported for speech generation. * @method bool is_supported_for_music_generation() Checks if the prompt is supported for music generation. * @method bool is_supported_for_embedding_generation() Checks if the prompt is supported for embedding generation. - * @method GenerativeAiResult|WP_Error generate_result(?CapabilityEnum $capability = null) Generates a result from the prompt. - * @method GenerativeAiResult|WP_Error generate_text_result() Generates a text result from the prompt. - * @method GenerativeAiResult|WP_Error generate_image_result() Generates an image result from the prompt. - * @method GenerativeAiResult|WP_Error generate_speech_result() Generates a speech result from the prompt. - * @method GenerativeAiResult|WP_Error convert_text_to_speech_result() Converts text to speech and returns the result. - * @method GenerativeAiResult|WP_Error generate_video_result() Generates a video result from the prompt. + * @method \WordPress\AiClient\Results\DTO\GenerativeAiResult|WP_Error generate_result(?\WordPress\AiClient\Providers\Models\Enums\CapabilityEnum $capability = null) Generates a result from the prompt. + * @method \WordPress\AiClient\Results\DTO\GenerativeAiResult|WP_Error generate_text_result() Generates a text result from the prompt. + * @method \WordPress\AiClient\Results\DTO\GenerativeAiResult|WP_Error generate_image_result() Generates an image result from the prompt. + * @method \WordPress\AiClient\Results\DTO\GenerativeAiResult|WP_Error generate_speech_result() Generates a speech result from the prompt. + * @method \WordPress\AiClient\Results\DTO\GenerativeAiResult|WP_Error convert_text_to_speech_result() Converts text to speech and returns the result. + * @method \WordPress\AiClient\Results\DTO\GenerativeAiResult|WP_Error generate_video_result() Generates a video result from the prompt. * @method string|WP_Error generate_text() Generates text from the prompt. * @method list|WP_Error generate_texts(?int $candidateCount = null) Generates multiple text candidates from the prompt. - * @method File|WP_Error generate_image() Generates an image from the prompt. - * @method list|WP_Error generate_images(?int $candidateCount = null) Generates multiple images from the prompt. - * @method File|WP_Error convert_text_to_speech() Converts text to speech. - * @method list|WP_Error convert_text_to_speeches(?int $candidateCount = null) Converts text to multiple speech outputs. - * @method File|WP_Error generate_speech() Generates speech from the prompt. - * @method list|WP_Error generate_speeches(?int $candidateCount = null) Generates multiple speech outputs from the prompt. - * @method File|WP_Error generate_video() Generates a video from the prompt. - * @method list|WP_Error generate_videos(?int $candidateCount = null) Generates multiple videos from the prompt. + * @method \WordPress\AiClient\Files\DTO\File|WP_Error generate_image() Generates an image from the prompt. + * @method list<\WordPress\AiClient\Files\DTO\File>|WP_Error generate_images(?int $candidateCount = null) Generates multiple images from the prompt. + * @method \WordPress\AiClient\Files\DTO\File|WP_Error convert_text_to_speech() Converts text to speech. + * @method list<\WordPress\AiClient\Files\DTO\File>|WP_Error convert_text_to_speeches(?int $candidateCount = null) Converts text to multiple speech outputs. + * @method \WordPress\AiClient\Files\DTO\File|WP_Error generate_speech() Generates speech from the prompt. + * @method list<\WordPress\AiClient\Files\DTO\File>|WP_Error generate_speeches(?int $candidateCount = null) Generates multiple speech outputs from the prompt. + * @method \WordPress\AiClient\Files\DTO\File|WP_Error generate_video() Generates a video from the prompt. + * @method list<\WordPress\AiClient\Files\DTO\File>|WP_Error generate_videos(?int $candidateCount = null) Generates multiple videos from the prompt. */ class WP_AI_Client_Prompt_Builder { @@ -31474,7 +31474,7 @@ class WP_AI_Client_Prompt_Builder * * @since 7.0.0 * - * @param ProviderRegistry $registry The provider registry for finding suitable models. + * @param \WordPress\AiClient\Providers\ProviderRegistry $registry The provider registry for finding suitable models. * @param Prompt $prompt Optional. Initial prompt content. * A string for simple text prompts, * a MessagePart or Message object for @@ -73535,7 +73535,7 @@ public function translate($singular, $context = '') * * @since 0.1.0 * - * @phpstan-import-type Prompt from PromptBuilder + * @phpstan-import-type Prompt from \WordPress\AiClient\Builders\PromptBuilder * * phpcs:ignore Generic.Files.LineLength.TooLong */ @@ -73550,7 +73550,7 @@ class AiClient * * @since 0.1.0 * - * @return ProviderRegistry The default provider registry. + * @return \WordPress\AiClient\Providers\ProviderRegistry The default provider registry. */ public static function defaultRegistry(): \WordPress\AiClient\Providers\ProviderRegistry { @@ -73563,7 +73563,7 @@ public static function defaultRegistry(): \WordPress\AiClient\Providers\Provider * * @since 0.4.0 * - * @param EventDispatcherInterface|null $dispatcher The event dispatcher, or null to disable. + * @param \WordPress\AiClientDependencies\Psr\EventDispatcher\EventDispatcherInterface|null $dispatcher The event dispatcher, or null to disable. * @return void */ public static function setEventDispatcher(?\WordPress\AiClientDependencies\Psr\EventDispatcher\EventDispatcherInterface $dispatcher): void @@ -73574,7 +73574,7 @@ public static function setEventDispatcher(?\WordPress\AiClientDependencies\Psr\E * * @since 0.4.0 * - * @return EventDispatcherInterface|null The event dispatcher, or null if not set. + * @return \WordPress\AiClientDependencies\Psr\EventDispatcher\EventDispatcherInterface|null The event dispatcher, or null if not set. */ public static function getEventDispatcher(): ?\WordPress\AiClientDependencies\Psr\EventDispatcher\EventDispatcherInterface { @@ -73587,7 +73587,7 @@ public static function getEventDispatcher(): ?\WordPress\AiClientDependencies\Ps * * @since 0.4.0 * - * @param CacheInterface|null $cache The PSR-16 cache instance, or null to disable caching. + * @param \WordPress\AiClientDependencies\Psr\SimpleCache\CacheInterface|null $cache The PSR-16 cache instance, or null to disable caching. * @return void */ public static function setCache(?\WordPress\AiClientDependencies\Psr\SimpleCache\CacheInterface $cache): void @@ -73598,7 +73598,7 @@ public static function setCache(?\WordPress\AiClientDependencies\Psr\SimpleCache * * @since 0.4.0 * - * @return CacheInterface|null The cache instance, or null if not set. + * @return \WordPress\AiClientDependencies\Psr\SimpleCache\CacheInterface|null The cache instance, or null if not set. */ public static function getCache(): ?\WordPress\AiClientDependencies\Psr\SimpleCache\CacheInterface { @@ -73618,7 +73618,7 @@ public static function getCache(): ?\WordPress\AiClientDependencies\Psr\SimpleCa * @since 0.1.0 * @since 0.2.0 Now supports being passed a provider ID or class name. * - * @param ProviderAvailabilityInterface|string|class-string $availabilityOrIdOrClassName + * @param \WordPress\AiClient\Providers\Contracts\ProviderAvailabilityInterface|string|class-string<\WordPress\AiClient\Providers\Contracts\ProviderInterface> $availabilityOrIdOrClassName * The provider availability instance, provider ID, or provider class name. * @return bool True if the provider is configured and available, false otherwise. */ @@ -73635,8 +73635,8 @@ public static function isConfigured($availabilityOrIdOrClassName): bool * @since 0.1.0 * * @param Prompt $prompt Optional initial prompt content. - * @param ProviderRegistry|null $registry Optional custom registry. If null, uses default. - * @return PromptBuilder The prompt builder instance. + * @param \WordPress\AiClient\Providers\ProviderRegistry|null $registry Optional custom registry. If null, uses default. + * @return \WordPress\AiClient\Builders\PromptBuilder The prompt builder instance. */ public static function prompt($prompt = null, ?\WordPress\AiClient\Providers\ProviderRegistry $registry = null): \WordPress\AiClient\Builders\PromptBuilder { @@ -73651,10 +73651,10 @@ public static function prompt($prompt = null, ?\WordPress\AiClient\Providers\Pro * @since 0.1.0 * * @param Prompt $prompt The prompt content. - * @param ModelInterface|ModelConfig $modelOrConfig Specific model to use, or model configuration + * @param \WordPress\AiClient\Providers\Models\Contracts\ModelInterface|\WordPress\AiClient\Providers\Models\DTO\ModelConfig $modelOrConfig Specific model to use, or model configuration * for auto-discovery. - * @param ProviderRegistry|null $registry Optional custom registry. If null, uses default. - * @return GenerativeAiResult The generation result. + * @param \WordPress\AiClient\Providers\ProviderRegistry|null $registry Optional custom registry. If null, uses default. + * @return \WordPress\AiClient\Results\DTO\GenerativeAiResult The generation result. * * @throws \InvalidArgumentException If the provided model doesn't support any known generation type. * @throws \RuntimeException If no suitable model can be found for the prompt. @@ -73668,11 +73668,11 @@ public static function generateResult($prompt, $modelOrConfig, ?\WordPress\AiCli * @since 0.1.0 * * @param Prompt $prompt The prompt content. - * @param ModelInterface|ModelConfig|null $modelOrConfig Optional specific model to use, + * @param \WordPress\AiClient\Providers\Models\Contracts\ModelInterface|\WordPress\AiClient\Providers\Models\DTO\ModelConfig|null $modelOrConfig Optional specific model to use, * or model configuration for auto-discovery, * or null for defaults. - * @param ProviderRegistry|null $registry Optional custom registry. If null, uses default. - * @return GenerativeAiResult The generation result. + * @param \WordPress\AiClient\Providers\ProviderRegistry|null $registry Optional custom registry. If null, uses default. + * @return \WordPress\AiClient\Results\DTO\GenerativeAiResult The generation result. * * @throws \InvalidArgumentException If the prompt format is invalid. * @throws \RuntimeException If no suitable model is found. @@ -73686,11 +73686,11 @@ public static function generateTextResult($prompt, $modelOrConfig = null, ?\Word * @since 0.1.0 * * @param Prompt $prompt The prompt content. - * @param ModelInterface|ModelConfig|null $modelOrConfig Optional specific model to use, + * @param \WordPress\AiClient\Providers\Models\Contracts\ModelInterface|\WordPress\AiClient\Providers\Models\DTO\ModelConfig|null $modelOrConfig Optional specific model to use, * or model configuration for auto-discovery, * or null for defaults. - * @param ProviderRegistry|null $registry Optional custom registry. If null, uses default. - * @return GenerativeAiResult The generation result. + * @param \WordPress\AiClient\Providers\ProviderRegistry|null $registry Optional custom registry. If null, uses default. + * @return \WordPress\AiClient\Results\DTO\GenerativeAiResult The generation result. * * @throws \InvalidArgumentException If the prompt format is invalid. * @throws \RuntimeException If no suitable model is found. @@ -73704,11 +73704,11 @@ public static function generateImageResult($prompt, $modelOrConfig = null, ?\Wor * @since 0.1.0 * * @param Prompt $prompt The prompt content. - * @param ModelInterface|ModelConfig|null $modelOrConfig Optional specific model to use, + * @param \WordPress\AiClient\Providers\Models\Contracts\ModelInterface|\WordPress\AiClient\Providers\Models\DTO\ModelConfig|null $modelOrConfig Optional specific model to use, * or model configuration for auto-discovery, * or null for defaults. - * @param ProviderRegistry|null $registry Optional custom registry. If null, uses default. - * @return GenerativeAiResult The generation result. + * @param \WordPress\AiClient\Providers\ProviderRegistry|null $registry Optional custom registry. If null, uses default. + * @return \WordPress\AiClient\Results\DTO\GenerativeAiResult The generation result. * * @throws \InvalidArgumentException If the prompt format is invalid. * @throws \RuntimeException If no suitable model is found. @@ -73722,11 +73722,11 @@ public static function convertTextToSpeechResult($prompt, $modelOrConfig = null, * @since 0.1.0 * * @param Prompt $prompt The prompt content. - * @param ModelInterface|ModelConfig|null $modelOrConfig Optional specific model to use, + * @param \WordPress\AiClient\Providers\Models\Contracts\ModelInterface|\WordPress\AiClient\Providers\Models\DTO\ModelConfig|null $modelOrConfig Optional specific model to use, * or model configuration for auto-discovery, * or null for defaults. - * @param ProviderRegistry|null $registry Optional custom registry. If null, uses default. - * @return GenerativeAiResult The generation result. + * @param \WordPress\AiClient\Providers\ProviderRegistry|null $registry Optional custom registry. If null, uses default. + * @return \WordPress\AiClient\Results\DTO\GenerativeAiResult The generation result. * * @throws \InvalidArgumentException If the prompt format is invalid. * @throws \RuntimeException If no suitable model is found. @@ -73740,11 +73740,11 @@ public static function generateSpeechResult($prompt, $modelOrConfig = null, ?\Wo * @since 1.3.0 * * @param Prompt $prompt The prompt content. - * @param ModelInterface|ModelConfig|null $modelOrConfig Optional specific model to use, + * @param \WordPress\AiClient\Providers\Models\Contracts\ModelInterface|\WordPress\AiClient\Providers\Models\DTO\ModelConfig|null $modelOrConfig Optional specific model to use, * or model configuration for auto-discovery, * or null for defaults. - * @param ProviderRegistry|null $registry Optional custom registry. If null, uses default. - * @return GenerativeAiResult The generation result. + * @param \WordPress\AiClient\Providers\ProviderRegistry|null $registry Optional custom registry. If null, uses default. + * @return \WordPress\AiClient\Results\DTO\GenerativeAiResult The generation result. * * @throws \InvalidArgumentException If the prompt format is invalid. * @throws \RuntimeException If no suitable model is found. @@ -73780,18 +73780,18 @@ public static function message(?string $text = null) * * @since 0.2.0 * - * @phpstan-import-type MessagePartArrayShape from MessagePart + * @phpstan-import-type MessagePartArrayShape from \WordPress\AiClient\Messages\DTO\MessagePart * - * @phpstan-type Input string|MessagePart|MessagePartArrayShape|File|FunctionCall|FunctionResponse|null + * @phpstan-type Input string|\WordPress\AiClient\Messages\DTO\MessagePart|MessagePartArrayShape|\WordPress\AiClient\Files\DTO\File|\WordPress\AiClient\Tools\DTO\FunctionCall|\WordPress\AiClient\Tools\DTO\FunctionResponse|null */ class MessageBuilder { /** - * @var MessageRoleEnum|null The role of the message sender. + * @var \WordPress\AiClient\Messages\Enums\MessageRoleEnum|null The role of the message sender. */ protected ?\WordPress\AiClient\Messages\Enums\MessageRoleEnum $role = null; /** - * @var list The parts that make up the message. + * @var list<\WordPress\AiClient\Messages\DTO\MessagePart> The parts that make up the message. */ protected array $parts = []; /** @@ -73800,7 +73800,7 @@ class MessageBuilder * @since 0.2.0 * * @param Input $input Optional initial content. - * @param MessageRoleEnum|null $role Optional role. + * @param \WordPress\AiClient\Messages\Enums\MessageRoleEnum|null $role Optional role. * @phpstan-return void */ public function __construct($input = null, ?\WordPress\AiClient\Messages\Enums\MessageRoleEnum $role = null) @@ -73822,7 +73822,7 @@ public function __clone() * * @since 0.2.0 * - * @param MessageRoleEnum $role The role to set. + * @param \WordPress\AiClient\Messages\Enums\MessageRoleEnum $role The role to set. * @return self */ public function usingRole(\WordPress\AiClient\Messages\Enums\MessageRoleEnum $role): self @@ -73855,7 +73855,7 @@ public function usingModelRole(): self * * @param string $text The text to add. * @return self - * @throws InvalidArgumentException If the text is empty. + * @throws \InvalidArgumentException If the text is empty. */ public function withText(string $text): self { @@ -73872,10 +73872,10 @@ public function withText(string $text): self * * @since 0.2.0 * - * @param string|File $file The file to add. + * @param string|\WordPress\AiClient\Files\DTO\File $file The file to add. * @param string|null $mimeType Optional MIME type (ignored if File object provided). * @return self - * @throws InvalidArgumentException If the file is invalid. + * @throws \InvalidArgumentException If the file is invalid. */ public function withFile($file, ?string $mimeType = null): self { @@ -73885,7 +73885,7 @@ public function withFile($file, ?string $mimeType = null): self * * @since 0.2.0 * - * @param FunctionCall $functionCall The function call to add. + * @param \WordPress\AiClient\Tools\DTO\FunctionCall $functionCall The function call to add. * @return self */ public function withFunctionCall(\WordPress\AiClient\Tools\DTO\FunctionCall $functionCall): self @@ -73896,7 +73896,7 @@ public function withFunctionCall(\WordPress\AiClient\Tools\DTO\FunctionCall $fun * * @since 0.2.0 * - * @param FunctionResponse $functionResponse The function response to add. + * @param \WordPress\AiClient\Tools\DTO\FunctionResponse $functionResponse The function response to add. * @return self */ public function withFunctionResponse(\WordPress\AiClient\Tools\DTO\FunctionResponse $functionResponse): self @@ -73907,7 +73907,7 @@ public function withFunctionResponse(\WordPress\AiClient\Tools\DTO\FunctionRespo * * @since 0.2.0 * - * @param MessagePart ...$parts The message parts to add. + * @param \WordPress\AiClient\Messages\DTO\MessagePart ...$parts The message parts to add. * @return self */ public function withMessageParts(\WordPress\AiClient\Messages\DTO\MessagePart ...$parts): self @@ -73918,8 +73918,8 @@ public function withMessageParts(\WordPress\AiClient\Messages\DTO\MessagePart .. * * @since 0.2.0 * - * @return Message The built message. - * @throws InvalidArgumentException If the message validation fails. + * @return \WordPress\AiClient\Messages\DTO\Message The built message. + * @throws \InvalidArgumentException If the message validation fails. */ public function get(): \WordPress\AiClient\Messages\DTO\Message { @@ -73934,19 +73934,19 @@ public function get(): \WordPress\AiClient\Messages\DTO\Message * * @since 0.1.0 * - * @phpstan-import-type MessageArrayShape from Message - * @phpstan-import-type MessagePartArrayShape from MessagePart + * @phpstan-import-type MessageArrayShape from \WordPress\AiClient\Messages\DTO\Message + * @phpstan-import-type MessagePartArrayShape from \WordPress\AiClient\Messages\DTO\MessagePart * - * @phpstan-type Prompt string|MessagePart|Message|MessageArrayShape|list|list|null + * @phpstan-type Prompt string|\WordPress\AiClient\Messages\DTO\MessagePart|\WordPress\AiClient\Messages\DTO\Message|MessageArrayShape|list|list<\WordPress\AiClient\Messages\DTO\Message>|null */ class PromptBuilder { /** - * @var list The messages in the conversation. + * @var list<\WordPress\AiClient\Messages\DTO\Message> The messages in the conversation. */ protected array $messages = []; /** - * @var ModelInterface|null The model to use for generation. + * @var \WordPress\AiClient\Providers\Models\Contracts\ModelInterface|null The model to use for generation. */ protected ?\WordPress\AiClient\Providers\Models\Contracts\ModelInterface $model = null; /** @@ -73958,11 +73958,11 @@ class PromptBuilder */ protected ?string $providerIdOrClassName = null; /** - * @var ModelConfig The model configuration. + * @var \WordPress\AiClient\Providers\Models\DTO\ModelConfig The model configuration. */ protected \WordPress\AiClient\Providers\Models\DTO\ModelConfig $modelConfig; /** - * @var RequestOptions|null The request options for HTTP transport. + * @var \WordPress\AiClient\Providers\Http\DTO\RequestOptions|null The request options for HTTP transport. */ protected ?\WordPress\AiClient\Providers\Http\DTO\RequestOptions $requestOptions = null; /** @@ -73970,9 +73970,9 @@ class PromptBuilder * * @since 0.1.0 * - * @param ProviderRegistry $registry The provider registry for finding suitable models. + * @param \WordPress\AiClient\Providers\ProviderRegistry $registry The provider registry for finding suitable models. * @param Prompt $prompt Optional initial prompt content. - * @param EventDispatcherInterface|null $eventDispatcher Optional event dispatcher for lifecycle events. + * @param \WordPress\AiClientDependencies\Psr\EventDispatcher\EventDispatcherInterface|null $eventDispatcher Optional event dispatcher for lifecycle events. * @phpstan-return void */ public function __construct(\WordPress\AiClient\Providers\ProviderRegistry $registry, $prompt = null, ?\WordPress\AiClientDependencies\Psr\EventDispatcher\EventDispatcherInterface $eventDispatcher = null) @@ -74013,10 +74013,10 @@ public function withText(string $text): self * * @since 0.1.0 * - * @param string|File $file The file (File object or string representation). + * @param string|\WordPress\AiClient\Files\DTO\File $file The file (File object or string representation). * @param string|null $mimeType The MIME type (optional, ignored if File object provided). * @return self - * @throws InvalidArgumentException If the file is invalid or MIME type cannot be determined. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the file is invalid or MIME type cannot be determined. */ public function withFile($file, ?string $mimeType = null): self { @@ -74026,7 +74026,7 @@ public function withFile($file, ?string $mimeType = null): self * * @since 0.1.0 * - * @param FunctionResponse $functionResponse The function response. + * @param \WordPress\AiClient\Tools\DTO\FunctionResponse $functionResponse The function response. * @return self */ public function withFunctionResponse(\WordPress\AiClient\Tools\DTO\FunctionResponse $functionResponse): self @@ -74037,7 +74037,7 @@ public function withFunctionResponse(\WordPress\AiClient\Tools\DTO\FunctionRespo * * @since 0.1.0 * - * @param MessagePart ...$parts The message parts to add. + * @param \WordPress\AiClient\Messages\DTO\MessagePart ...$parts The message parts to add. * @return self */ public function withMessageParts(\WordPress\AiClient\Messages\DTO\MessagePart ...$parts): self @@ -74051,7 +74051,7 @@ public function withMessageParts(\WordPress\AiClient\Messages\DTO\MessagePart .. * * @since 0.1.0 * - * @param Message ...$messages The messages to add to history. + * @param \WordPress\AiClient\Messages\DTO\Message ...$messages The messages to add to history. * @return self */ public function withHistory(\WordPress\AiClient\Messages\DTO\Message ...$messages): self @@ -74065,7 +74065,7 @@ public function withHistory(\WordPress\AiClient\Messages\DTO\Message ...$message * * @since 0.1.0 * - * @param ModelInterface $model The model to use. + * @param \WordPress\AiClient\Providers\Models\Contracts\ModelInterface $model The model to use. * @return self */ public function usingModel(\WordPress\AiClient\Providers\Models\Contracts\ModelInterface $model): self @@ -74076,13 +74076,13 @@ public function usingModel(\WordPress\AiClient\Providers\Models\Contracts\ModelI * * @since 0.2.0 * - * @param string|ModelInterface|array{0:string,1:string} ...$preferredModels The preferred models as model IDs, + * @param string|\WordPress\AiClient\Providers\Models\Contracts\ModelInterface|array{0:string,1:string} ...$preferredModels The preferred models as model IDs, * model instances, or [provider ID, model ID] tuples. For broader compatibility, it is recommended you specify * only model IDs or model instances, as that will allow for different providers that expose the same model to be * considered. * @return self * - * @throws InvalidArgumentException When a preferred model has an invalid type or identifier. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException When a preferred model has an invalid type or identifier. */ public function usingModelPreference(...$preferredModels): self { @@ -74095,7 +74095,7 @@ public function usingModelPreference(...$preferredModels): self * * @since 0.1.0 * - * @param ModelConfig $config The model configuration to merge. + * @param \WordPress\AiClient\Providers\Models\DTO\ModelConfig $config The model configuration to merge. * @return self */ public function usingModelConfig(\WordPress\AiClient\Providers\Models\DTO\ModelConfig $config): self @@ -74197,7 +74197,7 @@ public function usingCandidateCount(int $candidateCount): self * * @since 0.1.0 * - * @param FunctionDeclaration ...$functionDeclarations The function declarations. + * @param \WordPress\AiClient\Tools\DTO\FunctionDeclaration ...$functionDeclarations The function declarations. * @return self */ public function usingFunctionDeclarations(\WordPress\AiClient\Tools\DTO\FunctionDeclaration ...$functionDeclarations): self @@ -74230,7 +74230,7 @@ public function usingFrequencyPenalty(float $frequencyPenalty): self * * @since 0.1.0 * - * @param WebSearch $webSearch The web search configuration. + * @param \WordPress\AiClient\Tools\DTO\WebSearch $webSearch The web search configuration. * @return self */ public function usingWebSearch(\WordPress\AiClient\Tools\DTO\WebSearch $webSearch): self @@ -74241,7 +74241,7 @@ public function usingWebSearch(\WordPress\AiClient\Tools\DTO\WebSearch $webSearc * * @since 0.3.0 * - * @param RequestOptions $requestOptions The request options. + * @param \WordPress\AiClient\Providers\Http\DTO\RequestOptions $requestOptions The request options. * @return self */ public function usingRequestOptions(\WordPress\AiClient\Providers\Http\DTO\RequestOptions $requestOptions): self @@ -74288,7 +74288,7 @@ public function asOutputSchema(array $schema): self * * @since 0.1.0 * - * @param ModalityEnum ...$modalities The output modalities. + * @param \WordPress\AiClient\Messages\Enums\ModalityEnum ...$modalities The output modalities. * @return self */ public function asOutputModalities(\WordPress\AiClient\Messages\Enums\ModalityEnum ...$modalities): self @@ -74299,7 +74299,7 @@ public function asOutputModalities(\WordPress\AiClient\Messages\Enums\ModalityEn * * @since 0.1.0 * - * @param FileTypeEnum $fileType The output file type. + * @param \WordPress\AiClient\Files\Enums\FileTypeEnum $fileType The output file type. * @return self */ public function asOutputFileType(\WordPress\AiClient\Files\Enums\FileTypeEnum $fileType): self @@ -74310,7 +74310,7 @@ public function asOutputFileType(\WordPress\AiClient\Files\Enums\FileTypeEnum $f * * @since 1.3.0 * - * @param MediaOrientationEnum $orientation The output media orientation. + * @param \WordPress\AiClient\Files\Enums\MediaOrientationEnum $orientation The output media orientation. * @return self */ public function asOutputMediaOrientation(\WordPress\AiClient\Files\Enums\MediaOrientationEnum $orientation): self @@ -74358,7 +74358,7 @@ public function asJsonResponse(?array $schema = null): self * @since 0.1.0 * @since 0.3.0 Method visibility changed to public. * - * @param CapabilityEnum|null $capability Optional capability to check support for. + * @param \WordPress\AiClient\Providers\Models\Enums\CapabilityEnum|null $capability Optional capability to check support for. * @return bool True if supported, false otherwise. */ public function isSupported(?\WordPress\AiClient\Providers\Models\Enums\CapabilityEnum $capability = null): bool @@ -74443,11 +74443,11 @@ public function isSupportedForEmbeddingGeneration(): bool * * @since 0.1.0 * - * @param CapabilityEnum|null $capability Optional capability to use for generation. + * @param \WordPress\AiClient\Providers\Models\Enums\CapabilityEnum|null $capability Optional capability to use for generation. * If null, capability is inferred from output modality. - * @return GenerativeAiResult The generated result containing candidates. - * @throws InvalidArgumentException If the prompt or model validation fails. - * @throws RuntimeException If the model doesn't support the required capability. + * @return \WordPress\AiClient\Results\DTO\GenerativeAiResult The generated result containing candidates. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the prompt or model validation fails. + * @throws \WordPress\AiClient\Common\Exception\RuntimeException If the model doesn't support the required capability. */ public function generateResult(?\WordPress\AiClient\Providers\Models\Enums\CapabilityEnum $capability = null): \WordPress\AiClient\Results\DTO\GenerativeAiResult { @@ -74457,9 +74457,9 @@ public function generateResult(?\WordPress\AiClient\Providers\Models\Enums\Capab * * @since 0.1.0 * - * @return GenerativeAiResult The generated result containing text candidates. - * @throws InvalidArgumentException If the prompt or model validation fails. - * @throws RuntimeException If the model doesn't support text generation. + * @return \WordPress\AiClient\Results\DTO\GenerativeAiResult The generated result containing text candidates. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the prompt or model validation fails. + * @throws \WordPress\AiClient\Common\Exception\RuntimeException If the model doesn't support text generation. */ public function generateTextResult(): \WordPress\AiClient\Results\DTO\GenerativeAiResult { @@ -74469,9 +74469,9 @@ public function generateTextResult(): \WordPress\AiClient\Results\DTO\Generative * * @since 0.1.0 * - * @return GenerativeAiResult The generated result containing image candidates. - * @throws InvalidArgumentException If the prompt or model validation fails. - * @throws RuntimeException If the model doesn't support image generation. + * @return \WordPress\AiClient\Results\DTO\GenerativeAiResult The generated result containing image candidates. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the prompt or model validation fails. + * @throws \WordPress\AiClient\Common\Exception\RuntimeException If the model doesn't support image generation. */ public function generateImageResult(): \WordPress\AiClient\Results\DTO\GenerativeAiResult { @@ -74481,9 +74481,9 @@ public function generateImageResult(): \WordPress\AiClient\Results\DTO\Generativ * * @since 0.1.0 * - * @return GenerativeAiResult The generated result containing speech audio candidates. - * @throws InvalidArgumentException If the prompt or model validation fails. - * @throws RuntimeException If the model doesn't support speech generation. + * @return \WordPress\AiClient\Results\DTO\GenerativeAiResult The generated result containing speech audio candidates. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the prompt or model validation fails. + * @throws \WordPress\AiClient\Common\Exception\RuntimeException If the model doesn't support speech generation. */ public function generateSpeechResult(): \WordPress\AiClient\Results\DTO\GenerativeAiResult { @@ -74493,9 +74493,9 @@ public function generateSpeechResult(): \WordPress\AiClient\Results\DTO\Generati * * @since 0.1.0 * - * @return GenerativeAiResult The generated result containing speech audio candidates. - * @throws InvalidArgumentException If the prompt or model validation fails. - * @throws RuntimeException If the model doesn't support text-to-speech conversion. + * @return \WordPress\AiClient\Results\DTO\GenerativeAiResult The generated result containing speech audio candidates. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the prompt or model validation fails. + * @throws \WordPress\AiClient\Common\Exception\RuntimeException If the model doesn't support text-to-speech conversion. */ public function convertTextToSpeechResult(): \WordPress\AiClient\Results\DTO\GenerativeAiResult { @@ -74505,9 +74505,9 @@ public function convertTextToSpeechResult(): \WordPress\AiClient\Results\DTO\Gen * * @since 1.3.0 * - * @return GenerativeAiResult The generated result containing video candidates. - * @throws InvalidArgumentException If the prompt or model validation fails. - * @throws RuntimeException If the model doesn't support video generation. + * @return \WordPress\AiClient\Results\DTO\GenerativeAiResult The generated result containing video candidates. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the prompt or model validation fails. + * @throws \WordPress\AiClient\Common\Exception\RuntimeException If the model doesn't support video generation. */ public function generateVideoResult(): \WordPress\AiClient\Results\DTO\GenerativeAiResult { @@ -74518,7 +74518,7 @@ public function generateVideoResult(): \WordPress\AiClient\Results\DTO\Generativ * @since 0.1.0 * * @return string The generated text. - * @throws InvalidArgumentException If the prompt or model validation fails. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the prompt or model validation fails. */ public function generateText(): string { @@ -74530,7 +74530,7 @@ public function generateText(): string * * @param int|null $candidateCount The number of candidates to generate. * @return list The generated texts. - * @throws InvalidArgumentException If the prompt or model validation fails. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the prompt or model validation fails. */ public function generateTexts(?int $candidateCount = null): array { @@ -74540,9 +74540,9 @@ public function generateTexts(?int $candidateCount = null): array * * @since 0.1.0 * - * @return File The generated image file. - * @throws InvalidArgumentException If the prompt or model validation fails. - * @throws RuntimeException If no image is generated. + * @return \WordPress\AiClient\Files\DTO\File The generated image file. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the prompt or model validation fails. + * @throws \WordPress\AiClient\Common\Exception\RuntimeException If no image is generated. */ public function generateImage(): \WordPress\AiClient\Files\DTO\File { @@ -74553,9 +74553,9 @@ public function generateImage(): \WordPress\AiClient\Files\DTO\File * @since 0.1.0 * * @param int|null $candidateCount The number of images to generate. - * @return list The generated image files. - * @throws InvalidArgumentException If the prompt or model validation fails. - * @throws RuntimeException If no images are generated. + * @return list<\WordPress\AiClient\Files\DTO\File> The generated image files. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the prompt or model validation fails. + * @throws \WordPress\AiClient\Common\Exception\RuntimeException If no images are generated. */ public function generateImages(?int $candidateCount = null): array { @@ -74565,9 +74565,9 @@ public function generateImages(?int $candidateCount = null): array * * @since 0.1.0 * - * @return File The generated speech audio file. - * @throws InvalidArgumentException If the prompt or model validation fails. - * @throws RuntimeException If no audio is generated. + * @return \WordPress\AiClient\Files\DTO\File The generated speech audio file. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the prompt or model validation fails. + * @throws \WordPress\AiClient\Common\Exception\RuntimeException If no audio is generated. */ public function convertTextToSpeech(): \WordPress\AiClient\Files\DTO\File { @@ -74578,9 +74578,9 @@ public function convertTextToSpeech(): \WordPress\AiClient\Files\DTO\File * @since 0.1.0 * * @param int|null $candidateCount The number of speech outputs to generate. - * @return list The generated speech audio files. - * @throws InvalidArgumentException If the prompt or model validation fails. - * @throws RuntimeException If no audio is generated. + * @return list<\WordPress\AiClient\Files\DTO\File> The generated speech audio files. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the prompt or model validation fails. + * @throws \WordPress\AiClient\Common\Exception\RuntimeException If no audio is generated. */ public function convertTextToSpeeches(?int $candidateCount = null): array { @@ -74590,9 +74590,9 @@ public function convertTextToSpeeches(?int $candidateCount = null): array * * @since 0.1.0 * - * @return File The generated speech audio file. - * @throws InvalidArgumentException If the prompt or model validation fails. - * @throws RuntimeException If no audio is generated. + * @return \WordPress\AiClient\Files\DTO\File The generated speech audio file. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the prompt or model validation fails. + * @throws \WordPress\AiClient\Common\Exception\RuntimeException If no audio is generated. */ public function generateSpeech(): \WordPress\AiClient\Files\DTO\File { @@ -74603,9 +74603,9 @@ public function generateSpeech(): \WordPress\AiClient\Files\DTO\File * @since 0.1.0 * * @param int|null $candidateCount The number of speech outputs to generate. - * @return list The generated speech audio files. - * @throws InvalidArgumentException If the prompt or model validation fails. - * @throws RuntimeException If no audio is generated. + * @return list<\WordPress\AiClient\Files\DTO\File> The generated speech audio files. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the prompt or model validation fails. + * @throws \WordPress\AiClient\Common\Exception\RuntimeException If no audio is generated. */ public function generateSpeeches(?int $candidateCount = null): array { @@ -74615,9 +74615,9 @@ public function generateSpeeches(?int $candidateCount = null): array * * @since 1.3.0 * - * @return File The generated video file. - * @throws InvalidArgumentException If the prompt or model validation fails. - * @throws RuntimeException If no video is generated. + * @return \WordPress\AiClient\Files\DTO\File The generated video file. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the prompt or model validation fails. + * @throws \WordPress\AiClient\Common\Exception\RuntimeException If no video is generated. */ public function generateVideo(): \WordPress\AiClient\Files\DTO\File { @@ -74628,9 +74628,9 @@ public function generateVideo(): \WordPress\AiClient\Files\DTO\File * @since 1.3.0 * * @param int|null $candidateCount The number of videos to generate. - * @return list The generated video files. - * @throws InvalidArgumentException If the prompt or model validation fails. - * @throws RuntimeException If no videos are generated. + * @return list<\WordPress\AiClient\Files\DTO\File> The generated video files. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the prompt or model validation fails. + * @throws \WordPress\AiClient\Common\Exception\RuntimeException If no videos are generated. */ public function generateVideos(?int $candidateCount = null): array { @@ -74643,7 +74643,7 @@ public function generateVideos(?int $candidateCount = null): array * * @since 0.1.0 * - * @param MessagePart $part The part to append. + * @param \WordPress\AiClient\Messages\DTO\MessagePart $part The part to append. * @return void */ protected function appendPartToMessages(\WordPress\AiClient\Messages\DTO\MessagePart $part): void @@ -74725,7 +74725,7 @@ public static function getJsonSchema(): array; * @since 0.1.0 * * @template TArrayShape of array - * @implements WithArrayTransformationInterface + * @implements \WordPress\AiClient\Common\Contracts\WithArrayTransformationInterface */ abstract class AbstractDataTransferObject implements \WordPress\AiClient\Common\Contracts\WithArrayTransformationInterface, \WordPress\AiClient\Common\Contracts\WithJsonSchemaInterface, \JsonSerializable { @@ -74736,7 +74736,7 @@ abstract class AbstractDataTransferObject implements \WordPress\AiClient\Common\ * * @param array $data The array data to validate. * @param string[] $requiredKeys The keys that must be present. - * @throws InvalidArgumentException If any required key is missing. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If any required key is missing. */ protected static function validateFromArrayData(array $data, array $requiredKeys): void { @@ -74801,7 +74801,7 @@ abstract class AbstractEnum implements \JsonSerializable * * @param string $property The property name. * @return mixed The property value. - * @throws BadMethodCallException If property doesn't exist. + * @throws \BadMethodCallException If property doesn't exist. */ final public function __get(string $property) { @@ -74813,7 +74813,7 @@ final public function __get(string $property) * * @param string $property The property name. * @param mixed $value The value to set. - * @throws BadMethodCallException Always, as enum properties are read-only. + * @throws \BadMethodCallException Always, as enum properties are read-only. */ final public function __set(string $property, $value): void { @@ -74825,7 +74825,7 @@ final public function __set(string $property, $value): void * * @param string $value The enum value. * @return static The enum instance. - * @throws InvalidArgumentException If the value is not valid. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the value is not valid. */ final public static function from(string $value): self { @@ -74900,7 +74900,7 @@ final public static function isValidValue(string $value): bool * @since 0.1.0 * * @return array Map of constant names to values. - * @throws RuntimeException If invalid constant found. + * @throws \WordPress\AiClient\Common\Exception\RuntimeException If invalid constant found. */ final protected static function getConstants(): array { @@ -74915,7 +74915,7 @@ final protected static function getConstants(): array * * @param class-string $className The fully qualified class name. * @return array Map of constant names to values. - * @throws RuntimeException If invalid constant found. + * @throws \WordPress\AiClient\Common\Exception\RuntimeException If invalid constant found. */ protected static function determineClassEnumerations(string $className): array { @@ -74928,7 +74928,7 @@ protected static function determineClassEnumerations(string $className): array * @param string $name The method name. * @param array $arguments The method arguments. * @return bool True if the enum value matches. - * @throws BadMethodCallException If the method doesn't exist. + * @throws \BadMethodCallException If the method doesn't exist. */ final public function __call(string $name, array $arguments): bool { @@ -74941,7 +74941,7 @@ final public function __call(string $name, array $arguments): bool * @param string $name The method name. * @param array $arguments The method arguments. * @return static The enum instance. - * @throws BadMethodCallException If the method doesn't exist. + * @throws \BadMethodCallException If the method doesn't exist. */ final public static function __callStatic(string $name, array $arguments): self { @@ -75194,10 +75194,10 @@ class AfterGenerateResultEvent * * @since 0.4.0 * - * @param list $messages The messages that were sent to the model. - * @param ModelInterface $model The model that processed the prompt. - * @param CapabilityEnum|null $capability The capability that was used for generation. - * @param GenerativeAiResult $result The result from the model. + * @param list<\WordPress\AiClient\Messages\DTO\Message> $messages The messages that were sent to the model. + * @param \WordPress\AiClient\Providers\Models\Contracts\ModelInterface $model The model that processed the prompt. + * @param \WordPress\AiClient\Providers\Models\Enums\CapabilityEnum|null $capability The capability that was used for generation. + * @param \WordPress\AiClient\Results\DTO\GenerativeAiResult $result The result from the model. */ public function __construct(array $messages, \WordPress\AiClient\Providers\Models\Contracts\ModelInterface $model, ?\WordPress\AiClient\Providers\Models\Enums\CapabilityEnum $capability, \WordPress\AiClient\Results\DTO\GenerativeAiResult $result) { @@ -75207,7 +75207,7 @@ public function __construct(array $messages, \WordPress\AiClient\Providers\Model * * @since 0.4.0 * - * @return list The messages. + * @return list<\WordPress\AiClient\Messages\DTO\Message> The messages. */ public function getMessages(): array { @@ -75217,7 +75217,7 @@ public function getMessages(): array * * @since 0.4.0 * - * @return ModelInterface The model. + * @return \WordPress\AiClient\Providers\Models\Contracts\ModelInterface The model. */ public function getModel(): \WordPress\AiClient\Providers\Models\Contracts\ModelInterface { @@ -75227,7 +75227,7 @@ public function getModel(): \WordPress\AiClient\Providers\Models\Contracts\Model * * @since 0.4.0 * - * @return CapabilityEnum|null The capability, or null if not specified. + * @return \WordPress\AiClient\Providers\Models\Enums\CapabilityEnum|null The capability, or null if not specified. */ public function getCapability(): ?\WordPress\AiClient\Providers\Models\Enums\CapabilityEnum { @@ -75237,7 +75237,7 @@ public function getCapability(): ?\WordPress\AiClient\Providers\Models\Enums\Cap * * @since 0.4.0 * - * @return GenerativeAiResult The result. + * @return \WordPress\AiClient\Results\DTO\GenerativeAiResult The result. */ public function getResult(): \WordPress\AiClient\Results\DTO\GenerativeAiResult { @@ -75271,9 +75271,9 @@ class BeforeGenerateResultEvent * * @since 0.4.0 * - * @param list $messages The messages to be sent to the model. - * @param ModelInterface $model The model that will process the prompt. - * @param CapabilityEnum|null $capability The capability being used for generation. + * @param list<\WordPress\AiClient\Messages\DTO\Message> $messages The messages to be sent to the model. + * @param \WordPress\AiClient\Providers\Models\Contracts\ModelInterface $model The model that will process the prompt. + * @param \WordPress\AiClient\Providers\Models\Enums\CapabilityEnum|null $capability The capability being used for generation. */ public function __construct(array $messages, \WordPress\AiClient\Providers\Models\Contracts\ModelInterface $model, ?\WordPress\AiClient\Providers\Models\Enums\CapabilityEnum $capability) { @@ -75283,7 +75283,7 @@ public function __construct(array $messages, \WordPress\AiClient\Providers\Model * * @since 0.4.0 * - * @return list The messages. + * @return list<\WordPress\AiClient\Messages\DTO\Message> The messages. */ public function getMessages(): array { @@ -75293,7 +75293,7 @@ public function getMessages(): array * * @since 0.4.0 * - * @return ModelInterface The model. + * @return \WordPress\AiClient\Providers\Models\Contracts\ModelInterface The model. */ public function getModel(): \WordPress\AiClient\Providers\Models\Contracts\ModelInterface { @@ -75303,7 +75303,7 @@ public function getModel(): \WordPress\AiClient\Providers\Models\Contracts\Model * * @since 0.4.0 * - * @return CapabilityEnum|null The capability, or null if not specified. + * @return \WordPress\AiClient\Providers\Models\Enums\CapabilityEnum|null The capability, or null if not specified. */ public function getCapability(): ?\WordPress\AiClient\Providers\Models\Enums\CapabilityEnum { @@ -75338,7 +75338,7 @@ public function __clone() * base64Data?: string * } * - * @extends AbstractDataTransferObject + * @extends \WordPress\AiClient\Common\AbstractDataTransferObject */ class File extends \WordPress\AiClient\Common\AbstractDataTransferObject { @@ -75353,7 +75353,7 @@ class File extends \WordPress\AiClient\Common\AbstractDataTransferObject * * @param string $file The file string (URL, base64 data, or local path). * @param string|null $mimeType The MIME type of the file (optional). - * @throws InvalidArgumentException If the file format is invalid or MIME type cannot be determined. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the file format is invalid or MIME type cannot be determined. * @phpstan-return void */ public function __construct(string $file, ?string $mimeType = null) @@ -75364,7 +75364,7 @@ public function __construct(string $file, ?string $mimeType = null) * * @since 0.1.0 * - * @return FileTypeEnum The file type. + * @return \WordPress\AiClient\Files\Enums\FileTypeEnum The file type. */ public function getFileType(): \WordPress\AiClient\Files\Enums\FileTypeEnum { @@ -75434,7 +75434,7 @@ public function getMimeType(): string * * @since 0.1.0 * - * @return MimeType The MIME type object. + * @return \WordPress\AiClient\Files\ValueObjects\MimeType The MIME type object. */ public function getMimeTypeObject(): \WordPress\AiClient\Files\ValueObjects\MimeType { @@ -75617,7 +75617,7 @@ final class MimeType * @since 0.1.0 * * @param string $value The MIME type value. - * @throws InvalidArgumentException If the MIME type is invalid. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the MIME type is invalid. */ public function __construct(string $value) { @@ -75628,7 +75628,7 @@ public function __construct(string $value) * @since 0.1.0 * * @return string The file extension (without the dot). - * @throws InvalidArgumentException If no known extension exists for this MIME type. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If no known extension exists for this MIME type. */ public function toExtension(): string { @@ -75640,7 +75640,7 @@ public function toExtension(): string * * @param string $extension The file extension (without the dot). * @return self The MimeType instance. - * @throws InvalidArgumentException If the extension is not recognized. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the extension is not recognized. */ public static function fromExtension(string $extension): self { @@ -75727,7 +75727,7 @@ public function isDocument(): bool * * @param self|string $other The other MIME type to compare. * @return bool True if equal. - * @throws InvalidArgumentException If the other MIME type is invalid. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the other MIME type is invalid. */ public function equals($other): bool { @@ -75760,14 +75760,14 @@ public function __toString(): string * parts: array * } * - * @extends AbstractDataTransferObject + * @extends \WordPress\AiClient\Common\AbstractDataTransferObject */ class Message extends \WordPress\AiClient\Common\AbstractDataTransferObject { public const KEY_ROLE = 'role'; public const KEY_PARTS = 'parts'; /** - * @var MessageRoleEnum The role of the message sender. + * @var \WordPress\AiClient\Messages\Enums\MessageRoleEnum The role of the message sender. */ protected \WordPress\AiClient\Messages\Enums\MessageRoleEnum $role; /** @@ -75779,9 +75779,9 @@ class Message extends \WordPress\AiClient\Common\AbstractDataTransferObject * * @since 0.1.0 * - * @param MessageRoleEnum $role The role of the message sender. + * @param \WordPress\AiClient\Messages\Enums\MessageRoleEnum $role The role of the message sender. * @param MessagePart[] $parts The parts that make up this message. - * @throws InvalidArgumentException If parts contain invalid content for the role. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If parts contain invalid content for the role. */ public function __construct(\WordPress\AiClient\Messages\Enums\MessageRoleEnum $role, array $parts) { @@ -75791,7 +75791,7 @@ public function __construct(\WordPress\AiClient\Messages\Enums\MessageRoleEnum $ * * @since 0.1.0 * - * @return MessageRoleEnum The role. + * @return \WordPress\AiClient\Messages\Enums\MessageRoleEnum The role. */ public function getRole(): \WordPress\AiClient\Messages\Enums\MessageRoleEnum { @@ -75813,7 +75813,7 @@ public function getParts(): array * * @param MessagePart $part The part to append. * @return Message A new instance with the part appended. - * @throws InvalidArgumentException If the part is invalid for the role. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the part is invalid for the role. */ public function withPart(\WordPress\AiClient\Messages\DTO\MessagePart $part): \WordPress\AiClient\Messages\DTO\Message { @@ -75866,9 +75866,9 @@ public function __clone() * * @since 0.1.0 * - * @phpstan-import-type FileArrayShape from File - * @phpstan-import-type FunctionCallArrayShape from FunctionCall - * @phpstan-import-type FunctionResponseArrayShape from FunctionResponse + * @phpstan-import-type FileArrayShape from \WordPress\AiClient\Files\DTO\File + * @phpstan-import-type FunctionCallArrayShape from \WordPress\AiClient\Tools\DTO\FunctionCall + * @phpstan-import-type FunctionResponseArrayShape from \WordPress\AiClient\Tools\DTO\FunctionResponse * * @phpstan-type MessagePartArrayShape array{ * channel: string, @@ -75880,7 +75880,7 @@ public function __clone() * functionResponse?: FunctionResponseArrayShape * } * - * @extends AbstractDataTransferObject + * @extends \WordPress\AiClient\Common\AbstractDataTransferObject */ class MessagePart extends \WordPress\AiClient\Common\AbstractDataTransferObject { @@ -75897,9 +75897,9 @@ class MessagePart extends \WordPress\AiClient\Common\AbstractDataTransferObject * @since 0.1.0 * * @param mixed $content The content of this message part. - * @param MessagePartChannelEnum|null $channel The channel this part belongs to. Defaults to CONTENT. + * @param \WordPress\AiClient\Messages\Enums\MessagePartChannelEnum|null $channel The channel this part belongs to. Defaults to CONTENT. * @param string|null $thoughtSignature Optional thought signature for extended thinking. - * @throws InvalidArgumentException If an unsupported content type is provided. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If an unsupported content type is provided. */ public function __construct($content, ?\WordPress\AiClient\Messages\Enums\MessagePartChannelEnum $channel = null, ?string $thoughtSignature = null) { @@ -75909,7 +75909,7 @@ public function __construct($content, ?\WordPress\AiClient\Messages\Enums\Messag * * @since 0.1.0 * - * @return MessagePartChannelEnum The channel. + * @return \WordPress\AiClient\Messages\Enums\MessagePartChannelEnum The channel. */ public function getChannel(): \WordPress\AiClient\Messages\Enums\MessagePartChannelEnum { @@ -75919,7 +75919,7 @@ public function getChannel(): \WordPress\AiClient\Messages\Enums\MessagePartChan * * @since 0.1.0 * - * @return MessagePartTypeEnum The type. + * @return \WordPress\AiClient\Messages\Enums\MessagePartTypeEnum The type. */ public function getType(): \WordPress\AiClient\Messages\Enums\MessagePartTypeEnum { @@ -75949,7 +75949,7 @@ public function getText(): ?string * * @since 0.1.0 * - * @return File|null The file or null if not a file part. + * @return \WordPress\AiClient\Files\DTO\File|null The file or null if not a file part. */ public function getFile(): ?\WordPress\AiClient\Files\DTO\File { @@ -75959,7 +75959,7 @@ public function getFile(): ?\WordPress\AiClient\Files\DTO\File * * @since 0.1.0 * - * @return FunctionCall|null The function call or null if not a function call part. + * @return \WordPress\AiClient\Tools\DTO\FunctionCall|null The function call or null if not a function call part. */ public function getFunctionCall(): ?\WordPress\AiClient\Tools\DTO\FunctionCall { @@ -75969,7 +75969,7 @@ public function getFunctionCall(): ?\WordPress\AiClient\Tools\DTO\FunctionCall * * @since 0.1.0 * - * @return FunctionResponse|null The function response or null if not a function response part. + * @return \WordPress\AiClient\Tools\DTO\FunctionResponse|null The function response or null if not a function response part. */ public function getFunctionResponse(): ?\WordPress\AiClient\Tools\DTO\FunctionResponse { @@ -76202,7 +76202,7 @@ public function getId(): string; * * @since 0.1.0 * - * @return OperationStateEnum The operation state. + * @return \WordPress\AiClient\Operations\Enums\OperationStateEnum The operation state. */ public function getState(): \WordPress\AiClient\Operations\Enums\OperationStateEnum; } @@ -76216,11 +76216,11 @@ public function getState(): \WordPress\AiClient\Operations\Enums\OperationStateE * * @since 0.1.0 * - * @phpstan-import-type GenerativeAiResultArrayShape from GenerativeAiResult + * @phpstan-import-type GenerativeAiResultArrayShape from \WordPress\AiClient\Results\DTO\GenerativeAiResult * * @phpstan-type GenerativeAiOperationArrayShape array{id: string, state: string, result?: GenerativeAiResultArrayShape} * - * @extends AbstractDataTransferObject + * @extends \WordPress\AiClient\Common\AbstractDataTransferObject */ class GenerativeAiOperation extends \WordPress\AiClient\Common\AbstractDataTransferObject implements \WordPress\AiClient\Operations\Contracts\OperationInterface { @@ -76233,8 +76233,8 @@ class GenerativeAiOperation extends \WordPress\AiClient\Common\AbstractDataTrans * @since 0.1.0 * * @param string $id Unique identifier for this operation. - * @param OperationStateEnum $state The current state of the operation. - * @param GenerativeAiResult|null $result The result once the operation completes. + * @param \WordPress\AiClient\Operations\Enums\OperationStateEnum $state The current state of the operation. + * @param \WordPress\AiClient\Results\DTO\GenerativeAiResult|null $result The result once the operation completes. */ public function __construct(string $id, \WordPress\AiClient\Operations\Enums\OperationStateEnum $state, ?\WordPress\AiClient\Results\DTO\GenerativeAiResult $result = null) { @@ -76272,7 +76272,7 @@ public function getState(): \WordPress\AiClient\Operations\Enums\OperationStateE * * @since 0.1.0 * - * @return GenerativeAiResult|null The result or null if not yet complete. + * @return \WordPress\AiClient\Results\DTO\GenerativeAiResult|null The result or null if not yet complete. */ public function getResult(): ?\WordPress\AiClient\Results\DTO\GenerativeAiResult { @@ -76362,7 +76362,7 @@ interface ProviderInterface * * @since 0.1.0 * - * @return ProviderMetadata Provider metadata. + * @return \WordPress\AiClient\Providers\DTO\ProviderMetadata Provider metadata. */ public static function metadata(): \WordPress\AiClient\Providers\DTO\ProviderMetadata; /** @@ -76371,9 +76371,9 @@ public static function metadata(): \WordPress\AiClient\Providers\DTO\ProviderMet * @since 0.1.0 * * @param string $modelId Model identifier. - * @param ?ModelConfig $modelConfig Model configuration. - * @return ModelInterface Model instance. - * @throws InvalidArgumentException If model not found or configuration invalid. + * @param ?\WordPress\AiClient\Providers\Models\DTO\ModelConfig $modelConfig Model configuration. + * @return \WordPress\AiClient\Providers\Models\Contracts\ModelInterface Model instance. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If model not found or configuration invalid. */ public static function model(string $modelId, ?\WordPress\AiClient\Providers\Models\DTO\ModelConfig $modelConfig = null): \WordPress\AiClient\Providers\Models\Contracts\ModelInterface; /** @@ -76439,9 +76439,9 @@ final public static function modelMetadataDirectory(): \WordPress\AiClient\Provi * * @since 0.1.0 * - * @param ModelMetadata $modelMetadata The model metadata. - * @param ProviderMetadata $providerMetadata The provider metadata. - * @return ModelInterface The new model instance. + * @param \WordPress\AiClient\Providers\Models\DTO\ModelMetadata $modelMetadata The model metadata. + * @param \WordPress\AiClient\Providers\DTO\ProviderMetadata $providerMetadata The provider metadata. + * @return \WordPress\AiClient\Providers\Models\Contracts\ModelInterface The new model instance. */ abstract protected static function createModel(\WordPress\AiClient\Providers\Models\DTO\ModelMetadata $modelMetadata, \WordPress\AiClient\Providers\DTO\ProviderMetadata $providerMetadata): \WordPress\AiClient\Providers\Models\Contracts\ModelInterface; /** @@ -76449,7 +76449,7 @@ abstract protected static function createModel(\WordPress\AiClient\Providers\Mod * * @since 0.1.0 * - * @return ProviderMetadata The provider metadata. + * @return \WordPress\AiClient\Providers\DTO\ProviderMetadata The provider metadata. */ abstract protected static function createProviderMetadata(): \WordPress\AiClient\Providers\DTO\ProviderMetadata; /** @@ -76457,7 +76457,7 @@ abstract protected static function createProviderMetadata(): \WordPress\AiClient * * @since 0.1.0 * - * @return ProviderAvailabilityInterface The provider availability. + * @return \WordPress\AiClient\Providers\Contracts\ProviderAvailabilityInterface The provider availability. */ abstract protected static function createProviderAvailability(): \WordPress\AiClient\Providers\Contracts\ProviderAvailabilityInterface; /** @@ -76465,7 +76465,7 @@ abstract protected static function createProviderAvailability(): \WordPress\AiCl * * @since 0.1.0 * - * @return ModelMetadataDirectoryInterface The model metadata directory. + * @return \WordPress\AiClient\Providers\Contracts\ModelMetadataDirectoryInterface The model metadata directory. */ abstract protected static function createModelMetadataDirectory(): \WordPress\AiClient\Providers\Contracts\ModelMetadataDirectoryInterface; } @@ -76486,7 +76486,7 @@ interface ModelInterface * * @since 0.1.0 * - * @return ModelMetadata Model metadata. + * @return \WordPress\AiClient\Providers\Models\DTO\ModelMetadata Model metadata. */ public function metadata(): \WordPress\AiClient\Providers\Models\DTO\ModelMetadata; /** @@ -76494,7 +76494,7 @@ public function metadata(): \WordPress\AiClient\Providers\Models\DTO\ModelMetada * * @since 0.1.0 * - * @return ProviderMetadata The provider metadata. + * @return \WordPress\AiClient\Providers\DTO\ProviderMetadata The provider metadata. */ public function providerMetadata(): \WordPress\AiClient\Providers\DTO\ProviderMetadata; /** @@ -76502,7 +76502,7 @@ public function providerMetadata(): \WordPress\AiClient\Providers\DTO\ProviderMe * * @since 0.1.0 * - * @param ModelConfig $config Model configuration. + * @param \WordPress\AiClient\Providers\Models\DTO\ModelConfig $config Model configuration. * @return void */ public function setConfig(\WordPress\AiClient\Providers\Models\DTO\ModelConfig $config): void; @@ -76511,7 +76511,7 @@ public function setConfig(\WordPress\AiClient\Providers\Models\DTO\ModelConfig $ * * @since 0.1.0 * - * @return ModelConfig Current model configuration. + * @return \WordPress\AiClient\Providers\Models\DTO\ModelConfig Current model configuration. */ public function getConfig(): \WordPress\AiClient\Providers\Models\DTO\ModelConfig; } @@ -76532,7 +76532,7 @@ interface ApiBasedModelInterface extends \WordPress\AiClient\Providers\Models\Co * * @since 0.3.0 * - * @param RequestOptions $requestOptions The request options to use. + * @param \WordPress\AiClient\Providers\Http\DTO\RequestOptions $requestOptions The request options to use. * @return void */ public function setRequestOptions(\WordPress\AiClient\Providers\Http\DTO\RequestOptions $requestOptions): void; @@ -76541,7 +76541,7 @@ public function setRequestOptions(\WordPress\AiClient\Providers\Http\DTO\Request * * @since 0.3.0 * - * @return RequestOptions|null The request options, or null if not set. + * @return \WordPress\AiClient\Providers\Http\DTO\RequestOptions|null The request options, or null if not set. */ public function getRequestOptions(): ?\WordPress\AiClient\Providers\Http\DTO\RequestOptions; } @@ -76607,7 +76607,7 @@ public function getRequestAuthentication(): \WordPress\AiClient\Providers\Http\C trait WithHttpTransporterTrait { /** - * @var HttpTransporterInterface|null The HTTP transporter instance. + * @var \WordPress\AiClient\Providers\Http\Contracts\HttpTransporterInterface|null The HTTP transporter instance. */ private ?\WordPress\AiClient\Providers\Http\Contracts\HttpTransporterInterface $httpTransporter = null; /** @@ -76635,7 +76635,7 @@ public function getHttpTransporter(): \WordPress\AiClient\Providers\Http\Contrac trait WithRequestAuthenticationTrait { /** - * @var RequestAuthenticationInterface|null The request authentication instance. + * @var \WordPress\AiClient\Providers\Http\Contracts\RequestAuthenticationInterface|null The request authentication instance. */ private ?\WordPress\AiClient\Providers\Http\Contracts\RequestAuthenticationInterface $requestAuthentication = null; /** @@ -76674,8 +76674,8 @@ abstract class AbstractApiBasedModel implements \WordPress\AiClient\Providers\Ap * * @since 0.1.0 * - * @param ModelMetadata $metadata The metadata for the model. - * @param ProviderMetadata $providerMetadata The metadata for the model's provider. + * @param \WordPress\AiClient\Providers\Models\DTO\ModelMetadata $metadata The metadata for the model. + * @param \WordPress\AiClient\Providers\DTO\ProviderMetadata $providerMetadata The metadata for the model's provider. */ public function __construct(\WordPress\AiClient\Providers\Models\DTO\ModelMetadata $metadata, \WordPress\AiClient\Providers\DTO\ProviderMetadata $providerMetadata) { @@ -76746,7 +76746,7 @@ interface ModelMetadataDirectoryInterface * * @since 0.1.0 * - * @return list Array of model metadata. + * @return list<\WordPress\AiClient\Providers\Models\DTO\ModelMetadata> Array of model metadata. */ public function listModelMetadata(): array; /** @@ -76764,8 +76764,8 @@ public function hasModelMetadata(string $modelId): bool; * @since 0.1.0 * * @param string $modelId Model identifier. - * @return ModelMetadata Model metadata. - * @throws InvalidArgumentException If model metadata not found. + * @return \WordPress\AiClient\Providers\Models\DTO\ModelMetadata Model metadata. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If model metadata not found. */ public function getModelMetadata(string $modelId): \WordPress\AiClient\Providers\Models\DTO\ModelMetadata; } @@ -76826,7 +76826,7 @@ protected function getBaseCacheKey(): string * * @since 0.1.0 * - * @return array Map of model ID to model metadata. + * @return array Map of model ID to model metadata. */ abstract protected function sendListModelsRequest(): array; } @@ -76908,7 +76908,7 @@ class GenerateTextApiBasedProviderAvailability implements \WordPress\AiClient\Pr * * @since 0.1.0 * - * @param ModelInterface $model The model to use for checking availability. + * @param \WordPress\AiClient\Providers\Models\Contracts\ModelInterface $model The model to use for checking availability. */ public function __construct(\WordPress\AiClient\Providers\Models\Contracts\ModelInterface $model) { @@ -76938,7 +76938,7 @@ class ListModelsApiBasedProviderAvailability implements \WordPress\AiClient\Prov * * @since 0.1.0 * - * @param ModelMetadataDirectoryInterface $modelMetadataDirectory The model metadata directory to use for checking + * @param \WordPress\AiClient\Providers\Contracts\ModelMetadataDirectoryInterface $modelMetadataDirectory The model metadata directory to use for checking * availability. */ public function __construct(\WordPress\AiClient\Providers\Contracts\ModelMetadataDirectoryInterface $modelMetadataDirectory) @@ -76972,8 +76972,8 @@ interface ProviderOperationsHandlerInterface * @since 0.1.0 * * @param string $operationId Operation identifier. - * @return OperationInterface The operation. - * @throws InvalidArgumentException If operation not found. + * @return \WordPress\AiClient\Operations\Contracts\OperationInterface The operation. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If operation not found. */ public function getOperation(string $operationId): \WordPress\AiClient\Operations\Contracts\OperationInterface; } @@ -77018,7 +77018,7 @@ public static function operationsHandler(): \WordPress\AiClient\Providers\Contra * logoPath?: ?string * } * - * @extends AbstractDataTransferObject + * @extends \WordPress\AiClient\Common\AbstractDataTransferObject */ class ProviderMetadata extends \WordPress\AiClient\Common\AbstractDataTransferObject { @@ -77042,7 +77042,7 @@ class ProviderMetadata extends \WordPress\AiClient\Common\AbstractDataTransferOb */ protected ?string $description; /** - * @var ProviderTypeEnum The provider type. + * @var \WordPress\AiClient\Providers\Enums\ProviderTypeEnum The provider type. */ protected \WordPress\AiClient\Providers\Enums\ProviderTypeEnum $type; /** @@ -77050,7 +77050,7 @@ class ProviderMetadata extends \WordPress\AiClient\Common\AbstractDataTransferOb */ protected ?string $credentialsUrl; /** - * @var RequestAuthenticationMethod|null The authentication method. + * @var \WordPress\AiClient\Providers\Http\Enums\RequestAuthenticationMethod|null The authentication method. */ protected ?\WordPress\AiClient\Providers\Http\Enums\RequestAuthenticationMethod $authenticationMethod; /** @@ -77066,12 +77066,12 @@ class ProviderMetadata extends \WordPress\AiClient\Common\AbstractDataTransferOb * * @param string $id The provider's unique identifier. * @param string $name The provider's display name. - * @param ProviderTypeEnum $type The provider type. + * @param \WordPress\AiClient\Providers\Enums\ProviderTypeEnum $type The provider type. * @param string|null $credentialsUrl The URL where users can get credentials. - * @param RequestAuthenticationMethod|null $authenticationMethod The authentication method. + * @param \WordPress\AiClient\Providers\Http\Enums\RequestAuthenticationMethod|null $authenticationMethod The authentication method. * @param string|null $description The provider's description. * @param string|null $logoPath The full path to the provider's logo image file. - * @throws InvalidArgumentException If the provider ID contains invalid characters. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the provider ID contains invalid characters. */ public function __construct(string $id, string $name, \WordPress\AiClient\Providers\Enums\ProviderTypeEnum $type, ?string $credentialsUrl = null, ?\WordPress\AiClient\Providers\Http\Enums\RequestAuthenticationMethod $authenticationMethod = null, ?string $description = null, ?string $logoPath = null) { @@ -77111,7 +77111,7 @@ public function getDescription(): ?string * * @since 0.1.0 * - * @return ProviderTypeEnum The provider type. + * @return \WordPress\AiClient\Providers\Enums\ProviderTypeEnum The provider type. */ public function getType(): \WordPress\AiClient\Providers\Enums\ProviderTypeEnum { @@ -77131,7 +77131,7 @@ public function getCredentialsUrl(): ?string * * @since 0.4.0 * - * @return RequestAuthenticationMethod|null The authentication method. + * @return \WordPress\AiClient\Providers\Http\Enums\RequestAuthenticationMethod|null The authentication method. */ public function getAuthenticationMethod(): ?\WordPress\AiClient\Providers\Http\Enums\RequestAuthenticationMethod { @@ -77188,14 +77188,14 @@ public static function fromArray(array $array): self * @since 0.1.0 * * @phpstan-import-type ProviderMetadataArrayShape from ProviderMetadata - * @phpstan-import-type ModelMetadataArrayShape from ModelMetadata + * @phpstan-import-type ModelMetadataArrayShape from \WordPress\AiClient\Providers\Models\DTO\ModelMetadata * * @phpstan-type ProviderModelsMetadataArrayShape array{ * provider: ProviderMetadataArrayShape, * models: list * } * - * @extends AbstractDataTransferObject + * @extends \WordPress\AiClient\Common\AbstractDataTransferObject */ class ProviderModelsMetadata extends \WordPress\AiClient\Common\AbstractDataTransferObject { @@ -77206,7 +77206,7 @@ class ProviderModelsMetadata extends \WordPress\AiClient\Common\AbstractDataTran */ protected \WordPress\AiClient\Providers\DTO\ProviderMetadata $provider; /** - * @var list The available models. + * @var list<\WordPress\AiClient\Providers\Models\DTO\ModelMetadata> The available models. */ protected array $models; /** @@ -77215,9 +77215,9 @@ class ProviderModelsMetadata extends \WordPress\AiClient\Common\AbstractDataTran * @since 0.1.0 * * @param ProviderMetadata $provider The provider metadata. - * @param list $models The available models. + * @param list<\WordPress\AiClient\Providers\Models\DTO\ModelMetadata> $models The available models. * - * @throws InvalidArgumentException If models is not a list. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If models is not a list. */ public function __construct(\WordPress\AiClient\Providers\DTO\ProviderMetadata $provider, array $models) { @@ -77248,7 +77248,7 @@ public function getProvider(): \WordPress\AiClient\Providers\DTO\ProviderMetadat * * @since 0.1.0 * - * @return list The available models. + * @return list<\WordPress\AiClient\Providers\Models\DTO\ModelMetadata> The available models. */ public function getModels(): array { @@ -77425,9 +77425,9 @@ interface HttpTransporterInterface * * @since 0.1.0 * - * @param Request $request The request to send. - * @param RequestOptions|null $options Optional transport options for the request. - * @return Response The response received. + * @param \WordPress\AiClient\Providers\Http\DTO\Request $request The request to send. + * @param \WordPress\AiClient\Providers\Http\DTO\RequestOptions|null $options Optional transport options for the request. + * @return \WordPress\AiClient\Providers\Http\DTO\Response The response received. */ public function send(\WordPress\AiClient\Providers\Http\DTO\Request $request, ?\WordPress\AiClient\Providers\Http\DTO\RequestOptions $options = null): \WordPress\AiClient\Providers\Http\DTO\Response; } @@ -77443,8 +77443,8 @@ interface RequestAuthenticationInterface extends \WordPress\AiClient\Common\Cont * * @since 0.1.0 * - * @param Request $request The request to authenticate. - * @return Request The authenticated request. + * @param \WordPress\AiClient\Providers\Http\DTO\Request $request The request to authenticate. + * @return \WordPress\AiClient\Providers\Http\DTO\Request The authenticated request. */ public function authenticateRequest(\WordPress\AiClient\Providers\Http\DTO\Request $request): \WordPress\AiClient\Providers\Http\DTO\Request; } @@ -77459,7 +77459,7 @@ public function authenticateRequest(\WordPress\AiClient\Providers\Http\DTO\Reque * apiKey: string * } * - * @extends AbstractDataTransferObject + * @extends \WordPress\AiClient\Common\AbstractDataTransferObject */ class ApiKeyRequestAuthentication extends \WordPress\AiClient\Common\AbstractDataTransferObject implements \WordPress\AiClient\Providers\Http\Contracts\RequestAuthenticationInterface { @@ -77544,7 +77544,7 @@ public static function getJsonSchema(): array * options?: RequestOptionsArrayShape * } * - * @extends AbstractDataTransferObject + * @extends \WordPress\AiClient\Common\AbstractDataTransferObject */ class Request extends \WordPress\AiClient\Common\AbstractDataTransferObject { @@ -77554,7 +77554,7 @@ class Request extends \WordPress\AiClient\Common\AbstractDataTransferObject public const KEY_BODY = 'body'; public const KEY_OPTIONS = 'options'; /** - * @var HttpMethodEnum The HTTP method. + * @var \WordPress\AiClient\Providers\Http\Enums\HttpMethodEnum The HTTP method. */ protected \WordPress\AiClient\Providers\Http\Enums\HttpMethodEnum $method; /** @@ -77562,7 +77562,7 @@ class Request extends \WordPress\AiClient\Common\AbstractDataTransferObject */ protected string $uri; /** - * @var HeadersCollection The request headers. + * @var \WordPress\AiClient\Providers\Http\Collections\HeadersCollection The request headers. */ protected \WordPress\AiClient\Providers\Http\Collections\HeadersCollection $headers; /** @@ -77582,13 +77582,13 @@ class Request extends \WordPress\AiClient\Common\AbstractDataTransferObject * * @since 0.1.0 * - * @param HttpMethodEnum $method The HTTP method. + * @param \WordPress\AiClient\Providers\Http\Enums\HttpMethodEnum $method The HTTP method. * @param string $uri The request URI. * @param array> $headers The request headers. * @param string|array|null $data The request data. * @param RequestOptions|null $options The request transport options. * - * @throws InvalidArgumentException If the URI is empty. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the URI is empty. */ public function __construct(\WordPress\AiClient\Providers\Http\Enums\HttpMethodEnum $method, string $uri, array $headers = [], $data = null, ?\WordPress\AiClient\Providers\Http\DTO\RequestOptions $options = null) { @@ -77610,7 +77610,7 @@ public function __clone() * * @since 0.1.0 * - * @return HttpMethodEnum The HTTP method. + * @return \WordPress\AiClient\Providers\Http\Enums\HttpMethodEnum The HTTP method. */ public function getMethod(): \WordPress\AiClient\Providers\Http\Enums\HttpMethodEnum { @@ -77682,7 +77682,7 @@ public function hasHeader(string $name): bool * @since 0.1.0 * * @return string|null The body. - * @throws JsonException If the data cannot be encoded to JSON. + * @throws \JsonException If the data cannot be encoded to JSON. */ public function getBody(): ?string { @@ -77772,9 +77772,9 @@ public static function fromArray(array $array): self * * @since 0.2.0 * - * @param RequestInterface $psrRequest The PSR-7 request to convert. + * @param \WordPress\AiClientDependencies\Psr\Http\Message\RequestInterface $psrRequest The PSR-7 request to convert. * @return self A new Request instance. - * @throws InvalidArgumentException If the HTTP method is not supported. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the HTTP method is not supported. */ public static function fromPsrRequest(\WordPress\AiClientDependencies\Psr\Http\Message\RequestInterface $psrRequest): self { @@ -77793,7 +77793,7 @@ public static function fromPsrRequest(\WordPress\AiClientDependencies\Psr\Http\M * maxRedirects?: int|null * } * - * @extends AbstractDataTransferObject + * @extends \WordPress\AiClient\Common\AbstractDataTransferObject */ class RequestOptions extends \WordPress\AiClient\Common\AbstractDataTransferObject { @@ -77820,7 +77820,7 @@ class RequestOptions extends \WordPress\AiClient\Common\AbstractDataTransferObje * @param float|null $timeout Timeout in seconds. * @return void * - * @throws InvalidArgumentException When timeout is negative. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException When timeout is negative. */ public function setTimeout(?float $timeout): void { @@ -77833,7 +77833,7 @@ public function setTimeout(?float $timeout): void * @param float|null $timeout Connection timeout in seconds. * @return void * - * @throws InvalidArgumentException When timeout is negative. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException When timeout is negative. */ public function setConnectTimeout(?float $timeout): void { @@ -77849,7 +77849,7 @@ public function setConnectTimeout(?float $timeout): void * @param int|null $maxRedirects Maximum redirects to follow, or 0 to disable, or null for unspecified. * @return void * - * @throws InvalidArgumentException When redirect count is negative. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException When redirect count is negative. */ public function setMaxRedirects(?int $maxRedirects): void { @@ -77937,7 +77937,7 @@ public static function getJsonSchema(): array * body?: string|null * } * - * @extends AbstractDataTransferObject + * @extends \WordPress\AiClient\Common\AbstractDataTransferObject */ class Response extends \WordPress\AiClient\Common\AbstractDataTransferObject { @@ -77949,7 +77949,7 @@ class Response extends \WordPress\AiClient\Common\AbstractDataTransferObject */ protected int $statusCode; /** - * @var HeadersCollection The response headers. + * @var \WordPress\AiClient\Providers\Http\Collections\HeadersCollection The response headers. */ protected \WordPress\AiClient\Providers\Http\Collections\HeadersCollection $headers; /** @@ -77965,7 +77965,7 @@ class Response extends \WordPress\AiClient\Common\AbstractDataTransferObject * @param array> $headers The response headers. * @param string|null $body The response body. * - * @throws InvalidArgumentException If the status code is invalid. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the status code is invalid. */ public function __construct(int $statusCode, array $headers, ?string $body = null) { @@ -78217,7 +78217,7 @@ class RequestAuthenticationMethod extends \WordPress\AiClient\Common\AbstractEnu * * @since 0.4.0 * - * @return class-string The implementation class. + * @return class-string<\WordPress\AiClient\Providers\Http\Contracts\RequestAuthenticationInterface&\WordPress\AiClient\Common\Contracts\WithArrayTransformationInterface> The implementation class. * * @phpstan-ignore missingType.generics */ @@ -78240,7 +78240,7 @@ class ClientException extends \WordPress\AiClient\Common\Exception\InvalidArgume /** * The request that failed. * - * @var Request|null + * @var \WordPress\AiClient\Providers\Http\DTO\Request|null */ protected ?\WordPress\AiClient\Providers\Http\DTO\Request $request = null; /** @@ -78248,7 +78248,7 @@ class ClientException extends \WordPress\AiClient\Common\Exception\InvalidArgume * * @since 0.2.0 * - * @return Request + * @return \WordPress\AiClient\Providers\Http\DTO\Request * @throws \RuntimeException If no request is available */ public function getRequest(): \WordPress\AiClient\Providers\Http\DTO\Request @@ -78262,7 +78262,7 @@ public function getRequest(): \WordPress\AiClient\Providers\Http\DTO\Request * * @since 0.2.0 * - * @param Response $response The HTTP response that failed. + * @param \WordPress\AiClient\Providers\Http\DTO\Response $response The HTTP response that failed. * @return self */ public static function fromClientErrorResponse(\WordPress\AiClient\Providers\Http\DTO\Response $response): self @@ -78282,7 +78282,7 @@ class NetworkException extends \WordPress\AiClient\Common\Exception\RuntimeExcep /** * The request that failed. * - * @var Request|null + * @var \WordPress\AiClient\Providers\Http\DTO\Request|null */ protected ?\WordPress\AiClient\Providers\Http\DTO\Request $request = null; /** @@ -78290,7 +78290,7 @@ class NetworkException extends \WordPress\AiClient\Common\Exception\RuntimeExcep * * @since 0.2.0 * - * @return Request + * @return \WordPress\AiClient\Providers\Http\DTO\Request * @throws \RuntimeException If no request is available */ public function getRequest(): \WordPress\AiClient\Providers\Http\DTO\Request @@ -78301,7 +78301,7 @@ public function getRequest(): \WordPress\AiClient\Providers\Http\DTO\Request * * @since 0.2.0 * - * @param RequestInterface $psrRequest The PSR-7 request that failed. + * @param \WordPress\AiClientDependencies\Psr\Http\Message\RequestInterface $psrRequest The PSR-7 request that failed. * @param \Throwable $networkException The PSR-18 network exception. * @return self */ @@ -78328,7 +78328,7 @@ class RedirectException extends \WordPress\AiClient\Common\Exception\RuntimeExce * * @since 0.2.0 * - * @param Response $response The HTTP redirect response. + * @param \WordPress\AiClient\Providers\Http\DTO\Response $response The HTTP redirect response. * @return self */ public static function fromRedirectResponse(\WordPress\AiClient\Providers\Http\DTO\Response $response): self @@ -78390,7 +78390,7 @@ class ServerException extends \WordPress\AiClient\Common\Exception\RuntimeExcept * * @since 0.2.0 * - * @param Response $response The HTTP response that failed. + * @param \WordPress\AiClient\Providers\Http\DTO\Response $response The HTTP response that failed. * @return self */ public static function fromServerErrorResponse(\WordPress\AiClient\Providers\Http\DTO\Response $response): self @@ -78415,9 +78415,9 @@ class HttpTransporter implements \WordPress\AiClient\Providers\Http\Contracts\Ht * * @since 0.1.0 * - * @param ClientInterface|null $client PSR-18 HTTP client. - * @param RequestFactoryInterface|null $requestFactory PSR-17 request factory. - * @param StreamFactoryInterface|null $streamFactory PSR-17 stream factory. + * @param \WordPress\AiClientDependencies\Psr\Http\Client\ClientInterface|null $client PSR-18 HTTP client. + * @param \WordPress\AiClientDependencies\Psr\Http\Message\RequestFactoryInterface|null $requestFactory PSR-17 request factory. + * @param \WordPress\AiClientDependencies\Psr\Http\Message\StreamFactoryInterface|null $streamFactory PSR-17 stream factory. */ public function __construct(?\WordPress\AiClientDependencies\Psr\Http\Client\ClientInterface $client = null, ?\WordPress\AiClientDependencies\Psr\Http\Message\RequestFactoryInterface $requestFactory = null, ?\WordPress\AiClientDependencies\Psr\Http\Message\StreamFactoryInterface $streamFactory = null) { @@ -78450,7 +78450,7 @@ class HttpTransporterFactory * * @since 0.1.0 * - * @return HttpTransporterInterface The HTTP transporter. + * @return \WordPress\AiClient\Providers\Http\Contracts\HttpTransporterInterface The HTTP transporter. */ public static function createTransporter(): \WordPress\AiClient\Providers\Http\Contracts\HttpTransporterInterface { @@ -78505,10 +78505,10 @@ class ResponseUtil * * @since 0.1.0 * - * @param Response $response The HTTP response to check. - * @throws RedirectException If the response indicates a redirect (3xx). - * @throws ClientException If the response indicates a client error (4xx). - * @throws ServerException If the response indicates a server error (5xx). + * @param \WordPress\AiClient\Providers\Http\DTO\Response $response The HTTP response to check. + * @throws \WordPress\AiClient\Providers\Http\Exception\RedirectException If the response indicates a redirect (3xx). + * @throws \WordPress\AiClient\Providers\Http\Exception\ClientException If the response indicates a client error (4xx). + * @throws \WordPress\AiClient\Providers\Http\Exception\ServerException If the response indicates a server error (5xx). * @throws \RuntimeException If the response has an invalid status code. */ public static function throwIfNotSuccessful(\WordPress\AiClient\Providers\Http\DTO\Response $response): void @@ -78526,8 +78526,8 @@ public static function throwIfNotSuccessful(\WordPress\AiClient\Providers\Http\D * * @since 0.1.0 * - * @phpstan-import-type FunctionDeclarationArrayShape from FunctionDeclaration - * @phpstan-import-type WebSearchArrayShape from WebSearch + * @phpstan-import-type FunctionDeclarationArrayShape from \WordPress\AiClient\Tools\DTO\FunctionDeclaration + * @phpstan-import-type WebSearchArrayShape from \WordPress\AiClient\Tools\DTO\WebSearch * * @phpstan-type ModelConfigArrayShape array{ * outputModalities?: list, @@ -78553,7 +78553,7 @@ public static function throwIfNotSuccessful(\WordPress\AiClient\Providers\Http\D * customOptions?: array * } * - * @extends AbstractDataTransferObject + * @extends \WordPress\AiClient\Common\AbstractDataTransferObject */ class ModelConfig extends \WordPress\AiClient\Common\AbstractDataTransferObject { @@ -78585,7 +78585,7 @@ class ModelConfig extends \WordPress\AiClient\Common\AbstractDataTransferObject */ public const KEY_INPUT_MODALITIES = 'inputModalities'; /** - * @var list|null Output modalities for the model. + * @var list<\WordPress\AiClient\Messages\Enums\ModalityEnum>|null Output modalities for the model. */ protected ?array $outputModalities = null; /** @@ -78633,15 +78633,15 @@ class ModelConfig extends \WordPress\AiClient\Common\AbstractDataTransferObject */ protected ?int $topLogprobs = null; /** - * @var list|null Function declarations available to the model. + * @var list<\WordPress\AiClient\Tools\DTO\FunctionDeclaration>|null Function declarations available to the model. */ protected ?array $functionDeclarations = null; /** - * @var WebSearch|null Web search configuration for the model. + * @var \WordPress\AiClient\Tools\DTO\WebSearch|null Web search configuration for the model. */ protected ?\WordPress\AiClient\Tools\DTO\WebSearch $webSearch = null; /** - * @var FileTypeEnum|null Output file type. + * @var \WordPress\AiClient\Files\Enums\FileTypeEnum|null Output file type. */ protected ?\WordPress\AiClient\Files\Enums\FileTypeEnum $outputFileType = null; /** @@ -78653,7 +78653,7 @@ class ModelConfig extends \WordPress\AiClient\Common\AbstractDataTransferObject */ protected ?array $outputSchema = null; /** - * @var MediaOrientationEnum|null Output media orientation. + * @var \WordPress\AiClient\Files\Enums\MediaOrientationEnum|null Output media orientation. */ protected ?\WordPress\AiClient\Files\Enums\MediaOrientationEnum $outputMediaOrientation = null; /** @@ -78686,9 +78686,9 @@ public function __clone() * * @since 0.1.0 * - * @param list $outputModalities The output modalities. + * @param list<\WordPress\AiClient\Messages\Enums\ModalityEnum> $outputModalities The output modalities. * - * @throws InvalidArgumentException If the array is not a list. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the array is not a list. */ public function setOutputModalities(array $outputModalities): void { @@ -78698,7 +78698,7 @@ public function setOutputModalities(array $outputModalities): void * * @since 0.1.0 * - * @return list|null The output modalities. + * @return list<\WordPress\AiClient\Messages\Enums\ModalityEnum>|null The output modalities. */ public function getOutputModalities(): ?array { @@ -78830,7 +78830,7 @@ public function getTopK(): ?int * * @param list $stopSequences The stop sequences. * - * @throws InvalidArgumentException If the array is not a list. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the array is not a list. */ public function setStopSequences(array $stopSequences): void { @@ -78930,9 +78930,9 @@ public function getTopLogprobs(): ?int * * @since 0.1.0 * - * @param list $functionDeclarations The function declarations. + * @param list<\WordPress\AiClient\Tools\DTO\FunctionDeclaration> $functionDeclarations The function declarations. * - * @throws InvalidArgumentException If the array is not a list. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the array is not a list. */ public function setFunctionDeclarations(array $functionDeclarations): void { @@ -78942,7 +78942,7 @@ public function setFunctionDeclarations(array $functionDeclarations): void * * @since 0.1.0 * - * @return list|null The function declarations. + * @return list<\WordPress\AiClient\Tools\DTO\FunctionDeclaration>|null The function declarations. */ public function getFunctionDeclarations(): ?array { @@ -78952,7 +78952,7 @@ public function getFunctionDeclarations(): ?array * * @since 0.1.0 * - * @param WebSearch $webSearch The web search configuration. + * @param \WordPress\AiClient\Tools\DTO\WebSearch $webSearch The web search configuration. */ public function setWebSearch(\WordPress\AiClient\Tools\DTO\WebSearch $webSearch): void { @@ -78962,7 +78962,7 @@ public function setWebSearch(\WordPress\AiClient\Tools\DTO\WebSearch $webSearch) * * @since 0.1.0 * - * @return WebSearch|null The web search configuration. + * @return \WordPress\AiClient\Tools\DTO\WebSearch|null The web search configuration. */ public function getWebSearch(): ?\WordPress\AiClient\Tools\DTO\WebSearch { @@ -78972,7 +78972,7 @@ public function getWebSearch(): ?\WordPress\AiClient\Tools\DTO\WebSearch * * @since 0.1.0 * - * @param FileTypeEnum $outputFileType The output file type. + * @param \WordPress\AiClient\Files\Enums\FileTypeEnum $outputFileType The output file type. */ public function setOutputFileType(\WordPress\AiClient\Files\Enums\FileTypeEnum $outputFileType): void { @@ -78982,7 +78982,7 @@ public function setOutputFileType(\WordPress\AiClient\Files\Enums\FileTypeEnum $ * * @since 0.1.0 * - * @return FileTypeEnum|null The output file type. + * @return \WordPress\AiClient\Files\Enums\FileTypeEnum|null The output file type. */ public function getOutputFileType(): ?\WordPress\AiClient\Files\Enums\FileTypeEnum { @@ -79035,7 +79035,7 @@ public function getOutputSchema(): ?array * * @since 0.1.0 * - * @param MediaOrientationEnum $outputMediaOrientation The output media orientation. + * @param \WordPress\AiClient\Files\Enums\MediaOrientationEnum $outputMediaOrientation The output media orientation. */ public function setOutputMediaOrientation(\WordPress\AiClient\Files\Enums\MediaOrientationEnum $outputMediaOrientation): void { @@ -79045,7 +79045,7 @@ public function setOutputMediaOrientation(\WordPress\AiClient\Files\Enums\MediaO * * @since 0.1.0 * - * @return MediaOrientationEnum|null The output media orientation. + * @return \WordPress\AiClient\Files\Enums\MediaOrientationEnum|null The output media orientation. */ public function getOutputMediaOrientation(): ?\WordPress\AiClient\Files\Enums\MediaOrientationEnum { @@ -79077,7 +79077,7 @@ public function getOutputMediaAspectRatio(): ?string * * @since 0.4.0 * - * @param MediaOrientationEnum $orientation The desired media orientation. + * @param \WordPress\AiClient\Files\Enums\MediaOrientationEnum $orientation The desired media orientation. * @param string $aspectRatio The desired media aspect ratio. */ protected function validateMediaOrientationAspectRatioCompatibility(\WordPress\AiClient\Files\Enums\MediaOrientationEnum $orientation, string $aspectRatio): void @@ -79178,7 +79178,7 @@ public static function fromArray(array $array): self * supportedOptions: list * } * - * @extends AbstractDataTransferObject + * @extends \WordPress\AiClient\Common\AbstractDataTransferObject */ class ModelMetadata extends \WordPress\AiClient\Common\AbstractDataTransferObject { @@ -79195,7 +79195,7 @@ class ModelMetadata extends \WordPress\AiClient\Common\AbstractDataTransferObjec */ protected string $name; /** - * @var list The model's supported capabilities. + * @var list<\WordPress\AiClient\Providers\Models\Enums\CapabilityEnum> The model's supported capabilities. */ protected array $supportedCapabilities; /** @@ -79209,10 +79209,10 @@ class ModelMetadata extends \WordPress\AiClient\Common\AbstractDataTransferObjec * * @param string $id The model's unique identifier. * @param string $name The model's display name. - * @param list $supportedCapabilities The model's supported capabilities. + * @param list<\WordPress\AiClient\Providers\Models\Enums\CapabilityEnum> $supportedCapabilities The model's supported capabilities. * @param list $supportedOptions The model's supported configuration options. * - * @throws InvalidArgumentException If arrays are not lists. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If arrays are not lists. */ public function __construct(string $id, string $name, array $supportedCapabilities, array $supportedOptions) { @@ -79242,7 +79242,7 @@ public function getName(): string * * @since 0.1.0 * - * @return list The supported capabilities. + * @return list<\WordPress\AiClient\Providers\Models\Enums\CapabilityEnum> The supported capabilities. */ public function getSupportedCapabilities(): array { @@ -79310,14 +79310,14 @@ public function __clone() * requiredOptions: list * } * - * @extends AbstractDataTransferObject + * @extends \WordPress\AiClient\Common\AbstractDataTransferObject */ class ModelRequirements extends \WordPress\AiClient\Common\AbstractDataTransferObject { public const KEY_REQUIRED_CAPABILITIES = 'requiredCapabilities'; public const KEY_REQUIRED_OPTIONS = 'requiredOptions'; /** - * @var list The capabilities that the model must support. + * @var list<\WordPress\AiClient\Providers\Models\Enums\CapabilityEnum> The capabilities that the model must support. */ protected array $requiredCapabilities; /** @@ -79329,10 +79329,10 @@ class ModelRequirements extends \WordPress\AiClient\Common\AbstractDataTransferO * * @since 0.1.0 * - * @param list $requiredCapabilities The capabilities that the model must support. + * @param list<\WordPress\AiClient\Providers\Models\Enums\CapabilityEnum> $requiredCapabilities The capabilities that the model must support. * @param list $requiredOptions The options that the model must support with specific values. * - * @throws InvalidArgumentException If arrays are not lists. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If arrays are not lists. */ public function __construct(array $requiredCapabilities, array $requiredOptions) { @@ -79342,7 +79342,7 @@ public function __construct(array $requiredCapabilities, array $requiredOptions) * * @since 0.1.0 * - * @return list The required capabilities. + * @return list<\WordPress\AiClient\Providers\Models\Enums\CapabilityEnum> The required capabilities. */ public function getRequiredCapabilities(): array { @@ -79373,8 +79373,8 @@ public function areMetBy(\WordPress\AiClient\Providers\Models\DTO\ModelMetadata * * @since 0.2.0 * - * @param CapabilityEnum $capability The capability the model must support. - * @param list $messages The messages in the conversation. + * @param \WordPress\AiClient\Providers\Models\Enums\CapabilityEnum $capability The capability the model must support. + * @param list<\WordPress\AiClient\Messages\DTO\Message> $messages The messages in the conversation. * @param ModelConfig $modelConfig The model configuration. * @return self The created requirements. */ @@ -79421,14 +79421,14 @@ public static function fromArray(array $array): self * value: mixed * } * - * @extends AbstractDataTransferObject + * @extends \WordPress\AiClient\Common\AbstractDataTransferObject */ class RequiredOption extends \WordPress\AiClient\Common\AbstractDataTransferObject { public const KEY_NAME = 'name'; public const KEY_VALUE = 'value'; /** - * @var OptionEnum The option name. + * @var \WordPress\AiClient\Providers\Models\Enums\OptionEnum The option name. */ protected \WordPress\AiClient\Providers\Models\Enums\OptionEnum $name; /** @@ -79440,7 +79440,7 @@ class RequiredOption extends \WordPress\AiClient\Common\AbstractDataTransferObje * * @since 0.1.0 * - * @param OptionEnum $name The option name. + * @param \WordPress\AiClient\Providers\Models\Enums\OptionEnum $name The option name. * @param mixed $value The value that the model must support for this option. */ public function __construct(\WordPress\AiClient\Providers\Models\Enums\OptionEnum $name, $value) @@ -79451,7 +79451,7 @@ public function __construct(\WordPress\AiClient\Providers\Models\Enums\OptionEnu * * @since 0.1.0 * - * @return OptionEnum The option name. + * @return \WordPress\AiClient\Providers\Models\Enums\OptionEnum The option name. */ public function getName(): \WordPress\AiClient\Providers\Models\Enums\OptionEnum { @@ -79506,14 +79506,14 @@ public static function fromArray(array $array): self * supportedValues?: list * } * - * @extends AbstractDataTransferObject + * @extends \WordPress\AiClient\Common\AbstractDataTransferObject */ class SupportedOption extends \WordPress\AiClient\Common\AbstractDataTransferObject { public const KEY_NAME = 'name'; public const KEY_SUPPORTED_VALUES = 'supportedValues'; /** - * @var OptionEnum The option name. + * @var \WordPress\AiClient\Providers\Models\Enums\OptionEnum The option name. */ protected \WordPress\AiClient\Providers\Models\Enums\OptionEnum $name; /** @@ -79525,10 +79525,10 @@ class SupportedOption extends \WordPress\AiClient\Common\AbstractDataTransferObj * * @since 0.1.0 * - * @param OptionEnum $name The option name. + * @param \WordPress\AiClient\Providers\Models\Enums\OptionEnum $name The option name. * @param list|null $supportedValues The supported values for this option, or null if any value is supported. * - * @throws InvalidArgumentException If supportedValues is not null and not a list. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If supportedValues is not null and not a list. */ public function __construct(\WordPress\AiClient\Providers\Models\Enums\OptionEnum $name, ?array $supportedValues = null) { @@ -79538,7 +79538,7 @@ public function __construct(\WordPress\AiClient\Providers\Models\Enums\OptionEnu * * @since 0.1.0 * - * @return OptionEnum The option name. + * @return \WordPress\AiClient\Providers\Models\Enums\OptionEnum The option name. */ public function getName(): \WordPress\AiClient\Providers\Models\Enums\OptionEnum { @@ -79747,8 +79747,8 @@ interface ImageGenerationModelInterface * * @since 0.1.0 * - * @param list $prompt Array of messages containing the image generation prompt. - * @return GenerativeAiResult Result containing generated images. + * @param list<\WordPress\AiClient\Messages\DTO\Message> $prompt Array of messages containing the image generation prompt. + * @return \WordPress\AiClient\Results\DTO\GenerativeAiResult Result containing generated images. */ public function generateImageResult(array $prompt): \WordPress\AiClient\Results\DTO\GenerativeAiResult; } @@ -79766,8 +79766,8 @@ interface ImageGenerationOperationModelInterface * * @since 0.1.0 * - * @param list $prompt Array of messages containing the image generation prompt. - * @return GenerativeAiOperation The initiated image generation operation. + * @param list<\WordPress\AiClient\Messages\DTO\Message> $prompt Array of messages containing the image generation prompt. + * @return \WordPress\AiClient\Operations\DTO\GenerativeAiOperation The initiated image generation operation. */ public function generateImageOperation(array $prompt): \WordPress\AiClient\Operations\DTO\GenerativeAiOperation; } @@ -79787,8 +79787,8 @@ interface SpeechGenerationModelInterface * * @since 0.1.0 * - * @param list $prompt Array of messages containing the speech generation prompt. - * @return GenerativeAiResult Result containing generated speech audio. + * @param list<\WordPress\AiClient\Messages\DTO\Message> $prompt Array of messages containing the speech generation prompt. + * @return \WordPress\AiClient\Results\DTO\GenerativeAiResult Result containing generated speech audio. */ public function generateSpeechResult(array $prompt): \WordPress\AiClient\Results\DTO\GenerativeAiResult; } @@ -79806,8 +79806,8 @@ interface SpeechGenerationOperationModelInterface * * @since 0.1.0 * - * @param list $prompt Array of messages containing the speech generation prompt. - * @return GenerativeAiOperation The initiated speech generation operation. + * @param list<\WordPress\AiClient\Messages\DTO\Message> $prompt Array of messages containing the speech generation prompt. + * @return \WordPress\AiClient\Operations\DTO\GenerativeAiOperation The initiated speech generation operation. */ public function generateSpeechOperation(array $prompt): \WordPress\AiClient\Operations\DTO\GenerativeAiOperation; } @@ -79827,8 +79827,8 @@ interface TextGenerationModelInterface * * @since 0.1.0 * - * @param list $prompt Array of messages containing the text generation prompt. - * @return GenerativeAiResult Result containing generated text. + * @param list<\WordPress\AiClient\Messages\DTO\Message> $prompt Array of messages containing the text generation prompt. + * @return \WordPress\AiClient\Results\DTO\GenerativeAiResult Result containing generated text. */ public function generateTextResult(array $prompt): \WordPress\AiClient\Results\DTO\GenerativeAiResult; } @@ -79846,8 +79846,8 @@ interface TextGenerationOperationModelInterface * * @since 0.1.0 * - * @param list $prompt Array of messages containing the text generation prompt. - * @return GenerativeAiOperation The initiated text generation operation. + * @param list<\WordPress\AiClient\Messages\DTO\Message> $prompt Array of messages containing the text generation prompt. + * @return \WordPress\AiClient\Operations\DTO\GenerativeAiOperation The initiated text generation operation. */ public function generateTextOperation(array $prompt): \WordPress\AiClient\Operations\DTO\GenerativeAiOperation; } @@ -79867,8 +79867,8 @@ interface TextToSpeechConversionModelInterface * * @since 0.1.0 * - * @param list $prompt Array of messages containing the text to convert to speech. - * @return GenerativeAiResult Result containing generated speech audio. + * @param list<\WordPress\AiClient\Messages\DTO\Message> $prompt Array of messages containing the text to convert to speech. + * @return \WordPress\AiClient\Results\DTO\GenerativeAiResult Result containing generated speech audio. */ public function convertTextToSpeechResult(array $prompt): \WordPress\AiClient\Results\DTO\GenerativeAiResult; } @@ -79886,8 +79886,8 @@ interface TextToSpeechConversionOperationModelInterface * * @since 0.1.0 * - * @param list $prompt Array of messages containing the text to convert to speech. - * @return GenerativeAiOperation The initiated text-to-speech conversion operation. + * @param list<\WordPress\AiClient\Messages\DTO\Message> $prompt Array of messages containing the text to convert to speech. + * @return \WordPress\AiClient\Operations\DTO\GenerativeAiOperation The initiated text-to-speech conversion operation. */ public function convertTextToSpeechOperation(array $prompt): \WordPress\AiClient\Operations\DTO\GenerativeAiOperation; } @@ -79907,8 +79907,8 @@ interface VideoGenerationModelInterface * * @since 1.3.0 * - * @param list $prompt Array of messages containing the video generation prompt. - * @return GenerativeAiResult Result containing generated videos. + * @param list<\WordPress\AiClient\Messages\DTO\Message> $prompt Array of messages containing the video generation prompt. + * @return \WordPress\AiClient\Results\DTO\GenerativeAiResult Result containing generated videos. */ public function generateVideoResult(array $prompt): \WordPress\AiClient\Results\DTO\GenerativeAiResult; } @@ -79926,8 +79926,8 @@ interface VideoGenerationOperationModelInterface * * @since 1.3.0 * - * @param list $prompt Array of messages containing the video generation prompt. - * @return GenerativeAiOperation The initiated video generation operation. + * @param list<\WordPress\AiClient\Messages\DTO\Message> $prompt Array of messages containing the video generation prompt. + * @return \WordPress\AiClient\Operations\DTO\GenerativeAiOperation The initiated video generation operation. */ public function generateVideoOperation(array $prompt): \WordPress\AiClient\Operations\DTO\GenerativeAiOperation; } @@ -79981,7 +79981,7 @@ public function generateImageResult(array $prompt): \WordPress\AiClient\Results\ * * @since 0.1.0 * - * @param list $prompt The prompt to generate an image for. Either a single message or a list of messages + * @param list<\WordPress\AiClient\Messages\DTO\Message> $prompt The prompt to generate an image for. Either a single message or a list of messages * from a chat. However as of today, OpenAI compatible image generation endpoints only * support a single user message. * @return ImageGenerationParams The parameters for the API request. @@ -79994,7 +79994,7 @@ protected function prepareGenerateImageParams(array $prompt): array * * @since 0.1.0 * - * @param list $messages The messages to prepare. However as of today, OpenAI compatible image generation + * @param list<\WordPress\AiClient\Messages\DTO\Message> $messages The messages to prepare. However as of today, OpenAI compatible image generation * endpoints only support a single user message. * @return string The prepared prompt parameter. */ @@ -80006,7 +80006,7 @@ protected function preparePromptParam(array $messages): string * * @since 0.1.0 * - * @param MediaOrientationEnum|null $orientation The desired media orientation. + * @param \WordPress\AiClient\Files\Enums\MediaOrientationEnum|null $orientation The desired media orientation. * @param string|null $aspectRatio The desired media aspect ratio. * @return string The prepared size parameter. */ @@ -80021,11 +80021,11 @@ protected function prepareSizeParam(?\WordPress\AiClient\Files\Enums\MediaOrient * * @since 0.1.0 * - * @param HttpMethodEnum $method The HTTP method. + * @param \WordPress\AiClient\Providers\Http\Enums\HttpMethodEnum $method The HTTP method. * @param string $path The API endpoint path, relative to the base URI. * @param array> $headers The request headers. * @param string|array|null $data The request data. - * @return Request The request object. + * @return \WordPress\AiClient\Providers\Http\DTO\Request The request object. */ abstract protected function createRequest(\WordPress\AiClient\Providers\Http\Enums\HttpMethodEnum $method, string $path, array $headers = [], $data = null): \WordPress\AiClient\Providers\Http\DTO\Request; /** @@ -80033,8 +80033,8 @@ abstract protected function createRequest(\WordPress\AiClient\Providers\Http\Enu * * @since 0.1.0 * - * @param Response $response The HTTP response to check. - * @throws ResponseException If the response is not successful. + * @param \WordPress\AiClient\Providers\Http\DTO\Response $response The HTTP response to check. + * @throws \WordPress\AiClient\Providers\Http\Exception\ResponseException If the response is not successful. */ protected function throwIfNotSuccessful(\WordPress\AiClient\Providers\Http\DTO\Response $response): void { @@ -80044,9 +80044,9 @@ protected function throwIfNotSuccessful(\WordPress\AiClient\Providers\Http\DTO\R * * @since 0.1.0 * - * @param Response $response The response from the API endpoint. + * @param \WordPress\AiClient\Providers\Http\DTO\Response $response The response from the API endpoint. * @param string $expectedMimeType The expected MIME type the response is in. - * @return GenerativeAiResult The parsed generative AI result. + * @return \WordPress\AiClient\Results\DTO\GenerativeAiResult The parsed generative AI result. */ protected function parseResponseToGenerativeAiResult(\WordPress\AiClient\Providers\Http\DTO\Response $response, string $expectedMimeType = 'image/png'): \WordPress\AiClient\Results\DTO\GenerativeAiResult { @@ -80059,8 +80059,8 @@ protected function parseResponseToGenerativeAiResult(\WordPress\AiClient\Provide * @param ChoiceData $choiceData The choice data from the API response. * @param int $index The index of the choice in the choices array. * @param string $expectedMimeType The expected MIME type the response is in. - * @return Candidate The parsed candidate. - * @throws RuntimeException If the choice data is invalid. + * @return \WordPress\AiClient\Results\DTO\Candidate The parsed candidate. + * @throws \WordPress\AiClient\Common\Exception\RuntimeException If the choice data is invalid. */ protected function parseResponseChoiceToCandidate(array $choiceData, int $index, string $expectedMimeType = 'image/png'): \WordPress\AiClient\Results\DTO\Candidate { @@ -80101,11 +80101,11 @@ protected function sendListModelsRequest(): array * * @since 0.1.0 * - * @param HttpMethodEnum $method The HTTP method. + * @param \WordPress\AiClient\Providers\Http\Enums\HttpMethodEnum $method The HTTP method. * @param string $path The API endpoint path, relative to the base URI. * @param array> $headers The request headers. * @param string|array|null $data The request data. - * @return Request The request object. + * @return \WordPress\AiClient\Providers\Http\DTO\Request The request object. */ abstract protected function createRequest(\WordPress\AiClient\Providers\Http\Enums\HttpMethodEnum $method, string $path, array $headers = [], $data = null): \WordPress\AiClient\Providers\Http\DTO\Request; /** @@ -80113,8 +80113,8 @@ abstract protected function createRequest(\WordPress\AiClient\Providers\Http\Enu * * @since 0.1.0 * - * @param Response $response The HTTP response to check. - * @throws ResponseException If the response is not successful. + * @param \WordPress\AiClient\Providers\Http\DTO\Response $response The HTTP response to check. + * @throws \WordPress\AiClient\Providers\Http\Exception\ResponseException If the response is not successful. */ protected function throwIfNotSuccessful(\WordPress\AiClient\Providers\Http\DTO\Response $response): void { @@ -80124,8 +80124,8 @@ protected function throwIfNotSuccessful(\WordPress\AiClient\Providers\Http\DTO\R * * @since 0.1.0 * - * @param Response $response The response from the API endpoint to list models. - * @return list List of model metadata objects. + * @param \WordPress\AiClient\Providers\Http\DTO\Response $response The response from the API endpoint to list models. + * @return list<\WordPress\AiClient\Providers\Models\DTO\ModelMetadata> List of model metadata objects. */ abstract protected function parseResponseToModelMetadataList(\WordPress\AiClient\Providers\Http\DTO\Response $response): array; } @@ -80182,7 +80182,7 @@ final public function generateTextResult(array $prompt): \WordPress\AiClient\Res * * @since 0.1.0 * - * @param list $prompt The prompt to generate text for. Either a single message or a list of messages + * @param list<\WordPress\AiClient\Messages\DTO\Message> $prompt The prompt to generate text for. Either a single message or a list of messages * from a chat. * @return array The parameters for the API request. */ @@ -80194,7 +80194,7 @@ protected function prepareGenerateTextParams(array $prompt): array * * @since 0.1.0 * - * @param list $messages The messages to prepare. + * @param list<\WordPress\AiClient\Messages\DTO\Message> $messages The messages to prepare. * @param string|null $systemInstruction An optional system instruction to prepend to the messages. * @return list> The prepared messages parameter. */ @@ -80206,7 +80206,7 @@ protected function prepareMessagesParam(array $messages, ?string $systemInstruct * * @since 0.1.0 * - * @param MessageRoleEnum $role The message role. + * @param \WordPress\AiClient\Messages\Enums\MessageRoleEnum $role The message role. * @return string The role for the API request. */ protected function getMessageRoleString(\WordPress\AiClient\Messages\Enums\MessageRoleEnum $role): string @@ -80217,9 +80217,9 @@ protected function getMessageRoleString(\WordPress\AiClient\Messages\Enums\Messa * * @since 0.1.0 * - * @param MessagePart $part The message part to get the data for. + * @param \WordPress\AiClient\Messages\DTO\MessagePart $part The message part to get the data for. * @return ?array The data for the message content part, or null if not applicable. - * @throws InvalidArgumentException If the message part type or data is unsupported. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the message part type or data is unsupported. */ protected function getMessagePartContentData(\WordPress\AiClient\Messages\DTO\MessagePart $part): ?array { @@ -80229,9 +80229,9 @@ protected function getMessagePartContentData(\WordPress\AiClient\Messages\DTO\Me * * @since 0.1.0 * - * @param MessagePart $part The message part to get the data for. + * @param \WordPress\AiClient\Messages\DTO\MessagePart $part The message part to get the data for. * @return ?array The data for the message tool call part, or null if not applicable. - * @throws InvalidArgumentException If the message part type or data is unsupported. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the message part type or data is unsupported. */ protected function getMessagePartToolCallData(\WordPress\AiClient\Messages\DTO\MessagePart $part): ?array { @@ -80241,8 +80241,8 @@ protected function getMessagePartToolCallData(\WordPress\AiClient\Messages\DTO\M * * @since 0.1.0 * - * @param array $outputModalities The output modalities to validate. - * @throws InvalidArgumentException If no text output modality is present. + * @param array<\WordPress\AiClient\Messages\Enums\ModalityEnum> $outputModalities The output modalities to validate. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If no text output modality is present. */ protected function validateOutputModalities(array $outputModalities): void { @@ -80252,7 +80252,7 @@ protected function validateOutputModalities(array $outputModalities): void * * @since 0.1.0 * - * @param array $modalities The modalities to prepare. + * @param array<\WordPress\AiClient\Messages\Enums\ModalityEnum> $modalities The modalities to prepare. * @return list The prepared modalities parameter. */ protected function prepareOutputModalitiesParam(array $modalities): array @@ -80263,7 +80263,7 @@ protected function prepareOutputModalitiesParam(array $modalities): array * * @since 0.1.0 * - * @param list $functionDeclarations The function declarations. + * @param list<\WordPress\AiClient\Tools\DTO\FunctionDeclaration> $functionDeclarations The function declarations. * @return list> The prepared tools parameter. */ protected function prepareToolsParam(array $functionDeclarations): array @@ -80290,11 +80290,11 @@ protected function prepareResponseFormatParam(?array $outputSchema): array * * @since 0.1.0 * - * @param HttpMethodEnum $method The HTTP method. + * @param \WordPress\AiClient\Providers\Http\Enums\HttpMethodEnum $method The HTTP method. * @param string $path The API endpoint path, relative to the base URI. * @param array> $headers The request headers. * @param string|array|null $data The request data. - * @return Request The request object. + * @return \WordPress\AiClient\Providers\Http\DTO\Request The request object. */ abstract protected function createRequest(\WordPress\AiClient\Providers\Http\Enums\HttpMethodEnum $method, string $path, array $headers = [], $data = null): \WordPress\AiClient\Providers\Http\DTO\Request; /** @@ -80302,8 +80302,8 @@ abstract protected function createRequest(\WordPress\AiClient\Providers\Http\Enu * * @since 0.1.0 * - * @param Response $response The HTTP response to check. - * @throws ResponseException If the response is not successful. + * @param \WordPress\AiClient\Providers\Http\DTO\Response $response The HTTP response to check. + * @throws \WordPress\AiClient\Providers\Http\Exception\ResponseException If the response is not successful. */ protected function throwIfNotSuccessful(\WordPress\AiClient\Providers\Http\DTO\Response $response): void { @@ -80313,8 +80313,8 @@ protected function throwIfNotSuccessful(\WordPress\AiClient\Providers\Http\DTO\R * * @since 0.1.0 * - * @param Response $response The response from the API endpoint. - * @return GenerativeAiResult The parsed generative AI result. + * @param \WordPress\AiClient\Providers\Http\DTO\Response $response The response from the API endpoint. + * @return \WordPress\AiClient\Results\DTO\GenerativeAiResult The parsed generative AI result. */ protected function parseResponseToGenerativeAiResult(\WordPress\AiClient\Providers\Http\DTO\Response $response): \WordPress\AiClient\Results\DTO\GenerativeAiResult { @@ -80326,8 +80326,8 @@ protected function parseResponseToGenerativeAiResult(\WordPress\AiClient\Provide * * @param ChoiceData $choiceData The choice data from the API response. * @param int $index The index of the choice in the choices array. - * @return Candidate The parsed candidate. - * @throws RuntimeException If the choice data is invalid. + * @return \WordPress\AiClient\Results\DTO\Candidate The parsed candidate. + * @throws \WordPress\AiClient\Common\Exception\RuntimeException If the choice data is invalid. */ protected function parseResponseChoiceToCandidate(array $choiceData, int $index): \WordPress\AiClient\Results\DTO\Candidate { @@ -80339,7 +80339,7 @@ protected function parseResponseChoiceToCandidate(array $choiceData, int $index) * * @param MessageData $messageData The message data from the API response. * @param int $index The index of the choice in the choices array. - * @return Message The parsed message. + * @return \WordPress\AiClient\Messages\DTO\Message The parsed message. */ protected function parseResponseChoiceMessage(array $messageData, int $index): \WordPress\AiClient\Messages\DTO\Message { @@ -80351,7 +80351,7 @@ protected function parseResponseChoiceMessage(array $messageData, int $index): \ * * @param MessageData $messageData The message data from the API response. * @param int $index The index of the choice in the choices array. - * @return MessagePart[] The parsed message parts. + * @return \WordPress\AiClient\Messages\DTO\MessagePart[] The parsed message parts. */ protected function parseResponseChoiceMessageParts(array $messageData, int $index): array { @@ -80362,7 +80362,7 @@ protected function parseResponseChoiceMessageParts(array $messageData, int $inde * @since 0.1.0 * * @param ToolCallData $toolCallData The tool call data from the API response. - * @return MessagePart|null The parsed message part for the tool call, or null if not applicable. + * @return \WordPress\AiClient\Messages\DTO\MessagePart|null The parsed message part for the tool call, or null if not applicable. */ protected function parseResponseChoiceMessageToolCallPart(array $toolCallData): ?\WordPress\AiClient\Messages\DTO\MessagePart { @@ -80388,9 +80388,9 @@ class ProviderRegistry implements \WordPress\AiClient\Providers\Http\Contracts\W * * @since 0.1.0 * - * @param class-string $className The fully qualified provider class name implementing the + * @param class-string<\WordPress\AiClient\Providers\Contracts\ProviderInterface> $className The fully qualified provider class name implementing the * ProviderInterface - * @throws InvalidArgumentException If the class doesn't exist or implement the required interface. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the class doesn't exist or implement the required interface. */ public function registerProvider(string $className): void { @@ -80410,7 +80410,7 @@ public function getRegisteredProviderIds(): array * * @since 0.1.0 * - * @param string|class-string $idOrClassName The provider ID or class name to check. + * @param string|class-string<\WordPress\AiClient\Providers\Contracts\ProviderInterface> $idOrClassName The provider ID or class name to check. * @return bool True if the provider is registered. */ public function hasProvider(string $idOrClassName): bool @@ -80421,9 +80421,9 @@ public function hasProvider(string $idOrClassName): bool * * @since 0.1.0 * - * @param string|class-string $idOrClassName The provider ID or class name. - * @return class-string The provider class name. - * @throws InvalidArgumentException If the provider is not registered. + * @param string|class-string<\WordPress\AiClient\Providers\Contracts\ProviderInterface> $idOrClassName The provider ID or class name. + * @return class-string<\WordPress\AiClient\Providers\Contracts\ProviderInterface> The provider class name. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the provider is not registered. */ public function getProviderClassName(string $idOrClassName): string { @@ -80433,9 +80433,9 @@ public function getProviderClassName(string $idOrClassName): string * * @since 0.2.0 * - * @param string|class-string $idOrClassName The provider ID or class name. + * @param string|class-string<\WordPress\AiClient\Providers\Contracts\ProviderInterface> $idOrClassName The provider ID or class name. * @return string The provider ID. - * @throws InvalidArgumentException If the provider is not registered. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the provider is not registered. */ public function getProviderId(string $idOrClassName): string { @@ -80445,7 +80445,7 @@ public function getProviderId(string $idOrClassName): string * * @since 0.1.0 * - * @param string|class-string $idOrClassName The provider ID or class name. + * @param string|class-string<\WordPress\AiClient\Providers\Contracts\ProviderInterface> $idOrClassName The provider ID or class name. * @return bool True if the provider is configured and ready to use. */ public function isProviderConfigured(string $idOrClassName): bool @@ -80456,8 +80456,8 @@ public function isProviderConfigured(string $idOrClassName): bool * * @since 0.1.0 * - * @param ModelRequirements $modelRequirements The requirements to match against. - * @return list List of provider models metadata that match requirements. + * @param \WordPress\AiClient\Providers\Models\DTO\ModelRequirements $modelRequirements The requirements to match against. + * @return list<\WordPress\AiClient\Providers\DTO\ProviderModelsMetadata> List of provider models metadata that match requirements. */ public function findModelsMetadataForSupport(\WordPress\AiClient\Providers\Models\DTO\ModelRequirements $modelRequirements): array { @@ -80468,8 +80468,8 @@ public function findModelsMetadataForSupport(\WordPress\AiClient\Providers\Model * @since 0.1.0 * * @param string $idOrClassName The provider ID or class name. - * @param ModelRequirements $modelRequirements The requirements to match against. - * @return list List of model metadata that match requirements. + * @param \WordPress\AiClient\Providers\Models\DTO\ModelRequirements $modelRequirements The requirements to match against. + * @return list<\WordPress\AiClient\Providers\Models\DTO\ModelMetadata> List of model metadata that match requirements. */ public function findProviderModelsMetadataForSupport(string $idOrClassName, \WordPress\AiClient\Providers\Models\DTO\ModelRequirements $modelRequirements): array { @@ -80479,11 +80479,11 @@ public function findProviderModelsMetadataForSupport(string $idOrClassName, \Wor * * @since 0.1.0 * - * @param string|class-string $idOrClassName The provider ID or class name. + * @param string|class-string<\WordPress\AiClient\Providers\Contracts\ProviderInterface> $idOrClassName The provider ID or class name. * @param string $modelId The model identifier. - * @param ModelConfig|null $modelConfig The model configuration. - * @return ModelInterface The configured model instance. - * @throws InvalidArgumentException If provider or model is not found. + * @param \WordPress\AiClient\Providers\Models\DTO\ModelConfig|null $modelConfig The model configuration. + * @return \WordPress\AiClient\Providers\Models\Contracts\ModelInterface The configured model instance. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If provider or model is not found. */ public function getProviderModel(string $idOrClassName, string $modelId, ?\WordPress\AiClient\Providers\Models\DTO\ModelConfig $modelConfig = null): \WordPress\AiClient\Providers\Models\Contracts\ModelInterface { @@ -80496,7 +80496,7 @@ public function getProviderModel(string $idOrClassName, string $modelId, ?\WordP * * @since 0.1.0 * - * @param ModelInterface $modelInstance The model instance to bind dependencies to. + * @param \WordPress\AiClient\Providers\Models\Contracts\ModelInterface $modelInstance The model instance to bind dependencies to. * @return void */ public function bindModelDependencies(\WordPress\AiClient\Providers\Models\Contracts\ModelInterface $modelInstance): void @@ -80515,8 +80515,8 @@ public function setHttpTransporter(\WordPress\AiClient\Providers\Http\Contracts\ * * @since 0.1.0 * - * @param string|class-string $idOrClassName The provider ID or class name. - * @param RequestAuthenticationInterface $requestAuthentication The request authentication instance. + * @param string|class-string<\WordPress\AiClient\Providers\Contracts\ProviderInterface> $idOrClassName The provider ID or class name. + * @param \WordPress\AiClient\Providers\Http\Contracts\RequestAuthenticationInterface $requestAuthentication The request authentication instance. */ public function setProviderRequestAuthentication(string $idOrClassName, \WordPress\AiClient\Providers\Http\Contracts\RequestAuthenticationInterface $requestAuthentication): void { @@ -80526,8 +80526,8 @@ public function setProviderRequestAuthentication(string $idOrClassName, \WordPre * * @since 0.1.0 * - * @param string|class-string $idOrClassName The provider ID or class name. - * @return ?RequestAuthenticationInterface The request authentication instance, or null if not set. + * @param string|class-string<\WordPress\AiClient\Providers\Contracts\ProviderInterface> $idOrClassName The provider ID or class name. + * @return ?\WordPress\AiClient\Providers\Http\Contracts\RequestAuthenticationInterface The request authentication instance, or null if not set. */ public function getProviderRequestAuthentication(string $idOrClassName): ?\WordPress\AiClient\Providers\Http\Contracts\RequestAuthenticationInterface { @@ -80558,7 +80558,7 @@ public function getId(): string; * * @since 0.1.0 * - * @return TokenUsage Token usage statistics. + * @return \WordPress\AiClient\Results\DTO\TokenUsage Token usage statistics. */ public function getTokenUsage(): \WordPress\AiClient\Results\DTO\TokenUsage; /** @@ -80566,7 +80566,7 @@ public function getTokenUsage(): \WordPress\AiClient\Results\DTO\TokenUsage; * * @since 0.1.0 * - * @return ProviderMetadata The provider metadata. + * @return \WordPress\AiClient\Providers\DTO\ProviderMetadata The provider metadata. */ public function getProviderMetadata(): \WordPress\AiClient\Providers\DTO\ProviderMetadata; /** @@ -80574,7 +80574,7 @@ public function getProviderMetadata(): \WordPress\AiClient\Providers\DTO\Provide * * @since 0.1.0 * - * @return ModelMetadata The model metadata. + * @return \WordPress\AiClient\Providers\Models\DTO\ModelMetadata The model metadata. */ public function getModelMetadata(): \WordPress\AiClient\Providers\Models\DTO\ModelMetadata; /** @@ -80596,11 +80596,11 @@ public function getAdditionalData(): array; * * @since 0.1.0 * - * @phpstan-import-type MessageArrayShape from Message + * @phpstan-import-type MessageArrayShape from \WordPress\AiClient\Messages\DTO\Message * * @phpstan-type CandidateArrayShape array{message: MessageArrayShape, finishReason: string} * - * @extends AbstractDataTransferObject + * @extends \WordPress\AiClient\Common\AbstractDataTransferObject */ class Candidate extends \WordPress\AiClient\Common\AbstractDataTransferObject { @@ -80611,8 +80611,8 @@ class Candidate extends \WordPress\AiClient\Common\AbstractDataTransferObject * * @since 0.1.0 * - * @param Message $message The generated message. - * @param FinishReasonEnum $finishReason The reason generation stopped. + * @param \WordPress\AiClient\Messages\DTO\Message $message The generated message. + * @param \WordPress\AiClient\Results\Enums\FinishReasonEnum $finishReason The reason generation stopped. */ public function __construct(\WordPress\AiClient\Messages\DTO\Message $message, \WordPress\AiClient\Results\Enums\FinishReasonEnum $finishReason) { @@ -80622,7 +80622,7 @@ public function __construct(\WordPress\AiClient\Messages\DTO\Message $message, \ * * @since 0.1.0 * - * @return Message The message. + * @return \WordPress\AiClient\Messages\DTO\Message The message. */ public function getMessage(): \WordPress\AiClient\Messages\DTO\Message { @@ -80632,7 +80632,7 @@ public function getMessage(): \WordPress\AiClient\Messages\DTO\Message * * @since 0.1.0 * - * @return FinishReasonEnum The finish reason. + * @return \WordPress\AiClient\Results\Enums\FinishReasonEnum The finish reason. */ public function getFinishReason(): \WordPress\AiClient\Results\Enums\FinishReasonEnum { @@ -80685,8 +80685,8 @@ public function __clone() * * @phpstan-import-type CandidateArrayShape from Candidate * @phpstan-import-type TokenUsageArrayShape from TokenUsage - * @phpstan-import-type ProviderMetadataArrayShape from ProviderMetadata - * @phpstan-import-type ModelMetadataArrayShape from ModelMetadata + * @phpstan-import-type ProviderMetadataArrayShape from \WordPress\AiClient\Providers\DTO\ProviderMetadata + * @phpstan-import-type ModelMetadataArrayShape from \WordPress\AiClient\Providers\Models\DTO\ModelMetadata * * @phpstan-type GenerativeAiResultArrayShape array{ * id: string, @@ -80697,7 +80697,7 @@ public function __clone() * additionalData?: array * } * - * @extends AbstractDataTransferObject + * @extends \WordPress\AiClient\Common\AbstractDataTransferObject */ class GenerativeAiResult extends \WordPress\AiClient\Common\AbstractDataTransferObject implements \WordPress\AiClient\Results\Contracts\ResultInterface { @@ -80715,10 +80715,10 @@ class GenerativeAiResult extends \WordPress\AiClient\Common\AbstractDataTransfer * @param string $id Unique identifier for this result. * @param Candidate[] $candidates The generated candidates. * @param TokenUsage $tokenUsage Token usage statistics. - * @param ProviderMetadata $providerMetadata Provider metadata. - * @param ModelMetadata $modelMetadata Model metadata. + * @param \WordPress\AiClient\Providers\DTO\ProviderMetadata $providerMetadata Provider metadata. + * @param \WordPress\AiClient\Providers\Models\DTO\ModelMetadata $modelMetadata Model metadata. * @param array $additionalData Additional data. - * @throws InvalidArgumentException If no candidates provided. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If no candidates provided. */ public function __construct(string $id, array $candidates, \WordPress\AiClient\Results\DTO\TokenUsage $tokenUsage, \WordPress\AiClient\Providers\DTO\ProviderMetadata $providerMetadata, \WordPress\AiClient\Providers\Models\DTO\ModelMetadata $modelMetadata, array $additionalData = []) { @@ -80754,7 +80754,7 @@ public function getTokenUsage(): \WordPress\AiClient\Results\DTO\TokenUsage * * @since 0.1.0 * - * @return ProviderMetadata The provider metadata. + * @return \WordPress\AiClient\Providers\DTO\ProviderMetadata The provider metadata. */ public function getProviderMetadata(): \WordPress\AiClient\Providers\DTO\ProviderMetadata { @@ -80764,7 +80764,7 @@ public function getProviderMetadata(): \WordPress\AiClient\Providers\DTO\Provide * * @since 0.1.0 * - * @return ModelMetadata The model metadata. + * @return \WordPress\AiClient\Providers\Models\DTO\ModelMetadata The model metadata. */ public function getModelMetadata(): \WordPress\AiClient\Providers\Models\DTO\ModelMetadata { @@ -80805,7 +80805,7 @@ public function hasMultipleCandidates(): bool * @since 0.1.0 * * @return string The text content. - * @throws RuntimeException If no text content. + * @throws \WordPress\AiClient\Common\Exception\RuntimeException If no text content. */ public function toText(): string { @@ -80817,8 +80817,8 @@ public function toText(): string * * @since 0.1.0 * - * @return File The file. - * @throws RuntimeException If no file content. + * @return \WordPress\AiClient\Files\DTO\File The file. + * @throws \WordPress\AiClient\Common\Exception\RuntimeException If no file content. */ public function toFile(): \WordPress\AiClient\Files\DTO\File { @@ -80828,8 +80828,8 @@ public function toFile(): \WordPress\AiClient\Files\DTO\File * * @since 0.1.0 * - * @return File The image file. - * @throws RuntimeException If no image content. + * @return \WordPress\AiClient\Files\DTO\File The image file. + * @throws \WordPress\AiClient\Common\Exception\RuntimeException If no image content. */ public function toImageFile(): \WordPress\AiClient\Files\DTO\File { @@ -80839,8 +80839,8 @@ public function toImageFile(): \WordPress\AiClient\Files\DTO\File * * @since 0.1.0 * - * @return File The audio file. - * @throws RuntimeException If no audio content. + * @return \WordPress\AiClient\Files\DTO\File The audio file. + * @throws \WordPress\AiClient\Common\Exception\RuntimeException If no audio content. */ public function toAudioFile(): \WordPress\AiClient\Files\DTO\File { @@ -80850,8 +80850,8 @@ public function toAudioFile(): \WordPress\AiClient\Files\DTO\File * * @since 0.1.0 * - * @return File The video file. - * @throws RuntimeException If no video content. + * @return \WordPress\AiClient\Files\DTO\File The video file. + * @throws \WordPress\AiClient\Common\Exception\RuntimeException If no video content. */ public function toVideoFile(): \WordPress\AiClient\Files\DTO\File { @@ -80861,7 +80861,7 @@ public function toVideoFile(): \WordPress\AiClient\Files\DTO\File * * @since 0.1.0 * - * @return Message The message. + * @return \WordPress\AiClient\Messages\DTO\Message The message. */ public function toMessage(): \WordPress\AiClient\Messages\DTO\Message { @@ -80881,7 +80881,7 @@ public function toTexts(): array * * @since 0.1.0 * - * @return list Array of files. + * @return list<\WordPress\AiClient\Files\DTO\File> Array of files. */ public function toFiles(): array { @@ -80891,7 +80891,7 @@ public function toFiles(): array * * @since 0.1.0 * - * @return list Array of image files. + * @return list<\WordPress\AiClient\Files\DTO\File> Array of image files. */ public function toImageFiles(): array { @@ -80901,7 +80901,7 @@ public function toImageFiles(): array * * @since 0.1.0 * - * @return list Array of audio files. + * @return list<\WordPress\AiClient\Files\DTO\File> Array of audio files. */ public function toAudioFiles(): array { @@ -80911,7 +80911,7 @@ public function toAudioFiles(): array * * @since 0.1.0 * - * @return list Array of video files. + * @return list<\WordPress\AiClient\Files\DTO\File> Array of video files. */ public function toVideoFiles(): array { @@ -80921,7 +80921,7 @@ public function toVideoFiles(): array * * @since 0.1.0 * - * @return list Array of messages. + * @return list<\WordPress\AiClient\Messages\DTO\Message> Array of messages. */ public function toMessages(): array { @@ -80982,7 +80982,7 @@ public function __clone() * thoughtTokens?: int * } * - * @extends AbstractDataTransferObject + * @extends \WordPress\AiClient\Common\AbstractDataTransferObject */ class TokenUsage extends \WordPress\AiClient\Common\AbstractDataTransferObject { @@ -81123,7 +81123,7 @@ class FinishReasonEnum extends \WordPress\AiClient\Common\AbstractEnum * * @phpstan-type FunctionCallArrayShape array{id?: string, name?: string, args?: mixed} * - * @extends AbstractDataTransferObject + * @extends \WordPress\AiClient\Common\AbstractDataTransferObject */ class FunctionCall extends \WordPress\AiClient\Common\AbstractDataTransferObject { @@ -81138,7 +81138,7 @@ class FunctionCall extends \WordPress\AiClient\Common\AbstractDataTransferObject * @param string|null $id Unique identifier for this function call. * @param string|null $name The name of the function to call. * @param mixed $args The arguments to pass to the function. - * @throws InvalidArgumentException If neither id nor name is provided. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If neither id nor name is provided. */ public function __construct(?string $id = null, ?string $name = null, $args = null) { @@ -81214,7 +81214,7 @@ public static function fromArray(array $array): self * parameters?: array * } * - * @extends AbstractDataTransferObject + * @extends \WordPress\AiClient\Common\AbstractDataTransferObject */ class FunctionDeclaration extends \WordPress\AiClient\Common\AbstractDataTransferObject { @@ -81300,7 +81300,7 @@ public static function fromArray(array $array): self * * @phpstan-type FunctionResponseArrayShape array{id?: string, name?: string, response: mixed} * - * @extends AbstractDataTransferObject + * @extends \WordPress\AiClient\Common\AbstractDataTransferObject */ class FunctionResponse extends \WordPress\AiClient\Common\AbstractDataTransferObject { @@ -81315,7 +81315,7 @@ class FunctionResponse extends \WordPress\AiClient\Common\AbstractDataTransferOb * @param string|null $id The ID of the function call this is responding to. * @param string|null $name The name of the function that was called. * @param mixed $response The response data from the function. - * @throws InvalidArgumentException If neither id nor name is provided. + * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If neither id nor name is provided. */ public function __construct(?string $id, ?string $name, $response) { @@ -81387,7 +81387,7 @@ public static function fromArray(array $array): self * * @phpstan-type WebSearchArrayShape array{allowedDomains?: string[], disallowedDomains?: string[]} * - * @extends AbstractDataTransferObject + * @extends \WordPress\AiClient\Common\AbstractDataTransferObject */ class WebSearch extends \WordPress\AiClient\Common\AbstractDataTransferObject { @@ -81469,7 +81469,7 @@ abstract class ClassDiscovery * * @return string|\Closure * - * @throws DiscoveryFailedException + * @throws \WordPress\AiClientDependencies\Http\Discovery\Exception\DiscoveryFailedException */ protected static function findOneByType($type) { @@ -81524,7 +81524,7 @@ protected static function evaluateCondition($condition) * * @return object * - * @throws ClassInstantiationFailedException + * @throws \WordPress\AiClientDependencies\Http\Discovery\Exception\ClassInstantiationFailedException */ protected static function instantiateClass($class) { @@ -81640,57 +81640,57 @@ final class PuliUnavailableException extends \WordPress\AiClientDependencies\Htt final class Psr17FactoryDiscovery extends \WordPress\AiClientDependencies\Http\Discovery\ClassDiscovery { /** - * @return RequestFactoryInterface + * @return \WordPress\AiClientDependencies\Psr\Http\Message\RequestFactoryInterface * - * @throws RealNotFoundException + * @throws \WordPress\AiClientDependencies\Http\Discovery\Exception\NotFoundException */ public static function findRequestFactory() { } /** - * @return ResponseFactoryInterface + * @return \WordPress\AiClientDependencies\Psr\Http\Message\ResponseFactoryInterface * - * @throws RealNotFoundException + * @throws \WordPress\AiClientDependencies\Http\Discovery\Exception\NotFoundException */ public static function findResponseFactory() { } /** - * @return ServerRequestFactoryInterface + * @return \WordPress\AiClientDependencies\Psr\Http\Message\ServerRequestFactoryInterface * - * @throws RealNotFoundException + * @throws \WordPress\AiClientDependencies\Http\Discovery\Exception\NotFoundException */ public static function findServerRequestFactory() { } /** - * @return StreamFactoryInterface + * @return \WordPress\AiClientDependencies\Psr\Http\Message\StreamFactoryInterface * - * @throws RealNotFoundException + * @throws \WordPress\AiClientDependencies\Http\Discovery\Exception\NotFoundException */ public static function findStreamFactory() { } /** - * @return UploadedFileFactoryInterface + * @return \WordPress\AiClientDependencies\Psr\Http\Message\UploadedFileFactoryInterface * - * @throws RealNotFoundException + * @throws \WordPress\AiClientDependencies\Http\Discovery\Exception\NotFoundException */ public static function findUploadedFileFactory() { } /** - * @return UriFactoryInterface + * @return \WordPress\AiClientDependencies\Psr\Http\Message\UriFactoryInterface * - * @throws RealNotFoundException + * @throws \WordPress\AiClientDependencies\Http\Discovery\Exception\NotFoundException */ public static function findUriFactory() { } /** - * @return UriFactoryInterface + * @return \WordPress\AiClientDependencies\Psr\Http\Message\UriFactoryInterface * - * @throws RealNotFoundException + * @throws \WordPress\AiClientDependencies\Http\Discovery\Exception\NotFoundException * * @deprecated This will be removed in 2.0. Consider using the findUriFactory() method. */ @@ -81708,9 +81708,9 @@ final class Psr18ClientDiscovery extends \WordPress\AiClientDependencies\Http\Di /** * Finds a PSR-18 HTTP Client. * - * @return ClientInterface + * @return \WordPress\AiClientDependencies\Psr\Http\Client\ClientInterface * - * @throws RealNotFoundException + * @throws \WordPress\AiClientDependencies\Http\Discovery\Exception\NotFoundException */ public static function find() { @@ -81777,11 +81777,11 @@ public static function getCandidates($type) class PuliBetaStrategy implements \WordPress\AiClientDependencies\Http\Discovery\Strategy\DiscoveryStrategy { /** - * @var GeneratedPuliFactory + * @var \WordPress\AiClientDependencies\Puli\GeneratedPuliFactory */ protected static $puliFactory; /** - * @var Discovery + * @var \WordPress\AiClientDependencies\Puli\Discovery\Api\Discovery */ protected static $puliDiscovery; public static function getCandidates($type) @@ -81968,7 +81968,7 @@ trait MessageTrait private $headerNames = []; /** @var string */ private $protocol = '1.1'; - /** @var StreamInterface|null */ + /** @var \WordPress\AiClientDependencies\Psr\Http\Message\StreamInterface|null */ private $stream; public function getProtocolVersion(): string { @@ -82353,7 +82353,7 @@ trait RequestTrait private $method; /** @var string|null */ private $requestTarget; - /** @var UriInterface|null */ + /** @var \WordPress\AiClientDependencies\Psr\Http\Message\UriInterface|null */ private $uri; public function getRequestTarget(): string { @@ -82398,9 +82398,9 @@ class Request implements \WordPress\AiClientDependencies\Psr\Http\Message\Reques use \WordPress\AiClientDependencies\Nyholm\Psr7\RequestTrait; /** * @param string $method HTTP method - * @param string|UriInterface $uri URI + * @param string|\WordPress\AiClientDependencies\Psr\Http\Message\UriInterface $uri URI * @param array $headers Request headers - * @param string|resource|StreamInterface|null $body Request body + * @param string|resource|\WordPress\AiClientDependencies\Psr\Http\Message\StreamInterface|null $body Request body * @param string $version Protocol version */ public function __construct(string $method, $uri, array $headers = [], $body = null, string $version = '1.1') @@ -82486,7 +82486,7 @@ class Response implements \WordPress\AiClientDependencies\Psr\Http\Message\Respo /** * @param int $status Status code * @param array $headers Response headers - * @param string|resource|StreamInterface|null $body Response body + * @param string|resource|\WordPress\AiClientDependencies\Psr\Http\Message\StreamInterface|null $body Response body * @param string $version Protocol version * @param string|null $reason Reason phrase (when empty a default will be used based on the status code) */ @@ -82768,9 +82768,9 @@ class ServerRequest implements \WordPress\AiClientDependencies\Psr\Http\Message\ use \WordPress\AiClientDependencies\Nyholm\Psr7\RequestTrait; /** * @param string $method HTTP method - * @param string|UriInterface $uri URI + * @param string|\WordPress\AiClientDependencies\Psr\Http\Message\UriInterface $uri URI * @param array $headers Request headers - * @param string|resource|StreamInterface|null $body Request body + * @param string|resource|\WordPress\AiClientDependencies\Psr\Http\Message\StreamInterface|null $body Request body * @param string $version Protocol version * @param array $serverParams Typically the $_SERVER superglobal */ @@ -83013,7 +83013,7 @@ public function __construct($body) /** * Creates a new PSR-7 stream. * - * @param string|resource|StreamInterface $body + * @param string|resource|\WordPress\AiClientDependencies\Psr\Http\Message\StreamInterface $body * * @throws \InvalidArgumentException */ @@ -83200,7 +83200,7 @@ public function getClientMediaType(): ?string; class UploadedFile implements \WordPress\AiClientDependencies\Psr\Http\Message\UploadedFileInterface { /** - * @param StreamInterface|string|resource $streamOrFile + * @param \WordPress\AiClientDependencies\Psr\Http\Message\StreamInterface|string|resource $streamOrFile * @param int $size * @param int $errorStatus * @param string|null $clientFilename @@ -83645,7 +83645,7 @@ interface NetworkExceptionInterface extends \WordPress\AiClientDependencies\Psr\ * * The request object MAY be a different object from the one passed to ClientInterface::sendRequest() * - * @return RequestInterface + * @return \WordPress\AiClientDependencies\Psr\Http\Message\RequestInterface */ public function getRequest(): \WordPress\AiClientDependencies\Psr\Http\Message\RequestInterface; } @@ -83663,7 +83663,7 @@ interface RequestExceptionInterface extends \WordPress\AiClientDependencies\Psr\ * * The request object MAY be a different object from the one passed to ClientInterface::sendRequest() * - * @return RequestInterface + * @return \WordPress\AiClientDependencies\Psr\Http\Message\RequestInterface */ public function getRequest(): \WordPress\AiClientDependencies\Psr\Http\Message\RequestInterface; } @@ -109588,7 +109588,7 @@ function wp_supports_ai(): bool * * @since 7.0.0 * - * @param string|MessagePart|Message|array|list|list|null $prompt Optional. Initial prompt content. + * @param string|\WordPress\AiClient\Messages\DTO\MessagePart|\WordPress\AiClient\Messages\DTO\Message|array|list|list<\WordPress\AiClient\Messages\DTO\Message>|null $prompt Optional. Initial prompt content. * A string for simple text prompts, * a MessagePart or Message object for * structured content, an array for a From 4d003248156a90f97978308119ecda35cfd917d7 Mon Sep 17 00:00:00 2001 From: thelovekesh Date: Sun, 28 Jun 2026 17:21:12 +0530 Subject: [PATCH 16/23] Disable matrix fail fast --- .github/workflows/integrate.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/integrate.yml b/.github/workflows/integrate.yml index c661802b..97a78a84 100644 --- a/.github/workflows/integrate.yml +++ b/.github/workflows/integrate.yml @@ -16,6 +16,7 @@ jobs: runs-on: "ubuntu-latest" strategy: + fail-fast: false matrix: php-version: - "7.4" From 9e5ece8538280076627e368598a5ffb22c6ec63e Mon Sep 17 00:00:00 2001 From: thelovekesh Date: Sun, 28 Jun 2026 17:47:59 +0530 Subject: [PATCH 17/23] Update core nav block functions --- functionMap.php | 3 +-- tests/data/return/block-core.php | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/functionMap.php b/functionMap.php index 0cb4cbc4..31a00424 100644 --- a/functionMap.php +++ b/functionMap.php @@ -78,13 +78,12 @@ 'block_core_navigation_build_css_font_sizes' => ['array{css_classes: list, inline_styles: string}'], 'block_core_navigation_link_build_css_colors' => ['array{css_classes: list, inline_styles: string}'], 'block_core_navigation_link_build_css_font_sizes' => ['array{css_classes: list, inline_styles: string}'], - 'block_core_navigation_link_render_submenu_icon' => ['non-falsy-string'], 'block_core_navigation_render_submenu_icon' => ['non-falsy-string'], 'block_core_navigation_submenu_build_css_font_sizes' => ['array{css_classes: list, inline_styles: string}'], - 'block_core_navigation_submenu_render_submenu_icon' => ['non-falsy-string'], 'block_core_page_list_build_css_colors' => ['array{css_classes: list, inline_styles: string, overlay_css_classes: list, overlay_inline_styles: string}'], 'block_core_page_list_build_css_font_sizes' => ['array{css_classes: list, inline_styles: string}'], 'block_core_post_time_to_read_word_count' => ['int<0, max>'], + 'block_core_shared_navigation_render_submenu_icon' => ['non-falsy-string'], 'block_version' => ["(\$content is '' ? 0 : 0|1)", '@phpstan-pure' => ''], 'bool_from_yn' => ["(\$yn is 'y' ? true : false)", '@phpstan-pure' => ''], 'build_dropdown_script_block_core_categories' => ['non-falsy-string'], diff --git a/tests/data/return/block-core.php b/tests/data/return/block-core.php index fe482753..ef2458bb 100644 --- a/tests/data/return/block-core.php +++ b/tests/data/return/block-core.php @@ -10,9 +10,8 @@ assertType('non-falsy-string', build_dropdown_script_block_core_categories(Faker::string())); // Submenu icon -assertType('non-falsy-string', block_core_navigation_link_render_submenu_icon()); assertType('non-falsy-string', block_core_navigation_render_submenu_icon()); -assertType('non-falsy-string', block_core_navigation_submenu_render_submenu_icon()); +assertType('non-falsy-string', block_core_shared_navigation_render_submenu_icon()); // Render block assertType('non-falsy-string', render_block_core_archives(Faker::array())); From 24f5ba9242013c87ab3a912751483e0541a3bf44 Mon Sep 17 00:00:00 2001 From: thelovekesh Date: Sun, 28 Jun 2026 17:48:14 +0530 Subject: [PATCH 18/23] Update array shape --- tests/data/assert/wp-is-numeric-array.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/data/assert/wp-is-numeric-array.php b/tests/data/assert/wp-is-numeric-array.php index 0e6a1770..7800ac15 100644 --- a/tests/data/assert/wp-is-numeric-array.php +++ b/tests/data/assert/wp-is-numeric-array.php @@ -64,7 +64,7 @@ // Check with mixed keys constant array $data = [1 => 'intKey', 'key' => 'stringKey']; if (wp_is_numeric_array($data)) { - assertType("non-empty-array<1, 'intKey'|'stringKey'>", $data); + assertType("array{1: 'intKey'}", $data); } if (! wp_is_numeric_array($data)) { assertType("array{1: 'intKey', key: 'stringKey'}", $data); From 505995802a54b686a0b60e354518b008bec1d814 Mon Sep 17 00:00:00 2001 From: thelovekesh Date: Sun, 28 Jun 2026 17:48:31 +0530 Subject: [PATCH 19/23] Update WordPress 7.0.0 stubs with FQCN resolved phpdocs --- wordpress-stubs.php | 1 + 1 file changed, 1 insertion(+) diff --git a/wordpress-stubs.php b/wordpress-stubs.php index 4ddb8ef2..101cc472 100644 --- a/wordpress-stubs.php +++ b/wordpress-stubs.php @@ -114656,6 +114656,7 @@ function block_core_shared_navigation_item_should_render($attributes, $block) * @since 5.9.0 * * @return string + * @phpstan-return non-falsy-string */ function block_core_shared_navigation_render_submenu_icon() { From b123d19edeae3b61e0aaaee65054ef6d7119e119 Mon Sep 17 00:00:00 2001 From: thelovekesh Date: Sun, 28 Jun 2026 17:54:22 +0530 Subject: [PATCH 20/23] Run composer test command items in parallel --- .github/workflows/integrate.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/integrate.yml b/.github/workflows/integrate.yml index 97a78a84..3f729c31 100644 --- a/.github/workflows/integrate.yml +++ b/.github/workflows/integrate.yml @@ -44,4 +44,7 @@ jobs: - run: "php -l wordpress-stubs.php" - run: "git diff --exit-code" - run: "php -f wordpress-stubs.php" - - run: "composer run test" + - parallel: + - run: "composer run test:phpunit" + - run: "composer run test:phpstan" + - run: "composer run test:cs" From 26c3d5f78911198067ca7801f03e9ef935191203 Mon Sep 17 00:00:00 2001 From: thelovekesh Date: Sun, 28 Jun 2026 23:20:46 +0530 Subject: [PATCH 21/23] Move phpdoc parser to php-stubs/generator --- composer.json | 2 - src/PhpDocFqcnRewriter.php | 71 -- src/PhpDocTypeNameResolver.php | 151 ----- src/Visitor.php | 89 +-- tests/PhpDocFqcnRewriterTest.php | 259 ------- tests/VisitorFqcnRewriteTest.php | 135 ---- wordpress-stubs.php | 1081 +++++++++++++++--------------- 7 files changed, 545 insertions(+), 1243 deletions(-) delete mode 100644 src/PhpDocFqcnRewriter.php delete mode 100644 src/PhpDocTypeNameResolver.php delete mode 100644 tests/PhpDocFqcnRewriterTest.php delete mode 100644 tests/VisitorFqcnRewriteTest.php diff --git a/composer.json b/composer.json index cff81ad4..acf163ef 100644 --- a/composer.json +++ b/composer.json @@ -11,11 +11,9 @@ "require-dev": { "php": "^7.4 || ^8.0", "dealerdirect/phpcodesniffer-composer-installer": "^1.0", - "mikey179/vfsstream": "^1.6", "nikic/php-parser": "^5.5", "php-stubs/generator": "^0.8.6", "phpdocumentor/reflection-docblock": "^6.0", - "phpstan/phpdoc-parser": "^2.3", "phpstan/phpstan": "^2.1", "phpunit/phpunit": "^9.5", "symfony/polyfill-php80": "*", diff --git a/src/PhpDocFqcnRewriter.php b/src/PhpDocFqcnRewriter.php deleted file mode 100644 index 2ff4bb4a..00000000 --- a/src/PhpDocFqcnRewriter.php +++ /dev/null @@ -1,71 +0,0 @@ - true, 'indexes' => true, 'comments' => true]); - $constExprParser = new ConstExprParser($config); - - $this->lexer = new Lexer($config); - $this->printer = new Printer(); - $this->docParser = new PhpDocParser($config, new TypeParser($config, $constExprParser), $constExprParser); - } - - /** - * @param array $imports - */ - public function rewrite(string $docComment, array $imports): string - { - if ($imports === []) { - return $docComment; - } - - $aliases = []; - foreach ($imports as $alias => $fqcn) { - $aliases[strtolower($alias)] = $fqcn; - } - - try { - $tokens = new TokenIterator($this->lexer->tokenize($docComment)); - $original = $this->docParser->parse($tokens); - } catch (\Throwable $e) { - return $docComment; - } - - $rewritten = $this->cloningTraverser()->traverse([$original])[0]; - (new NodeTraverser([new PhpDocTypeNameResolver($aliases)]))->traverse([$rewritten]); - - if (! $rewritten instanceof PhpDocNode) { - return $docComment; - } - - return $this->printer->printFormatPreserving($rewritten, $original, $tokens); - } - - private function cloningTraverser(): NodeTraverser - { - return new NodeTraverser([new CloningVisitor()]); - } -} diff --git a/src/PhpDocTypeNameResolver.php b/src/PhpDocTypeNameResolver.php deleted file mode 100644 index f559223e..00000000 --- a/src/PhpDocTypeNameResolver.php +++ /dev/null @@ -1,151 +0,0 @@ - */ - private array $aliases; - - /** @var array */ - private array $skip = []; - - /** @var array */ - private array $templateNames = []; - - /** - * @param array $aliases - */ - public function __construct(array $aliases) - { - $this->aliases = $aliases; - } - - /** - * @return null - */ - public function enterNode(Node $node): ?Node - { - if ($node instanceof TemplateTagValueNode) { - $this->templateNames[strtolower($node->name)] = true; - - return null; - } - - if ( - ($node instanceof ArrayShapeItemNode || $node instanceof ObjectShapeItemNode) - && $node->keyName !== null - ) { - $this->skip[spl_object_id($node->keyName)] = true; - } - - if ($node instanceof GenericTypeNode && strtolower($node->type->name) === 'int') { - foreach ($node->genericTypes as $bound) { - if (! ($bound instanceof IdentifierTypeNode) || ! in_array(strtolower($bound->name), ['min', 'max'], true)) { - continue; - } - - $this->skip[spl_object_id($bound)] = true; - } - } - - if ($node instanceof CallableTypeNode) { - $this->skip[spl_object_id($node->identifier)] = true; - } - - if ($node instanceof ConstFetchNode && $node->className !== '') { - if (! isset($this->skip[spl_object_id($node)])) { - $resolved = $this->resolveName($node->className); - if ($resolved !== null) { - $node->className = $resolved; - } - } - - return null; - } - - if (! ($node instanceof IdentifierTypeNode)) { - return null; - } - - if (isset($this->skip[spl_object_id($node)]) || isset($this->templateNames[strtolower($node->name)])) { - return null; - } - - $resolved = $this->resolveName($node->name); - if ($resolved !== null) { - $node->name = $resolved; - } - - return null; - } - - private function resolveName(string $name): ?string - { - if (strncmp($name, '\\', 1) === 0) { - return null; // already fully qualified - } - - $separatorPos = strpos($name, '\\'); - $firstSegment = $separatorPos === false ? $name : substr($name, 0, $separatorPos); - - if (in_array(strtolower($firstSegment), self::RESERVED, true)) { - return null; - } - - $alias = strtolower($firstSegment); - if (! isset($this->aliases[$alias])) { - return null; - } - - $remainder = $separatorPos === false ? '' : substr($name, $separatorPos); - - return sprintf('%s%s', $this->aliases[$alias], $remainder); - } -} diff --git a/src/Visitor.php b/src/Visitor.php index 0c47c424..018f42f9 100644 --- a/src/Visitor.php +++ b/src/Visitor.php @@ -30,9 +30,6 @@ use PhpParser\Node\Stmt\Namespace_; use PhpParser\Node\Stmt\Property; use PhpParser\Node\Stmt\Return_ as Stmt_Return; -use PhpParser\Node\Stmt\GroupUse; -use PhpParser\Node\Stmt\Use_; -use PhpParser\Node\UseItem; use StubsGenerator\NodeVisitor; use phpDocumentor\Reflection\DocBlockFactoryInterface; use phpDocumentor\Reflection\DocBlockFactory; @@ -60,29 +57,13 @@ class Visitor extends NodeVisitor /** @var array> */ private array $additionalTagStrings = []; - /** @var array */ - private array $useAliases = []; - private NodeFinder $nodeFinder; - private PhpDocFqcnRewriter $fqcnRewriter; - public function __construct() { $this->docBlockFactory = DocBlockFactory::createInstance(); $this->nodeFinder = new NodeFinder(); $this->functionMap = require sprintf('%s/functionMap.php', dirname(__DIR__)); - $this->fqcnRewriter = new PhpDocFqcnRewriter(); - } - - /** - * @param array<\PhpParser\Node> $nodes - * @return array<\PhpParser\Node>|null - */ - public function beforeTraverse(array $nodes) - { - $this->useAliases = []; - return parent::beforeTraverse($nodes); } /** @@ -94,8 +75,6 @@ public function enterNode(Node $node) parent::enterNode($node); - $this->trackUseStatements($node); - if (! ($node instanceof Function_) && ! ($node instanceof ClassMethod) && ! ($node instanceof Property) && ! ($node instanceof ClassLike)) { return null; } @@ -110,7 +89,6 @@ public function enterNode(Node $node) $symbolName = $this->getSymbolName($node); $node->setAttribute('WPStubs_symbolName', $symbolName); - $node->setAttribute('WPStubs_useAliases', $this->useAliases); $additions = $this->generateAdditionalTagsFromDoc($docComment); if (count($additions) > 0) { @@ -137,45 +115,6 @@ public function enterNode(Node $node) return null; } - private function trackUseStatements(Node $node): void - { - if ($node instanceof Namespace_) { - $this->useAliases = []; - return; - } - - if ($node instanceof Use_) { - foreach ($node->uses as $use) { - $this->addAlias($use, $node->type, ''); - } - - return; - } - - if (! ($node instanceof GroupUse)) { - return; - } - - foreach ($node->uses as $use) { - $this->addAlias($use, $node->type, sprintf('%s\\', $node->prefix->toString())); - } - } - - private function addAlias(UseItem $useItem, int $type, string $prefix): void - { - if ($useItem->type !== Use_::TYPE_UNKNOWN) { - $type = $useItem->type; - } - - if ($type !== Use_::TYPE_NORMAL) { - return; - } - - $alias = strtolower($useItem->getAlias()->toString()); - $fullyQualifiedName = ltrim(sprintf('%s%s', $prefix, $useItem->name->toString()), '\\'); - $this->useAliases[$alias] = sprintf('\\%s', $fullyQualifiedName); - } - private function getSymbolName(Node $node): string { if ((($node instanceof Function_) || ($node instanceof ClassMethod) || ($node instanceof ClassLike)) && $node->name instanceof Identifier) { @@ -248,41 +187,23 @@ private function postProcessNode(Node $node): void $node->setDocComment($newDocComment); } - $docComment = $node->getDocComment(); - - if ($docComment instanceof Doc) { - $newDocComment = $this->addStringTags($symbolName, $docComment); - - if ($newDocComment instanceof Doc) { - $node->setDocComment($newDocComment); - } + if (! isset($this->additionalTagStrings[$symbolName])) { + return; } - $this->rewriteImportedNames($node); - } - - private function rewriteImportedNames(Node $node): void - { $docComment = $node->getDocComment(); if (! ($docComment instanceof Doc)) { return; } - $aliases = $node->getAttribute('WPStubs_useAliases'); - if (! is_array($aliases) || count($aliases) === 0) { - return; - } - - /** @var array $aliases */ - $originalText = $docComment->getText(); - $newText = $this->fqcnRewriter->rewrite($originalText, $aliases); + $newDocComment = $this->addStringTags($symbolName, $docComment); - if ($newText === $originalText) { + if (! ($newDocComment instanceof Doc)) { return; } - $node->setDocComment(new Doc($newText, $docComment->getStartLine(), $docComment->getStartFilePos())); + $node->setDocComment($newDocComment); } /** diff --git a/tests/PhpDocFqcnRewriterTest.php b/tests/PhpDocFqcnRewriterTest.php deleted file mode 100644 index f6c3caf4..00000000 --- a/tests/PhpDocFqcnRewriterTest.php +++ /dev/null @@ -1,259 +0,0 @@ - $aliases - */ - public function testRewrite(array $aliases, string $input, string $expected): void - { - $rewriter = new PhpDocFqcnRewriter(); - self::assertSame($expected, $rewriter->rewrite($input, $aliases)); - } - - /** - * @return iterable, string, string}> - */ - public static function provideDocBlocks(): iterable - { - $std = [ - 'Foo' => '\Acme\Foo', - 'Bar' => '\Acme\Bar', - 'Baz' => '\Acme\Baz', - 'Message' => '\Acme\Messages\Message', - 'Coll' => '\Acme\Collection', - 'Sub' => '\Acme\Sub', - 'Qux' => '\Acme\Aliased', - 'Ex' => '\Acme\Exceptions\MyException', - ]; - - // Type annotations in various tags. - yield '@param' => [$std, '/** @param Foo $x */', '/** @param \Acme\Foo $x */']; - yield '@return' => [$std, '/** @return Foo */', '/** @return \Acme\Foo */']; - yield '@var with element name' => [$std, '/** @var Foo $bar */', '/** @var \Acme\Foo $bar */']; - yield '@var without element name' => [$std, '/** @var Foo */', '/** @var \Acme\Foo */']; - yield '@throws' => [$std, '/** @throws Ex */', '/** @throws \Acme\Exceptions\MyException */']; - yield '@property' => [$std, '/** @property Foo $x */', '/** @property \Acme\Foo $x */']; - yield '@property-read' => [$std, '/** @property-read Foo $x */', '/** @property-read \Acme\Foo $x */']; - yield '@property-write' => [$std, '/** @property-write Foo $x */', '/** @property-write \Acme\Foo $x */']; - yield '@method return and param' => [ - $std, - '/** @method Foo doThing(Baz $b) */', - '/** @method \Acme\Foo doThing(\Acme\Baz $b) */', - ]; - yield '@method static return type' => [ - $std, - '/** @method static Foo make() */', - '/** @method static \Acme\Foo make() */', - ]; - yield '@method multiple params' => [ - $std, - '/** @method Bar handle(Foo $a, Baz $b, int $c) */', - '/** @method \Acme\Bar handle(\Acme\Foo $a, \Acme\Baz $b, int $c) */', - ]; - yield '@mixin' => [$std, '/** @mixin Foo */', '/** @mixin \Acme\Foo */']; - - // PHPStan-specific tags. - yield '@phpstan-param' => [$std, '/** @phpstan-param Foo $x */', '/** @phpstan-param \Acme\Foo $x */']; - yield '@phpstan-return' => [$std, '/** @phpstan-return Foo */', '/** @phpstan-return \Acme\Foo */']; - yield '@phpstan-var' => [$std, '/** @phpstan-var Foo $x */', '/** @phpstan-var \Acme\Foo $x */']; - yield '@phpstan-type right-hand side' => [ - $std, - '/** @phpstan-type Prompt Foo|Message|int */', - '/** @phpstan-type Prompt \Acme\Foo|\Acme\Messages\Message|int */', - ]; - yield '@phpstan-import-type from target' => [ - $std, - '/** @phpstan-import-type Shape from Message */', - '/** @phpstan-import-type Shape from \Acme\Messages\Message */', - ]; - yield '@phpstan-import-type with as' => [ - $std, - '/** @phpstan-import-type Shape from Message as Renamed */', - '/** @phpstan-import-type Shape from \Acme\Messages\Message as Renamed */', - ]; - - // Type expressions in various forms. - yield 'union' => [$std, '/** @param Foo|Bar $x */', '/** @param \Acme\Foo|\Acme\Bar $x */']; - yield 'union with builtin' => [$std, '/** @param Foo|null $x */', '/** @param \Acme\Foo|null $x */']; - yield 'nullable shorthand' => [$std, '/** @param ?Foo $x */', '/** @param ?\Acme\Foo $x */']; - yield 'intersection' => [$std, '/** @param Foo&Bar $x */', '/** @param \Acme\Foo&\Acme\Bar $x */']; - yield 'generic list' => [$std, '/** @param list $x */', '/** @param list<\Acme\Foo> $x */']; - yield 'generic array with key' => [ - $std, - '/** @param array $x */', - '/** @param array $x */', - ]; - yield 'generic custom collection' => [ - $std, - '/** @param Coll $x */', - '/** @param \Acme\Collection<\Acme\Foo> $x */', - ]; - yield 'array shape' => [ - $std, - '/** @param array{a: Foo, b?: Bar} $x */', - '/** @param array{a: \Acme\Foo, b?: \Acme\Bar} $x */', - ]; - yield 'nested generics' => [ - $std, - '/** @param array> $x */', - '/** @param array> $x */', - ]; - yield 'callable' => [ - $std, - '/** @param callable(Foo): Bar $x */', - '/** @param callable(\Acme\Foo): \Acme\Bar $x */', - ]; - yield 'variadic' => [$std, '/** @param Foo ...$x */', '/** @param \Acme\Foo ...$x */']; - yield 'by reference' => [$std, '/** @param Foo &$x */', '/** @param \Acme\Foo &$x */']; - yield 'class-string generic' => [ - $std, - '/** @param class-string $x */', - '/** @param class-string<\Acme\Foo> $x */', - ]; - - // Types that are imported via an alias. - yield 'aliased import' => [$std, '/** @param Qux $x */', '/** @param \Acme\Aliased $x */']; - yield 'qualified name, imported first segment' => [ - $std, - '/** @param Sub\Deep $x */', - '/** @param \Acme\Sub\Deep $x */', - ]; - yield 'case-insensitive alias match' => [$std, '/** @param foo $x */', '/** @param \Acme\Foo $x */']; - - // Reserved words and built-in types that should not be rewritten. - yield 'builtin scalar untouched' => [$std, '/** @param string $x */', '/** @param string $x */']; - yield 'builtin array untouched' => [$std, '/** @param array $x */', '/** @param array $x */']; - yield 'reserved static untouched' => [$std, '/** @return static */', '/** @return static */']; - yield 'reserved self untouched' => [$std, '/** @return self */', '/** @return self */']; - yield 'pseudo-type list untouched' => [$std, '/** @return list */', '/** @return list */']; - yield 'already fully qualified untouched' => [ - $std, - '/** @param \Already\Qualified $x */', - '/** @param \Already\Qualified $x */', - ]; - yield 'unimported same-namespace class untouched' => [ - $std, - '/** @param NotImported $x */', - '/** @param NotImported $x */', - ]; - yield 'local type alias untouched' => [$std, '/** @param Prompt $x */', '/** @param Prompt $x */']; - yield 'class name in description untouched' => [ - $std, - '/** @param Foo $x A Foo instance to use. */', - '/** @param \Acme\Foo $x A Foo instance to use. */', - ]; - - // Formatting and layout preservation. - yield 'multi-line layout preserved' => [ - $std, - <<<'DOC' - /** - * Does a thing with a Foo. - * - * @since 1.2.3 - * - * @param Foo $foo The foo to use. - * @param int $count How many. - * @return Bar The result. - * @throws Ex When it breaks. - */ - DOC, - <<<'DOC' - /** - * Does a thing with a Foo. - * - * @since 1.2.3 - * - * @param \Acme\Foo $foo The foo to use. - * @param int $count How many. - * @return \Acme\Bar The result. - * @throws \Acme\Exceptions\MyException When it breaks. - */ - DOC, - ]; - yield 'multiple tags in one block' => [ - $std, - <<<'DOC' - /** - * @param Foo $a - * @param Bar $b - * @return Baz - */ - DOC, - <<<'DOC' - /** - * @param \Acme\Foo $a - * @param \Acme\Bar $b - * @return \Acme\Baz - */ - DOC, - ]; - yield 'empty alias map leaves everything untouched' => [ - [], - '/** @param Foo $x */', - '/** @param Foo $x */', - ]; - yield 'unparsable input returned unchanged' => [ - $std, - 'this is not a doc comment', - 'this is not a doc comment', - ]; - - // Types in array/object shapes. - yield 'shape key matching import left alone' => [ - $std, - '/** @param array{message: string, body: Bar} $x */', - '/** @param array{message: string, body: \Acme\Bar} $x */', - ]; - yield 'object shape key left alone' => [ - $std, - '/** @return object{message: int} */', - '/** @return object{message: int} */', - ]; - yield 'class constant type qualified' => [ - $std, - '/** @return Foo::TYPE_X */', - '/** @return \Acme\Foo::TYPE_X */', - ]; - yield 'enum case wildcard qualified' => [ - $std, - '/** @param Foo::* $x */', - '/** @param \Acme\Foo::* $x */', - ]; - yield 'old-style array suffix' => [ - $std, - '/** @param Foo[] $x */', - '/** @param \Acme\Foo[] $x */', - ]; - - // Template annotations. - yield 'template shadows import' => [ - $std, - <<<'DOC' - /** - * @template Foo - * @param Foo $x - * @return Bar - */ - DOC, - <<<'DOC' - /** - * @template Foo - * @param Foo $x - * @return \Acme\Bar - */ - DOC, - ]; - } -} diff --git a/tests/VisitorFqcnRewriteTest.php b/tests/VisitorFqcnRewriteTest.php deleted file mode 100644 index 8705c0f3..00000000 --- a/tests/VisitorFqcnRewriteTest.php +++ /dev/null @@ -1,135 +0,0 @@ - The collected messages. - */ - protected array $messages = []; - - /** - * @param Message $message The message to add. - * @param Registry $registry The registry (aliased import). - * @return Message - * @throws InvalidArgumentException When invalid. - */ - public function add(Message $message, Registry $registry): Message - { - return $message; - } - - /** - * @param Message ...$parts The parts. - * @return self - */ - public function withParts(Message ...$parts): self - { - return $this; - } - } - PHP; - - $output = $this->generateStubs($source); - - // Tags are rewritten to fully qualified names. - self::assertStringContainsString('@var list<\Acme\Models\Message>', $output); - self::assertStringContainsString('@param \Acme\Models\Message $message', $output); - self::assertStringContainsString('@param \Acme\Models\ProviderRegistry $registry', $output); - self::assertStringContainsString('@return \Acme\Models\Message', $output); - self::assertStringContainsString('@throws \Acme\Exceptions\InvalidArgumentException When invalid.', $output); - self::assertStringContainsString('@param \Acme\Models\Message ...$parts', $output); - - // Unqualified names no longer appear in the output. - self::assertStringNotContainsString('@param Message ', $output); - self::assertStringNotContainsString('@param Registry ', $output); - self::assertStringNotContainsString('@throws InvalidArgumentException', $output); - self::assertStringNotContainsString('@var list', $output); - - // Type declarations are rewritten to fully qualified names. - self::assertStringContainsString('public function add(\Acme\Models\Message $message', $output); - - // Imports no longer appear in the output. - self::assertStringNotContainsString('use Acme\Models\Message', $output); - - // Descriptions are preserved verbatim. - self::assertStringContainsString('The registry (aliased import).', $output); - } - - public function testShapeKeysConstantsAndTemplatesAreHandled(): void - { - $source = <<<'PHP' - generateStubs($source); - - // Template names are preserved verbatim, even if they match an import. - self::assertStringContainsString('@param Reply $x', $output); - self::assertStringNotContainsString('@param \Acme\Models\Reply $x', $output); - - // Shape keys are preserved verbatim, even if they match an import. - self::assertStringContainsString('status: int', $output); - self::assertStringContainsString('extra: \Acme\Models\Status', $output); - self::assertStringNotContainsString('\Acme\Models\Status: int', $output); - - // Return types that reference constants are rewritten to fully qualified names. - self::assertStringContainsString('@return \Acme\Models\Status::ACTIVE', $output); - } - - private function generateStubs(string $source): string - { - $root = vfsStream::setup('stubs'); - vfsStream::newFile('fixture.php')->at($root)->setContent($source); - - $finder = Finder::create()->in(vfsStream::url('stubs'))->name('*.php'); - return (new StubsGenerator())->generate($finder, new Visitor())->prettyPrint(); - } -} diff --git a/wordpress-stubs.php b/wordpress-stubs.php index 101cc472..8c3a7a27 100644 --- a/wordpress-stubs.php +++ b/wordpress-stubs.php @@ -15517,13 +15517,13 @@ class OAuth implements \PHPMailer\PHPMailer\OAuthTokenProvider /** * An instance of the League OAuth Client Provider. * - * @var \League\OAuth2\Client\Provider\AbstractProvider + * @var AbstractProvider */ protected $provider; /** * The current OAuth access token. * - * @var \League\OAuth2\Client\Token\AccessToken + * @var AccessToken */ protected $oauthToken; /** @@ -15563,7 +15563,7 @@ public function __construct($options) /** * Get a new RefreshToken. * - * @return \League\OAuth2\Client\Grant\RefreshToken + * @return RefreshToken */ protected function getGrant() { @@ -15571,7 +15571,7 @@ protected function getGrant() /** * Get a new AccessToken. * - * @return \League\OAuth2\Client\Token\AccessToken + * @return AccessToken */ protected function getToken() { @@ -22278,7 +22278,7 @@ class SimplePie */ public $max_checked_feeds = 10; /** - * @var array<\SimplePie\HTTP\Response>|null All the feeds found during the autodiscovery process + * @var array|null All the feeds found during the autodiscovery process * @see SimplePie::get_all_discovered_feeds() * @access private */ @@ -22497,7 +22497,7 @@ public function enable_cache(bool $enable = true) /** * Set a PSR-16 implementation as cache * - * @param \Psr\SimpleCache\CacheInterface $cache The PSR-16 cache implementation + * @param CacheInterface $cache The PSR-16 cache implementation * * @return void */ @@ -22780,7 +22780,7 @@ public function set_restriction_class(string $class = \SimplePie\Restriction::cl * * @deprecated since SimplePie 1.3, use {@see get_registry()} instead * - * @param class-string<\SimplePie\Content\Type\Sniffer> $class Name of custom class + * @param class-string $class Name of custom class * * @return bool True on success, false otherwise */ @@ -22811,7 +22811,7 @@ public function set_useragent(?string $ua = null) /** * Set a namefilter to modify the cache filename with * - * @param \SimplePie\Cache\NameFilter $filter + * @param NameFilter $filter * * @return void */ @@ -22991,7 +22991,7 @@ public function init() * * If the data is already cached, attempt to fetch it from there instead * - * @param \SimplePie\Cache\Base|\SimplePie\Cache\DataCache|false $cache Cache handler, or false to not load from the cache + * @param Base|DataCache|false $cache Cache handler, or false to not load from the cache * @return array{array, string}|bool Returns true if the data was loaded from the cache, or an array of HTTP headers and sniffed type */ protected function fetch_data(&$cache) @@ -23316,7 +23316,7 @@ public function get_links(string $rel = 'alternate') { } /** - * @return ?array<\SimplePie\HTTP\Response> + * @return ?array */ public function get_all_discovered_feeds() { @@ -23652,7 +23652,7 @@ class Cache * * These receive 3 parameters to their constructor, as documented in * {@see register()} - * @var array> + * @var array> */ protected static $handlers = ['mysql' => \SimplePie\Cache\MySQL::class, 'memcache' => \SimplePie\Cache\Memcache::class, 'memcached' => \SimplePie\Cache\Memcached::class, 'redis' => \SimplePie\Cache\Redis::class]; /** @@ -23660,8 +23660,8 @@ class Cache * * @param string $location URL location (scheme is used to determine handler) * @param string $filename Unique identifier for cache object - * @param \SimplePie\Cache\Base::TYPE_FEED|\SimplePie\Cache\Base::TYPE_IMAGE $extension 'spi' or 'spc' - * @return \SimplePie\Cache\Base Type of object depends on scheme of `$location` + * @param Base::TYPE_FEED|Base::TYPE_IMAGE $extension 'spi' or 'spc' + * @return Base Type of object depends on scheme of `$location` */ public static function get_handler(string $location, string $filename, $extension) { @@ -23672,8 +23672,8 @@ public static function get_handler(string $location, string $filename, $extensio * @deprecated since SimplePie 1.3.1, use {@see get_handler()} instead * @param string $location * @param string $filename - * @param \SimplePie\Cache\Base::TYPE_FEED|\SimplePie\Cache\Base::TYPE_IMAGE $extension - * @return \SimplePie\Cache\Base + * @param Base::TYPE_FEED|Base::TYPE_IMAGE $extension + * @return Base */ public function create(string $location, string $filename, $extension) { @@ -23682,7 +23682,7 @@ public function create(string $location, string $filename, $extension) * Register a handler * * @param string $type DSN type to register for - * @param class-string<\SimplePie\Cache\Base> $class Name of handler class. Must implement Base + * @param class-string $class Name of handler class. Must implement Base * @return void */ public static function register(string $type, $class) @@ -23789,7 +23789,7 @@ abstract class DB implements \SimplePie\Cache\Base * Converts a given {@see SimplePie} object into data to be stored * * @param \SimplePie\SimplePie $data - * @return array{string, array} First item is the serialized data for storage, second item is the unique ID for this item + * @return array{string, array} First item is the serialized data for storage, second item is the unique ID for this item */ protected static function prepare_simplepie_object_for_cache(\SimplePie\SimplePie $data) { @@ -23913,7 +23913,7 @@ class Memcache implements \SimplePie\Cache\Base /** * Memcache instance * - * @var \Memcache + * @var NativeMemcache */ protected $cache; /** @@ -24004,7 +24004,7 @@ class Memcached implements \SimplePie\Cache\Base { /** * NativeMemcached instance - * @var \Memcached + * @var NativeMemcached */ protected $cache; /** @@ -24180,7 +24180,7 @@ class Redis implements \SimplePie\Cache\Base /** * Redis instance * - * @var \Redis + * @var NativeRedis */ protected $cache; /** @@ -24206,7 +24206,7 @@ public function __construct(string $location, string $name, $options = null) { } /** - * @param \Redis $cache + * @param NativeRedis $cache * @return void */ public function setRedisClient(\Redis $cache) @@ -24490,13 +24490,13 @@ class Sniffer /** * File object * - * @var \SimplePie\File|\SimplePie\HTTP\Response + * @var File|Response */ public $file; /** * Create an instance of the class with the input file * - * @param \SimplePie\File|\SimplePie\HTTP\Response $file Input file + * @param File|Response $file Input file */ public function __construct( /* File */ @@ -25847,7 +25847,7 @@ public static function prepareHeaders(string $headers, int $count = 1) /** * @deprecated since SimplePie 1.7.0, use "SimplePie\HTTP\Parser" instead * @template Psr7Compatible of bool - * @extends \SimplePie\HTTP\Parser + * @extends Parser */ class SimplePie_HTTP_Parser extends \SimplePie\HTTP\Parser { @@ -26721,8 +26721,8 @@ public function set_registry(\SimplePie\Registry $registry) } /** * @param SimplePie::LOCATOR_* $type - * @param array<\SimplePie\HTTP\Response>|null $working - * @return \SimplePie\HTTP\Response|null + * @param array|null $working + * @return Response|null */ public function find(int $type = \SimplePie\SimplePie::LOCATOR_ALL, ?array &$working = null) { @@ -26740,15 +26740,15 @@ public function get_base() { } /** - * @return array<\SimplePie\HTTP\Response>|null + * @return array|null */ public function autodiscovery() { } /** * @param string[] $done - * @param array $feeds - * @return array + * @param array $feeds + * @return array */ protected function search_elements_by_tag(string $name, array &$done, array $feeds) { @@ -26769,14 +26769,14 @@ public function get_rel_link(string $rel) } /** * @param string[] $array - * @return array<\SimplePie\HTTP\Response>|null + * @return array|null */ public function extension(array &$array) { } /** * @param string[] $array - * @return array<\SimplePie\HTTP\Response>|null + * @return array|null */ public function body(array &$array) { @@ -27923,7 +27923,7 @@ public function get_data() { } /** - * @param \XMLParser|resource|null $parser + * @param XMLParser|resource|null $parser * @param array $attributes * @return void */ @@ -27931,14 +27931,14 @@ public function tag_open($parser, string $tag, array $attributes) { } /** - * @param \XMLParser|resource|null $parser + * @param XMLParser|resource|null $parser * @return void */ public function cdata($parser, string $cdata) { } /** - * @param \XMLParser|resource|null $parser + * @param XMLParser|resource|null $parser * @return void */ public function tag_close($parser, string $tag) @@ -28276,7 +28276,7 @@ public function set_registry(\SimplePie\Registry $registry) { } /** - * @param (string&(callable(string): string))|\SimplePie\Cache\NameFilter $cache_name_function + * @param (string&(callable(string): string))|NameFilter $cache_name_function * @param class-string $cache_class * @return void */ @@ -28941,7 +28941,7 @@ interface DataCache * * @return array|mixed The value of the item from the cache, or $default in case of cache miss. * - * @throws \InvalidArgumentException + * @throws InvalidArgumentException * MUST be thrown if the $key string is not a legal value. */ public function get_data(string $key, $default = null); @@ -28961,7 +28961,7 @@ public function get_data(string $key, $default = null); * * @return bool True on success and false on failure. * - * @throws \InvalidArgumentException + * @throws InvalidArgumentException * MUST be thrown if the $key string is not a legal value. */ public function set_data(string $key, array $value, ?int $ttl = null): bool; @@ -28977,7 +28977,7 @@ public function set_data(string $key, array $value, ?int $ttl = null): bool; * * @return bool True if the item was successfully removed. False if there was an error. * - * @throws \InvalidArgumentException + * @throws InvalidArgumentException * MUST be thrown if the $key string is not a legal value. */ public function delete_data(string $key): bool; @@ -29005,7 +29005,7 @@ public function __construct(\SimplePie\Cache\Base $cache) * * @return array|mixed The value of the item from the cache, or $default in case of cache miss. * - * @throws \InvalidArgumentException + * @throws InvalidArgumentException * MUST be thrown if the $key string is not a legal value. */ public function get_data(string $key, $default = null) @@ -29027,7 +29027,7 @@ public function get_data(string $key, $default = null) * * @return bool True on success and false on failure. * - * @throws \InvalidArgumentException + * @throws InvalidArgumentException * MUST be thrown if the $key string is not a legal value. */ public function set_data(string $key, array $value, ?int $ttl = null): bool @@ -29045,7 +29045,7 @@ public function set_data(string $key, array $value, ?int $ttl = null): bool * * @return bool True if the item was successfully removed. False if there was an error. * - * @throws \InvalidArgumentException + * @throws InvalidArgumentException * MUST be thrown if the $key string is not a legal value. */ public function delete_data(string $key): bool @@ -29126,7 +29126,7 @@ final class Psr16 implements \SimplePie\Cache\DataCache /** * PSR-16 cache implementation * - * @param \Psr\SimpleCache\CacheInterface $cache + * @param CacheInterface $cache */ public function __construct(\Psr\SimpleCache\CacheInterface $cache) { @@ -29144,7 +29144,7 @@ public function __construct(\Psr\SimpleCache\CacheInterface $cache) * * @return array|mixed The value of the item from the cache, or $default in case of cache miss. * - * @throws \Psr\SimpleCache\InvalidArgumentException&\Throwable + * @throws InvalidArgumentException&Throwable * MUST be thrown if the $key string is not a legal value. */ public function get_data(string $key, $default = null) @@ -29166,7 +29166,7 @@ public function get_data(string $key, $default = null) * * @return bool True on success and false on failure. * - * @throws \Psr\SimpleCache\InvalidArgumentException&\Throwable + * @throws InvalidArgumentException&Throwable * MUST be thrown if the $key string is not a legal value. */ public function set_data(string $key, array $value, ?int $ttl = null): bool @@ -29184,7 +29184,7 @@ public function set_data(string $key, array $value, ?int $ttl = null): bool * * @return bool True if the item was successfully removed. False if there was an error. * - * @throws \Psr\SimpleCache\InvalidArgumentException&\Throwable + * @throws InvalidArgumentException&Throwable * MUST be thrown if the $key string is not a legal value. */ public function delete_data(string $key): bool @@ -31079,7 +31079,7 @@ interface DiscoveryStrategy * @return array The return value is always an array with zero or more elements. Each * element is an array with two keys ['class' => string, 'condition' => mixed]. * - * @throws \WordPress\AiClientDependencies\Http\Discovery\Exception\StrategyUnavailableException if we cannot use this strategy + * @throws StrategyUnavailableException if we cannot use this strategy */ public static function getCandidates($type); } @@ -31128,8 +31128,8 @@ public static function getCandidates($type) * * @since 1.1.0 * - * @param \WordPress\AiClientDependencies\Nyholm\Psr7\Factory\Psr17Factory $psr17Factory The PSR-17 factory for creating HTTP messages. - * @return \WordPress\AiClientDependencies\Psr\Http\Client\ClientInterface The PSR-18 HTTP client. + * @param Psr17Factory $psr17Factory The PSR-17 factory for creating HTTP messages. + * @return ClientInterface The PSR-18 HTTP client. */ abstract protected static function createClient(\WordPress\AiClientDependencies\Nyholm\Psr7\Factory\Psr17Factory $psr17Factory): \WordPress\AiClientDependencies\Psr\Http\Client\ClientInterface; } @@ -31152,8 +31152,8 @@ class WP_AI_Client_Discovery_Strategy extends \WordPress\AiClient\Providers\Http * * @since 7.0.0 * - * @param \WordPress\AiClientDependencies\Nyholm\Psr7\Factory\Psr17Factory $psr17_factory The PSR-17 factory for creating HTTP messages. - * @return \WordPress\AiClientDependencies\Psr\Http\Client\ClientInterface The PSR-18 HTTP client. + * @param Psr17Factory $psr17_factory The PSR-17 factory for creating HTTP messages. + * @return ClientInterface The PSR-18 HTTP client. */ protected static function createClient(\WordPress\AiClientDependencies\Nyholm\Psr7\Factory\Psr17Factory $psr17_factory): \WordPress\AiClientDependencies\Psr\Http\Client\ClientInterface { @@ -31213,9 +31213,9 @@ interface ClientInterface /** * Sends a PSR-7 request and returns a PSR-7 response. * - * @param \WordPress\AiClientDependencies\Psr\Http\Message\RequestInterface $request + * @param RequestInterface $request * - * @return \WordPress\AiClientDependencies\Psr\Http\Message\ResponseInterface + * @return ResponseInterface * * @throws \Psr\Http\Client\ClientExceptionInterface If an error happens while processing the request. */ @@ -31238,9 +31238,9 @@ interface ClientWithOptionsInterface * * @since 0.2.0 * - * @param \WordPress\AiClientDependencies\Psr\Http\Message\RequestInterface $request The PSR-7 request to send. - * @param \WordPress\AiClient\Providers\Http\DTO\RequestOptions $options The request transport options. Must not be null. - * @return \WordPress\AiClientDependencies\Psr\Http\Message\ResponseInterface The PSR-7 response received. + * @param RequestInterface $request The PSR-7 request to send. + * @param RequestOptions $options The request transport options. Must not be null. + * @return ResponseInterface The PSR-7 response received. */ public function sendRequestWithOptions(\WordPress\AiClientDependencies\Psr\Http\Message\RequestInterface $request, \WordPress\AiClient\Providers\Http\DTO\RequestOptions $options): \WordPress\AiClientDependencies\Psr\Http\Message\ResponseInterface; } @@ -31263,8 +31263,8 @@ class WP_AI_Client_HTTP_Client implements \WordPress\AiClientDependencies\Psr\Ht * * @since 7.0.0 * - * @param \WordPress\AiClientDependencies\Psr\Http\Message\ResponseFactoryInterface $response_factory PSR-17 Response factory. - * @param \WordPress\AiClientDependencies\Psr\Http\Message\StreamFactoryInterface $stream_factory PSR-17 Stream factory. + * @param ResponseFactoryInterface $response_factory PSR-17 Response factory. + * @param StreamFactoryInterface $stream_factory PSR-17 Stream factory. */ public function __construct(\WordPress\AiClientDependencies\Psr\Http\Message\ResponseFactoryInterface $response_factory, \WordPress\AiClientDependencies\Psr\Http\Message\StreamFactoryInterface $stream_factory) { @@ -31274,10 +31274,10 @@ public function __construct(\WordPress\AiClientDependencies\Psr\Http\Message\Res * * @since 7.0.0 * - * @param \WordPress\AiClientDependencies\Psr\Http\Message\RequestInterface $request The PSR-7 request. - * @return \WordPress\AiClientDependencies\Psr\Http\Message\ResponseInterface The PSR-7 response. + * @param RequestInterface $request The PSR-7 request. + * @return ResponseInterface The PSR-7 response. * - * @throws \WordPress\AiClient\Providers\Http\Exception\NetworkException If the WordPress HTTP request fails. + * @throws NetworkException If the WordPress HTTP request fails. */ public function sendRequest(\WordPress\AiClientDependencies\Psr\Http\Message\RequestInterface $request): \WordPress\AiClientDependencies\Psr\Http\Message\ResponseInterface { @@ -31287,11 +31287,11 @@ public function sendRequest(\WordPress\AiClientDependencies\Psr\Http\Message\Req * * @since 7.0.0 * - * @param \WordPress\AiClientDependencies\Psr\Http\Message\RequestInterface $request The PSR-7 request. - * @param \WordPress\AiClient\Providers\Http\DTO\RequestOptions $options Transport options for the request. - * @return \WordPress\AiClientDependencies\Psr\Http\Message\ResponseInterface The PSR-7 response. + * @param RequestInterface $request The PSR-7 request. + * @param RequestOptions $options Transport options for the request. + * @return ResponseInterface The PSR-7 response. * - * @throws \WordPress\AiClient\Providers\Http\Exception\NetworkException If the WordPress HTTP request fails. + * @throws NetworkException If the WordPress HTTP request fails. */ public function sendRequestWithOptions(\WordPress\AiClientDependencies\Psr\Http\Message\RequestInterface $request, \WordPress\AiClient\Providers\Http\DTO\RequestOptions $options): \WordPress\AiClientDependencies\Psr\Http\Message\ResponseInterface { @@ -31323,7 +31323,7 @@ public function __construct(...$abilities) * * @since 7.0.0 * - * @param \WordPress\AiClient\Tools\DTO\FunctionCall $call The function call to check. + * @param FunctionCall $call The function call to check. * @return bool True if the function call is an ability call, false otherwise. */ public function is_ability_call(\WordPress\AiClient\Tools\DTO\FunctionCall $call): bool @@ -31338,8 +31338,8 @@ public function is_ability_call(\WordPress\AiClient\Tools\DTO\FunctionCall $call * * @since 7.0.0 * - * @param \WordPress\AiClient\Tools\DTO\FunctionCall $call The function call to execute. - * @return \WordPress\AiClient\Tools\DTO\FunctionResponse The response from executing the ability. + * @param FunctionCall $call The function call to execute. + * @return FunctionResponse The response from executing the ability. */ public function execute_ability(\WordPress\AiClient\Tools\DTO\FunctionCall $call): \WordPress\AiClient\Tools\DTO\FunctionResponse { @@ -31349,7 +31349,7 @@ public function execute_ability(\WordPress\AiClient\Tools\DTO\FunctionCall $call * * @since 7.0.0 * - * @param \WordPress\AiClient\Messages\DTO\Message $message The message to check. + * @param Message $message The message to check. * @return bool True if the message contains ability calls, false otherwise. */ public function has_ability_calls(\WordPress\AiClient\Messages\DTO\Message $message): bool @@ -31360,8 +31360,8 @@ public function has_ability_calls(\WordPress\AiClient\Messages\DTO\Message $mess * * @since 7.0.0 * - * @param \WordPress\AiClient\Messages\DTO\Message $message The message containing function calls. - * @return \WordPress\AiClient\Messages\DTO\Message A new message with function responses. + * @param Message $message The message containing function calls. + * @return Message A new message with function responses. */ public function execute_abilities(\WordPress\AiClient\Messages\DTO\Message $message): \WordPress\AiClient\Messages\DTO\Message { @@ -31410,16 +31410,16 @@ public static function function_name_to_ability_name(string $function_name): str * * @since 7.0.0 * - * @phpstan-import-type Prompt from \WordPress\AiClient\Builders\PromptBuilder + * @phpstan-import-type Prompt from PromptBuilder * * @method self with_text(string $text) Adds text to the current message. * @method self with_file($file, ?string $mimeType = null) Adds a file to the current message. - * @method self with_function_response(\WordPress\AiClient\Tools\DTO\FunctionResponse $functionResponse) Adds a function response to the current message. - * @method self with_message_parts(\WordPress\AiClient\Messages\DTO\MessagePart ...$parts) Adds message parts to the current message. - * @method self with_history(\WordPress\AiClient\Messages\DTO\Message ...$messages) Adds conversation history messages. - * @method self using_model(\WordPress\AiClient\Providers\Models\Contracts\ModelInterface $model) Sets the model to use for generation. + * @method self with_function_response(FunctionResponse $functionResponse) Adds a function response to the current message. + * @method self with_message_parts(MessagePart ...$parts) Adds message parts to the current message. + * @method self with_history(Message ...$messages) Adds conversation history messages. + * @method self using_model(ModelInterface $model) Sets the model to use for generation. * @method self using_model_preference(...$preferredModels) Sets preferred models to evaluate in order. - * @method self using_model_config(\WordPress\AiClient\Providers\Models\DTO\ModelConfig $config) Sets the model configuration. + * @method self using_model_config(ModelConfig $config) Sets the model configuration. * @method self using_provider(string $providerIdOrClassName) Sets the provider to use for generation. * @method self using_system_instruction(string $systemInstruction) Sets the system instruction. * @method self using_max_tokens(int $maxTokens) Sets the maximum number of tokens to generate. @@ -31428,21 +31428,21 @@ public static function function_name_to_ability_name(string $function_name): str * @method self using_top_k(int $topK) Sets the top-k value for generation. * @method self using_stop_sequences(string ...$stopSequences) Sets stop sequences for generation. * @method self using_candidate_count(int $candidateCount) Sets the number of candidates to generate. - * @method self using_function_declarations(\WordPress\AiClient\Tools\DTO\FunctionDeclaration ...$functionDeclarations) Sets the function declarations available to the model. + * @method self using_function_declarations(FunctionDeclaration ...$functionDeclarations) Sets the function declarations available to the model. * @method self using_presence_penalty(float $presencePenalty) Sets the presence penalty for generation. * @method self using_frequency_penalty(float $frequencyPenalty) Sets the frequency penalty for generation. - * @method self using_web_search(\WordPress\AiClient\Tools\DTO\WebSearch $webSearch) Sets the web search configuration. - * @method self using_request_options(\WordPress\AiClient\Providers\Http\DTO\RequestOptions $options) Sets the request options for HTTP transport. + * @method self using_web_search(WebSearch $webSearch) Sets the web search configuration. + * @method self using_request_options(RequestOptions $options) Sets the request options for HTTP transport. * @method self using_top_logprobs(?int $topLogprobs = null) Sets the top log probabilities configuration. * @method self as_output_mime_type(string $mimeType) Sets the output MIME type. * @method self as_output_schema(array $schema) Sets the output schema. - * @method self as_output_modalities(\WordPress\AiClient\Messages\Enums\ModalityEnum ...$modalities) Sets the output modalities. - * @method self as_output_file_type(\WordPress\AiClient\Files\Enums\FileTypeEnum $fileType) Sets the output file type. - * @method self as_output_media_orientation(\WordPress\AiClient\Files\Enums\MediaOrientationEnum $orientation) Sets the output media orientation. + * @method self as_output_modalities(ModalityEnum ...$modalities) Sets the output modalities. + * @method self as_output_file_type(FileTypeEnum $fileType) Sets the output file type. + * @method self as_output_media_orientation(MediaOrientationEnum $orientation) Sets the output media orientation. * @method self as_output_media_aspect_ratio(string $aspectRatio) Sets the output media aspect ratio. * @method self as_output_speech_voice(string $voice) Sets the output speech voice. * @method self as_json_response(?array $schema = null) Configures the prompt for JSON response output. - * @method bool|WP_Error is_supported(?\WordPress\AiClient\Providers\Models\Enums\CapabilityEnum $capability = null) Checks if the prompt is supported for the given capability. + * @method bool|WP_Error is_supported(?CapabilityEnum $capability = null) Checks if the prompt is supported for the given capability. * @method bool is_supported_for_text_generation() Checks if the prompt is supported for text generation. * @method bool is_supported_for_image_generation() Checks if the prompt is supported for image generation. * @method bool is_supported_for_text_to_speech_conversion() Checks if the prompt is supported for text to speech conversion. @@ -31450,22 +31450,22 @@ public static function function_name_to_ability_name(string $function_name): str * @method bool is_supported_for_speech_generation() Checks if the prompt is supported for speech generation. * @method bool is_supported_for_music_generation() Checks if the prompt is supported for music generation. * @method bool is_supported_for_embedding_generation() Checks if the prompt is supported for embedding generation. - * @method \WordPress\AiClient\Results\DTO\GenerativeAiResult|WP_Error generate_result(?\WordPress\AiClient\Providers\Models\Enums\CapabilityEnum $capability = null) Generates a result from the prompt. - * @method \WordPress\AiClient\Results\DTO\GenerativeAiResult|WP_Error generate_text_result() Generates a text result from the prompt. - * @method \WordPress\AiClient\Results\DTO\GenerativeAiResult|WP_Error generate_image_result() Generates an image result from the prompt. - * @method \WordPress\AiClient\Results\DTO\GenerativeAiResult|WP_Error generate_speech_result() Generates a speech result from the prompt. - * @method \WordPress\AiClient\Results\DTO\GenerativeAiResult|WP_Error convert_text_to_speech_result() Converts text to speech and returns the result. - * @method \WordPress\AiClient\Results\DTO\GenerativeAiResult|WP_Error generate_video_result() Generates a video result from the prompt. + * @method GenerativeAiResult|WP_Error generate_result(?CapabilityEnum $capability = null) Generates a result from the prompt. + * @method GenerativeAiResult|WP_Error generate_text_result() Generates a text result from the prompt. + * @method GenerativeAiResult|WP_Error generate_image_result() Generates an image result from the prompt. + * @method GenerativeAiResult|WP_Error generate_speech_result() Generates a speech result from the prompt. + * @method GenerativeAiResult|WP_Error convert_text_to_speech_result() Converts text to speech and returns the result. + * @method GenerativeAiResult|WP_Error generate_video_result() Generates a video result from the prompt. * @method string|WP_Error generate_text() Generates text from the prompt. * @method list|WP_Error generate_texts(?int $candidateCount = null) Generates multiple text candidates from the prompt. - * @method \WordPress\AiClient\Files\DTO\File|WP_Error generate_image() Generates an image from the prompt. - * @method list<\WordPress\AiClient\Files\DTO\File>|WP_Error generate_images(?int $candidateCount = null) Generates multiple images from the prompt. - * @method \WordPress\AiClient\Files\DTO\File|WP_Error convert_text_to_speech() Converts text to speech. - * @method list<\WordPress\AiClient\Files\DTO\File>|WP_Error convert_text_to_speeches(?int $candidateCount = null) Converts text to multiple speech outputs. - * @method \WordPress\AiClient\Files\DTO\File|WP_Error generate_speech() Generates speech from the prompt. - * @method list<\WordPress\AiClient\Files\DTO\File>|WP_Error generate_speeches(?int $candidateCount = null) Generates multiple speech outputs from the prompt. - * @method \WordPress\AiClient\Files\DTO\File|WP_Error generate_video() Generates a video from the prompt. - * @method list<\WordPress\AiClient\Files\DTO\File>|WP_Error generate_videos(?int $candidateCount = null) Generates multiple videos from the prompt. + * @method File|WP_Error generate_image() Generates an image from the prompt. + * @method list|WP_Error generate_images(?int $candidateCount = null) Generates multiple images from the prompt. + * @method File|WP_Error convert_text_to_speech() Converts text to speech. + * @method list|WP_Error convert_text_to_speeches(?int $candidateCount = null) Converts text to multiple speech outputs. + * @method File|WP_Error generate_speech() Generates speech from the prompt. + * @method list|WP_Error generate_speeches(?int $candidateCount = null) Generates multiple speech outputs from the prompt. + * @method File|WP_Error generate_video() Generates a video from the prompt. + * @method list|WP_Error generate_videos(?int $candidateCount = null) Generates multiple videos from the prompt. */ class WP_AI_Client_Prompt_Builder { @@ -31474,7 +31474,7 @@ class WP_AI_Client_Prompt_Builder * * @since 7.0.0 * - * @param \WordPress\AiClient\Providers\ProviderRegistry $registry The provider registry for finding suitable models. + * @param ProviderRegistry $registry The provider registry for finding suitable models. * @param Prompt $prompt Optional. Initial prompt content. * A string for simple text prompts, * a MessagePart or Message object for @@ -73535,7 +73535,7 @@ public function translate($singular, $context = '') * * @since 0.1.0 * - * @phpstan-import-type Prompt from \WordPress\AiClient\Builders\PromptBuilder + * @phpstan-import-type Prompt from PromptBuilder * * phpcs:ignore Generic.Files.LineLength.TooLong */ @@ -73550,7 +73550,7 @@ class AiClient * * @since 0.1.0 * - * @return \WordPress\AiClient\Providers\ProviderRegistry The default provider registry. + * @return ProviderRegistry The default provider registry. */ public static function defaultRegistry(): \WordPress\AiClient\Providers\ProviderRegistry { @@ -73563,7 +73563,7 @@ public static function defaultRegistry(): \WordPress\AiClient\Providers\Provider * * @since 0.4.0 * - * @param \WordPress\AiClientDependencies\Psr\EventDispatcher\EventDispatcherInterface|null $dispatcher The event dispatcher, or null to disable. + * @param EventDispatcherInterface|null $dispatcher The event dispatcher, or null to disable. * @return void */ public static function setEventDispatcher(?\WordPress\AiClientDependencies\Psr\EventDispatcher\EventDispatcherInterface $dispatcher): void @@ -73574,7 +73574,7 @@ public static function setEventDispatcher(?\WordPress\AiClientDependencies\Psr\E * * @since 0.4.0 * - * @return \WordPress\AiClientDependencies\Psr\EventDispatcher\EventDispatcherInterface|null The event dispatcher, or null if not set. + * @return EventDispatcherInterface|null The event dispatcher, or null if not set. */ public static function getEventDispatcher(): ?\WordPress\AiClientDependencies\Psr\EventDispatcher\EventDispatcherInterface { @@ -73587,7 +73587,7 @@ public static function getEventDispatcher(): ?\WordPress\AiClientDependencies\Ps * * @since 0.4.0 * - * @param \WordPress\AiClientDependencies\Psr\SimpleCache\CacheInterface|null $cache The PSR-16 cache instance, or null to disable caching. + * @param CacheInterface|null $cache The PSR-16 cache instance, or null to disable caching. * @return void */ public static function setCache(?\WordPress\AiClientDependencies\Psr\SimpleCache\CacheInterface $cache): void @@ -73598,7 +73598,7 @@ public static function setCache(?\WordPress\AiClientDependencies\Psr\SimpleCache * * @since 0.4.0 * - * @return \WordPress\AiClientDependencies\Psr\SimpleCache\CacheInterface|null The cache instance, or null if not set. + * @return CacheInterface|null The cache instance, or null if not set. */ public static function getCache(): ?\WordPress\AiClientDependencies\Psr\SimpleCache\CacheInterface { @@ -73618,7 +73618,7 @@ public static function getCache(): ?\WordPress\AiClientDependencies\Psr\SimpleCa * @since 0.1.0 * @since 0.2.0 Now supports being passed a provider ID or class name. * - * @param \WordPress\AiClient\Providers\Contracts\ProviderAvailabilityInterface|string|class-string<\WordPress\AiClient\Providers\Contracts\ProviderInterface> $availabilityOrIdOrClassName + * @param ProviderAvailabilityInterface|string|class-string $availabilityOrIdOrClassName * The provider availability instance, provider ID, or provider class name. * @return bool True if the provider is configured and available, false otherwise. */ @@ -73635,8 +73635,8 @@ public static function isConfigured($availabilityOrIdOrClassName): bool * @since 0.1.0 * * @param Prompt $prompt Optional initial prompt content. - * @param \WordPress\AiClient\Providers\ProviderRegistry|null $registry Optional custom registry. If null, uses default. - * @return \WordPress\AiClient\Builders\PromptBuilder The prompt builder instance. + * @param ProviderRegistry|null $registry Optional custom registry. If null, uses default. + * @return PromptBuilder The prompt builder instance. */ public static function prompt($prompt = null, ?\WordPress\AiClient\Providers\ProviderRegistry $registry = null): \WordPress\AiClient\Builders\PromptBuilder { @@ -73651,10 +73651,10 @@ public static function prompt($prompt = null, ?\WordPress\AiClient\Providers\Pro * @since 0.1.0 * * @param Prompt $prompt The prompt content. - * @param \WordPress\AiClient\Providers\Models\Contracts\ModelInterface|\WordPress\AiClient\Providers\Models\DTO\ModelConfig $modelOrConfig Specific model to use, or model configuration + * @param ModelInterface|ModelConfig $modelOrConfig Specific model to use, or model configuration * for auto-discovery. - * @param \WordPress\AiClient\Providers\ProviderRegistry|null $registry Optional custom registry. If null, uses default. - * @return \WordPress\AiClient\Results\DTO\GenerativeAiResult The generation result. + * @param ProviderRegistry|null $registry Optional custom registry. If null, uses default. + * @return GenerativeAiResult The generation result. * * @throws \InvalidArgumentException If the provided model doesn't support any known generation type. * @throws \RuntimeException If no suitable model can be found for the prompt. @@ -73668,11 +73668,11 @@ public static function generateResult($prompt, $modelOrConfig, ?\WordPress\AiCli * @since 0.1.0 * * @param Prompt $prompt The prompt content. - * @param \WordPress\AiClient\Providers\Models\Contracts\ModelInterface|\WordPress\AiClient\Providers\Models\DTO\ModelConfig|null $modelOrConfig Optional specific model to use, + * @param ModelInterface|ModelConfig|null $modelOrConfig Optional specific model to use, * or model configuration for auto-discovery, * or null for defaults. - * @param \WordPress\AiClient\Providers\ProviderRegistry|null $registry Optional custom registry. If null, uses default. - * @return \WordPress\AiClient\Results\DTO\GenerativeAiResult The generation result. + * @param ProviderRegistry|null $registry Optional custom registry. If null, uses default. + * @return GenerativeAiResult The generation result. * * @throws \InvalidArgumentException If the prompt format is invalid. * @throws \RuntimeException If no suitable model is found. @@ -73686,11 +73686,11 @@ public static function generateTextResult($prompt, $modelOrConfig = null, ?\Word * @since 0.1.0 * * @param Prompt $prompt The prompt content. - * @param \WordPress\AiClient\Providers\Models\Contracts\ModelInterface|\WordPress\AiClient\Providers\Models\DTO\ModelConfig|null $modelOrConfig Optional specific model to use, + * @param ModelInterface|ModelConfig|null $modelOrConfig Optional specific model to use, * or model configuration for auto-discovery, * or null for defaults. - * @param \WordPress\AiClient\Providers\ProviderRegistry|null $registry Optional custom registry. If null, uses default. - * @return \WordPress\AiClient\Results\DTO\GenerativeAiResult The generation result. + * @param ProviderRegistry|null $registry Optional custom registry. If null, uses default. + * @return GenerativeAiResult The generation result. * * @throws \InvalidArgumentException If the prompt format is invalid. * @throws \RuntimeException If no suitable model is found. @@ -73704,11 +73704,11 @@ public static function generateImageResult($prompt, $modelOrConfig = null, ?\Wor * @since 0.1.0 * * @param Prompt $prompt The prompt content. - * @param \WordPress\AiClient\Providers\Models\Contracts\ModelInterface|\WordPress\AiClient\Providers\Models\DTO\ModelConfig|null $modelOrConfig Optional specific model to use, + * @param ModelInterface|ModelConfig|null $modelOrConfig Optional specific model to use, * or model configuration for auto-discovery, * or null for defaults. - * @param \WordPress\AiClient\Providers\ProviderRegistry|null $registry Optional custom registry. If null, uses default. - * @return \WordPress\AiClient\Results\DTO\GenerativeAiResult The generation result. + * @param ProviderRegistry|null $registry Optional custom registry. If null, uses default. + * @return GenerativeAiResult The generation result. * * @throws \InvalidArgumentException If the prompt format is invalid. * @throws \RuntimeException If no suitable model is found. @@ -73722,11 +73722,11 @@ public static function convertTextToSpeechResult($prompt, $modelOrConfig = null, * @since 0.1.0 * * @param Prompt $prompt The prompt content. - * @param \WordPress\AiClient\Providers\Models\Contracts\ModelInterface|\WordPress\AiClient\Providers\Models\DTO\ModelConfig|null $modelOrConfig Optional specific model to use, + * @param ModelInterface|ModelConfig|null $modelOrConfig Optional specific model to use, * or model configuration for auto-discovery, * or null for defaults. - * @param \WordPress\AiClient\Providers\ProviderRegistry|null $registry Optional custom registry. If null, uses default. - * @return \WordPress\AiClient\Results\DTO\GenerativeAiResult The generation result. + * @param ProviderRegistry|null $registry Optional custom registry. If null, uses default. + * @return GenerativeAiResult The generation result. * * @throws \InvalidArgumentException If the prompt format is invalid. * @throws \RuntimeException If no suitable model is found. @@ -73740,11 +73740,11 @@ public static function generateSpeechResult($prompt, $modelOrConfig = null, ?\Wo * @since 1.3.0 * * @param Prompt $prompt The prompt content. - * @param \WordPress\AiClient\Providers\Models\Contracts\ModelInterface|\WordPress\AiClient\Providers\Models\DTO\ModelConfig|null $modelOrConfig Optional specific model to use, + * @param ModelInterface|ModelConfig|null $modelOrConfig Optional specific model to use, * or model configuration for auto-discovery, * or null for defaults. - * @param \WordPress\AiClient\Providers\ProviderRegistry|null $registry Optional custom registry. If null, uses default. - * @return \WordPress\AiClient\Results\DTO\GenerativeAiResult The generation result. + * @param ProviderRegistry|null $registry Optional custom registry. If null, uses default. + * @return GenerativeAiResult The generation result. * * @throws \InvalidArgumentException If the prompt format is invalid. * @throws \RuntimeException If no suitable model is found. @@ -73780,18 +73780,18 @@ public static function message(?string $text = null) * * @since 0.2.0 * - * @phpstan-import-type MessagePartArrayShape from \WordPress\AiClient\Messages\DTO\MessagePart + * @phpstan-import-type MessagePartArrayShape from MessagePart * - * @phpstan-type Input string|\WordPress\AiClient\Messages\DTO\MessagePart|MessagePartArrayShape|\WordPress\AiClient\Files\DTO\File|\WordPress\AiClient\Tools\DTO\FunctionCall|\WordPress\AiClient\Tools\DTO\FunctionResponse|null + * @phpstan-type Input string|MessagePart|MessagePartArrayShape|File|FunctionCall|FunctionResponse|null */ class MessageBuilder { /** - * @var \WordPress\AiClient\Messages\Enums\MessageRoleEnum|null The role of the message sender. + * @var MessageRoleEnum|null The role of the message sender. */ protected ?\WordPress\AiClient\Messages\Enums\MessageRoleEnum $role = null; /** - * @var list<\WordPress\AiClient\Messages\DTO\MessagePart> The parts that make up the message. + * @var list The parts that make up the message. */ protected array $parts = []; /** @@ -73800,7 +73800,7 @@ class MessageBuilder * @since 0.2.0 * * @param Input $input Optional initial content. - * @param \WordPress\AiClient\Messages\Enums\MessageRoleEnum|null $role Optional role. + * @param MessageRoleEnum|null $role Optional role. * @phpstan-return void */ public function __construct($input = null, ?\WordPress\AiClient\Messages\Enums\MessageRoleEnum $role = null) @@ -73822,7 +73822,7 @@ public function __clone() * * @since 0.2.0 * - * @param \WordPress\AiClient\Messages\Enums\MessageRoleEnum $role The role to set. + * @param MessageRoleEnum $role The role to set. * @return self */ public function usingRole(\WordPress\AiClient\Messages\Enums\MessageRoleEnum $role): self @@ -73855,7 +73855,7 @@ public function usingModelRole(): self * * @param string $text The text to add. * @return self - * @throws \InvalidArgumentException If the text is empty. + * @throws InvalidArgumentException If the text is empty. */ public function withText(string $text): self { @@ -73872,10 +73872,10 @@ public function withText(string $text): self * * @since 0.2.0 * - * @param string|\WordPress\AiClient\Files\DTO\File $file The file to add. + * @param string|File $file The file to add. * @param string|null $mimeType Optional MIME type (ignored if File object provided). * @return self - * @throws \InvalidArgumentException If the file is invalid. + * @throws InvalidArgumentException If the file is invalid. */ public function withFile($file, ?string $mimeType = null): self { @@ -73885,7 +73885,7 @@ public function withFile($file, ?string $mimeType = null): self * * @since 0.2.0 * - * @param \WordPress\AiClient\Tools\DTO\FunctionCall $functionCall The function call to add. + * @param FunctionCall $functionCall The function call to add. * @return self */ public function withFunctionCall(\WordPress\AiClient\Tools\DTO\FunctionCall $functionCall): self @@ -73896,7 +73896,7 @@ public function withFunctionCall(\WordPress\AiClient\Tools\DTO\FunctionCall $fun * * @since 0.2.0 * - * @param \WordPress\AiClient\Tools\DTO\FunctionResponse $functionResponse The function response to add. + * @param FunctionResponse $functionResponse The function response to add. * @return self */ public function withFunctionResponse(\WordPress\AiClient\Tools\DTO\FunctionResponse $functionResponse): self @@ -73907,7 +73907,7 @@ public function withFunctionResponse(\WordPress\AiClient\Tools\DTO\FunctionRespo * * @since 0.2.0 * - * @param \WordPress\AiClient\Messages\DTO\MessagePart ...$parts The message parts to add. + * @param MessagePart ...$parts The message parts to add. * @return self */ public function withMessageParts(\WordPress\AiClient\Messages\DTO\MessagePart ...$parts): self @@ -73918,8 +73918,8 @@ public function withMessageParts(\WordPress\AiClient\Messages\DTO\MessagePart .. * * @since 0.2.0 * - * @return \WordPress\AiClient\Messages\DTO\Message The built message. - * @throws \InvalidArgumentException If the message validation fails. + * @return Message The built message. + * @throws InvalidArgumentException If the message validation fails. */ public function get(): \WordPress\AiClient\Messages\DTO\Message { @@ -73934,19 +73934,19 @@ public function get(): \WordPress\AiClient\Messages\DTO\Message * * @since 0.1.0 * - * @phpstan-import-type MessageArrayShape from \WordPress\AiClient\Messages\DTO\Message - * @phpstan-import-type MessagePartArrayShape from \WordPress\AiClient\Messages\DTO\MessagePart + * @phpstan-import-type MessageArrayShape from Message + * @phpstan-import-type MessagePartArrayShape from MessagePart * - * @phpstan-type Prompt string|\WordPress\AiClient\Messages\DTO\MessagePart|\WordPress\AiClient\Messages\DTO\Message|MessageArrayShape|list|list<\WordPress\AiClient\Messages\DTO\Message>|null + * @phpstan-type Prompt string|MessagePart|Message|MessageArrayShape|list|list|null */ class PromptBuilder { /** - * @var list<\WordPress\AiClient\Messages\DTO\Message> The messages in the conversation. + * @var list The messages in the conversation. */ protected array $messages = []; /** - * @var \WordPress\AiClient\Providers\Models\Contracts\ModelInterface|null The model to use for generation. + * @var ModelInterface|null The model to use for generation. */ protected ?\WordPress\AiClient\Providers\Models\Contracts\ModelInterface $model = null; /** @@ -73958,11 +73958,11 @@ class PromptBuilder */ protected ?string $providerIdOrClassName = null; /** - * @var \WordPress\AiClient\Providers\Models\DTO\ModelConfig The model configuration. + * @var ModelConfig The model configuration. */ protected \WordPress\AiClient\Providers\Models\DTO\ModelConfig $modelConfig; /** - * @var \WordPress\AiClient\Providers\Http\DTO\RequestOptions|null The request options for HTTP transport. + * @var RequestOptions|null The request options for HTTP transport. */ protected ?\WordPress\AiClient\Providers\Http\DTO\RequestOptions $requestOptions = null; /** @@ -73970,9 +73970,9 @@ class PromptBuilder * * @since 0.1.0 * - * @param \WordPress\AiClient\Providers\ProviderRegistry $registry The provider registry for finding suitable models. + * @param ProviderRegistry $registry The provider registry for finding suitable models. * @param Prompt $prompt Optional initial prompt content. - * @param \WordPress\AiClientDependencies\Psr\EventDispatcher\EventDispatcherInterface|null $eventDispatcher Optional event dispatcher for lifecycle events. + * @param EventDispatcherInterface|null $eventDispatcher Optional event dispatcher for lifecycle events. * @phpstan-return void */ public function __construct(\WordPress\AiClient\Providers\ProviderRegistry $registry, $prompt = null, ?\WordPress\AiClientDependencies\Psr\EventDispatcher\EventDispatcherInterface $eventDispatcher = null) @@ -74013,10 +74013,10 @@ public function withText(string $text): self * * @since 0.1.0 * - * @param string|\WordPress\AiClient\Files\DTO\File $file The file (File object or string representation). + * @param string|File $file The file (File object or string representation). * @param string|null $mimeType The MIME type (optional, ignored if File object provided). * @return self - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the file is invalid or MIME type cannot be determined. + * @throws InvalidArgumentException If the file is invalid or MIME type cannot be determined. */ public function withFile($file, ?string $mimeType = null): self { @@ -74026,7 +74026,7 @@ public function withFile($file, ?string $mimeType = null): self * * @since 0.1.0 * - * @param \WordPress\AiClient\Tools\DTO\FunctionResponse $functionResponse The function response. + * @param FunctionResponse $functionResponse The function response. * @return self */ public function withFunctionResponse(\WordPress\AiClient\Tools\DTO\FunctionResponse $functionResponse): self @@ -74037,7 +74037,7 @@ public function withFunctionResponse(\WordPress\AiClient\Tools\DTO\FunctionRespo * * @since 0.1.0 * - * @param \WordPress\AiClient\Messages\DTO\MessagePart ...$parts The message parts to add. + * @param MessagePart ...$parts The message parts to add. * @return self */ public function withMessageParts(\WordPress\AiClient\Messages\DTO\MessagePart ...$parts): self @@ -74051,7 +74051,7 @@ public function withMessageParts(\WordPress\AiClient\Messages\DTO\MessagePart .. * * @since 0.1.0 * - * @param \WordPress\AiClient\Messages\DTO\Message ...$messages The messages to add to history. + * @param Message ...$messages The messages to add to history. * @return self */ public function withHistory(\WordPress\AiClient\Messages\DTO\Message ...$messages): self @@ -74065,7 +74065,7 @@ public function withHistory(\WordPress\AiClient\Messages\DTO\Message ...$message * * @since 0.1.0 * - * @param \WordPress\AiClient\Providers\Models\Contracts\ModelInterface $model The model to use. + * @param ModelInterface $model The model to use. * @return self */ public function usingModel(\WordPress\AiClient\Providers\Models\Contracts\ModelInterface $model): self @@ -74076,13 +74076,13 @@ public function usingModel(\WordPress\AiClient\Providers\Models\Contracts\ModelI * * @since 0.2.0 * - * @param string|\WordPress\AiClient\Providers\Models\Contracts\ModelInterface|array{0:string,1:string} ...$preferredModels The preferred models as model IDs, + * @param string|ModelInterface|array{0:string,1:string} ...$preferredModels The preferred models as model IDs, * model instances, or [provider ID, model ID] tuples. For broader compatibility, it is recommended you specify * only model IDs or model instances, as that will allow for different providers that expose the same model to be * considered. * @return self * - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException When a preferred model has an invalid type or identifier. + * @throws InvalidArgumentException When a preferred model has an invalid type or identifier. */ public function usingModelPreference(...$preferredModels): self { @@ -74095,7 +74095,7 @@ public function usingModelPreference(...$preferredModels): self * * @since 0.1.0 * - * @param \WordPress\AiClient\Providers\Models\DTO\ModelConfig $config The model configuration to merge. + * @param ModelConfig $config The model configuration to merge. * @return self */ public function usingModelConfig(\WordPress\AiClient\Providers\Models\DTO\ModelConfig $config): self @@ -74197,7 +74197,7 @@ public function usingCandidateCount(int $candidateCount): self * * @since 0.1.0 * - * @param \WordPress\AiClient\Tools\DTO\FunctionDeclaration ...$functionDeclarations The function declarations. + * @param FunctionDeclaration ...$functionDeclarations The function declarations. * @return self */ public function usingFunctionDeclarations(\WordPress\AiClient\Tools\DTO\FunctionDeclaration ...$functionDeclarations): self @@ -74230,7 +74230,7 @@ public function usingFrequencyPenalty(float $frequencyPenalty): self * * @since 0.1.0 * - * @param \WordPress\AiClient\Tools\DTO\WebSearch $webSearch The web search configuration. + * @param WebSearch $webSearch The web search configuration. * @return self */ public function usingWebSearch(\WordPress\AiClient\Tools\DTO\WebSearch $webSearch): self @@ -74241,7 +74241,7 @@ public function usingWebSearch(\WordPress\AiClient\Tools\DTO\WebSearch $webSearc * * @since 0.3.0 * - * @param \WordPress\AiClient\Providers\Http\DTO\RequestOptions $requestOptions The request options. + * @param RequestOptions $requestOptions The request options. * @return self */ public function usingRequestOptions(\WordPress\AiClient\Providers\Http\DTO\RequestOptions $requestOptions): self @@ -74288,7 +74288,7 @@ public function asOutputSchema(array $schema): self * * @since 0.1.0 * - * @param \WordPress\AiClient\Messages\Enums\ModalityEnum ...$modalities The output modalities. + * @param ModalityEnum ...$modalities The output modalities. * @return self */ public function asOutputModalities(\WordPress\AiClient\Messages\Enums\ModalityEnum ...$modalities): self @@ -74299,7 +74299,7 @@ public function asOutputModalities(\WordPress\AiClient\Messages\Enums\ModalityEn * * @since 0.1.0 * - * @param \WordPress\AiClient\Files\Enums\FileTypeEnum $fileType The output file type. + * @param FileTypeEnum $fileType The output file type. * @return self */ public function asOutputFileType(\WordPress\AiClient\Files\Enums\FileTypeEnum $fileType): self @@ -74310,7 +74310,7 @@ public function asOutputFileType(\WordPress\AiClient\Files\Enums\FileTypeEnum $f * * @since 1.3.0 * - * @param \WordPress\AiClient\Files\Enums\MediaOrientationEnum $orientation The output media orientation. + * @param MediaOrientationEnum $orientation The output media orientation. * @return self */ public function asOutputMediaOrientation(\WordPress\AiClient\Files\Enums\MediaOrientationEnum $orientation): self @@ -74358,7 +74358,7 @@ public function asJsonResponse(?array $schema = null): self * @since 0.1.0 * @since 0.3.0 Method visibility changed to public. * - * @param \WordPress\AiClient\Providers\Models\Enums\CapabilityEnum|null $capability Optional capability to check support for. + * @param CapabilityEnum|null $capability Optional capability to check support for. * @return bool True if supported, false otherwise. */ public function isSupported(?\WordPress\AiClient\Providers\Models\Enums\CapabilityEnum $capability = null): bool @@ -74443,11 +74443,11 @@ public function isSupportedForEmbeddingGeneration(): bool * * @since 0.1.0 * - * @param \WordPress\AiClient\Providers\Models\Enums\CapabilityEnum|null $capability Optional capability to use for generation. + * @param CapabilityEnum|null $capability Optional capability to use for generation. * If null, capability is inferred from output modality. - * @return \WordPress\AiClient\Results\DTO\GenerativeAiResult The generated result containing candidates. - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the prompt or model validation fails. - * @throws \WordPress\AiClient\Common\Exception\RuntimeException If the model doesn't support the required capability. + * @return GenerativeAiResult The generated result containing candidates. + * @throws InvalidArgumentException If the prompt or model validation fails. + * @throws RuntimeException If the model doesn't support the required capability. */ public function generateResult(?\WordPress\AiClient\Providers\Models\Enums\CapabilityEnum $capability = null): \WordPress\AiClient\Results\DTO\GenerativeAiResult { @@ -74457,9 +74457,9 @@ public function generateResult(?\WordPress\AiClient\Providers\Models\Enums\Capab * * @since 0.1.0 * - * @return \WordPress\AiClient\Results\DTO\GenerativeAiResult The generated result containing text candidates. - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the prompt or model validation fails. - * @throws \WordPress\AiClient\Common\Exception\RuntimeException If the model doesn't support text generation. + * @return GenerativeAiResult The generated result containing text candidates. + * @throws InvalidArgumentException If the prompt or model validation fails. + * @throws RuntimeException If the model doesn't support text generation. */ public function generateTextResult(): \WordPress\AiClient\Results\DTO\GenerativeAiResult { @@ -74469,9 +74469,9 @@ public function generateTextResult(): \WordPress\AiClient\Results\DTO\Generative * * @since 0.1.0 * - * @return \WordPress\AiClient\Results\DTO\GenerativeAiResult The generated result containing image candidates. - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the prompt or model validation fails. - * @throws \WordPress\AiClient\Common\Exception\RuntimeException If the model doesn't support image generation. + * @return GenerativeAiResult The generated result containing image candidates. + * @throws InvalidArgumentException If the prompt or model validation fails. + * @throws RuntimeException If the model doesn't support image generation. */ public function generateImageResult(): \WordPress\AiClient\Results\DTO\GenerativeAiResult { @@ -74481,9 +74481,9 @@ public function generateImageResult(): \WordPress\AiClient\Results\DTO\Generativ * * @since 0.1.0 * - * @return \WordPress\AiClient\Results\DTO\GenerativeAiResult The generated result containing speech audio candidates. - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the prompt or model validation fails. - * @throws \WordPress\AiClient\Common\Exception\RuntimeException If the model doesn't support speech generation. + * @return GenerativeAiResult The generated result containing speech audio candidates. + * @throws InvalidArgumentException If the prompt or model validation fails. + * @throws RuntimeException If the model doesn't support speech generation. */ public function generateSpeechResult(): \WordPress\AiClient\Results\DTO\GenerativeAiResult { @@ -74493,9 +74493,9 @@ public function generateSpeechResult(): \WordPress\AiClient\Results\DTO\Generati * * @since 0.1.0 * - * @return \WordPress\AiClient\Results\DTO\GenerativeAiResult The generated result containing speech audio candidates. - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the prompt or model validation fails. - * @throws \WordPress\AiClient\Common\Exception\RuntimeException If the model doesn't support text-to-speech conversion. + * @return GenerativeAiResult The generated result containing speech audio candidates. + * @throws InvalidArgumentException If the prompt or model validation fails. + * @throws RuntimeException If the model doesn't support text-to-speech conversion. */ public function convertTextToSpeechResult(): \WordPress\AiClient\Results\DTO\GenerativeAiResult { @@ -74505,9 +74505,9 @@ public function convertTextToSpeechResult(): \WordPress\AiClient\Results\DTO\Gen * * @since 1.3.0 * - * @return \WordPress\AiClient\Results\DTO\GenerativeAiResult The generated result containing video candidates. - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the prompt or model validation fails. - * @throws \WordPress\AiClient\Common\Exception\RuntimeException If the model doesn't support video generation. + * @return GenerativeAiResult The generated result containing video candidates. + * @throws InvalidArgumentException If the prompt or model validation fails. + * @throws RuntimeException If the model doesn't support video generation. */ public function generateVideoResult(): \WordPress\AiClient\Results\DTO\GenerativeAiResult { @@ -74518,7 +74518,7 @@ public function generateVideoResult(): \WordPress\AiClient\Results\DTO\Generativ * @since 0.1.0 * * @return string The generated text. - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the prompt or model validation fails. + * @throws InvalidArgumentException If the prompt or model validation fails. */ public function generateText(): string { @@ -74530,7 +74530,7 @@ public function generateText(): string * * @param int|null $candidateCount The number of candidates to generate. * @return list The generated texts. - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the prompt or model validation fails. + * @throws InvalidArgumentException If the prompt or model validation fails. */ public function generateTexts(?int $candidateCount = null): array { @@ -74540,9 +74540,9 @@ public function generateTexts(?int $candidateCount = null): array * * @since 0.1.0 * - * @return \WordPress\AiClient\Files\DTO\File The generated image file. - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the prompt or model validation fails. - * @throws \WordPress\AiClient\Common\Exception\RuntimeException If no image is generated. + * @return File The generated image file. + * @throws InvalidArgumentException If the prompt or model validation fails. + * @throws RuntimeException If no image is generated. */ public function generateImage(): \WordPress\AiClient\Files\DTO\File { @@ -74553,9 +74553,9 @@ public function generateImage(): \WordPress\AiClient\Files\DTO\File * @since 0.1.0 * * @param int|null $candidateCount The number of images to generate. - * @return list<\WordPress\AiClient\Files\DTO\File> The generated image files. - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the prompt or model validation fails. - * @throws \WordPress\AiClient\Common\Exception\RuntimeException If no images are generated. + * @return list The generated image files. + * @throws InvalidArgumentException If the prompt or model validation fails. + * @throws RuntimeException If no images are generated. */ public function generateImages(?int $candidateCount = null): array { @@ -74565,9 +74565,9 @@ public function generateImages(?int $candidateCount = null): array * * @since 0.1.0 * - * @return \WordPress\AiClient\Files\DTO\File The generated speech audio file. - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the prompt or model validation fails. - * @throws \WordPress\AiClient\Common\Exception\RuntimeException If no audio is generated. + * @return File The generated speech audio file. + * @throws InvalidArgumentException If the prompt or model validation fails. + * @throws RuntimeException If no audio is generated. */ public function convertTextToSpeech(): \WordPress\AiClient\Files\DTO\File { @@ -74578,9 +74578,9 @@ public function convertTextToSpeech(): \WordPress\AiClient\Files\DTO\File * @since 0.1.0 * * @param int|null $candidateCount The number of speech outputs to generate. - * @return list<\WordPress\AiClient\Files\DTO\File> The generated speech audio files. - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the prompt or model validation fails. - * @throws \WordPress\AiClient\Common\Exception\RuntimeException If no audio is generated. + * @return list The generated speech audio files. + * @throws InvalidArgumentException If the prompt or model validation fails. + * @throws RuntimeException If no audio is generated. */ public function convertTextToSpeeches(?int $candidateCount = null): array { @@ -74590,9 +74590,9 @@ public function convertTextToSpeeches(?int $candidateCount = null): array * * @since 0.1.0 * - * @return \WordPress\AiClient\Files\DTO\File The generated speech audio file. - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the prompt or model validation fails. - * @throws \WordPress\AiClient\Common\Exception\RuntimeException If no audio is generated. + * @return File The generated speech audio file. + * @throws InvalidArgumentException If the prompt or model validation fails. + * @throws RuntimeException If no audio is generated. */ public function generateSpeech(): \WordPress\AiClient\Files\DTO\File { @@ -74603,9 +74603,9 @@ public function generateSpeech(): \WordPress\AiClient\Files\DTO\File * @since 0.1.0 * * @param int|null $candidateCount The number of speech outputs to generate. - * @return list<\WordPress\AiClient\Files\DTO\File> The generated speech audio files. - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the prompt or model validation fails. - * @throws \WordPress\AiClient\Common\Exception\RuntimeException If no audio is generated. + * @return list The generated speech audio files. + * @throws InvalidArgumentException If the prompt or model validation fails. + * @throws RuntimeException If no audio is generated. */ public function generateSpeeches(?int $candidateCount = null): array { @@ -74615,9 +74615,9 @@ public function generateSpeeches(?int $candidateCount = null): array * * @since 1.3.0 * - * @return \WordPress\AiClient\Files\DTO\File The generated video file. - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the prompt or model validation fails. - * @throws \WordPress\AiClient\Common\Exception\RuntimeException If no video is generated. + * @return File The generated video file. + * @throws InvalidArgumentException If the prompt or model validation fails. + * @throws RuntimeException If no video is generated. */ public function generateVideo(): \WordPress\AiClient\Files\DTO\File { @@ -74628,9 +74628,9 @@ public function generateVideo(): \WordPress\AiClient\Files\DTO\File * @since 1.3.0 * * @param int|null $candidateCount The number of videos to generate. - * @return list<\WordPress\AiClient\Files\DTO\File> The generated video files. - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the prompt or model validation fails. - * @throws \WordPress\AiClient\Common\Exception\RuntimeException If no videos are generated. + * @return list The generated video files. + * @throws InvalidArgumentException If the prompt or model validation fails. + * @throws RuntimeException If no videos are generated. */ public function generateVideos(?int $candidateCount = null): array { @@ -74643,7 +74643,7 @@ public function generateVideos(?int $candidateCount = null): array * * @since 0.1.0 * - * @param \WordPress\AiClient\Messages\DTO\MessagePart $part The part to append. + * @param MessagePart $part The part to append. * @return void */ protected function appendPartToMessages(\WordPress\AiClient\Messages\DTO\MessagePart $part): void @@ -74725,7 +74725,7 @@ public static function getJsonSchema(): array; * @since 0.1.0 * * @template TArrayShape of array - * @implements \WordPress\AiClient\Common\Contracts\WithArrayTransformationInterface + * @implements WithArrayTransformationInterface */ abstract class AbstractDataTransferObject implements \WordPress\AiClient\Common\Contracts\WithArrayTransformationInterface, \WordPress\AiClient\Common\Contracts\WithJsonSchemaInterface, \JsonSerializable { @@ -74736,7 +74736,7 @@ abstract class AbstractDataTransferObject implements \WordPress\AiClient\Common\ * * @param array $data The array data to validate. * @param string[] $requiredKeys The keys that must be present. - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If any required key is missing. + * @throws InvalidArgumentException If any required key is missing. */ protected static function validateFromArrayData(array $data, array $requiredKeys): void { @@ -74801,7 +74801,7 @@ abstract class AbstractEnum implements \JsonSerializable * * @param string $property The property name. * @return mixed The property value. - * @throws \BadMethodCallException If property doesn't exist. + * @throws BadMethodCallException If property doesn't exist. */ final public function __get(string $property) { @@ -74813,7 +74813,7 @@ final public function __get(string $property) * * @param string $property The property name. * @param mixed $value The value to set. - * @throws \BadMethodCallException Always, as enum properties are read-only. + * @throws BadMethodCallException Always, as enum properties are read-only. */ final public function __set(string $property, $value): void { @@ -74825,7 +74825,7 @@ final public function __set(string $property, $value): void * * @param string $value The enum value. * @return static The enum instance. - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the value is not valid. + * @throws InvalidArgumentException If the value is not valid. */ final public static function from(string $value): self { @@ -74900,7 +74900,7 @@ final public static function isValidValue(string $value): bool * @since 0.1.0 * * @return array Map of constant names to values. - * @throws \WordPress\AiClient\Common\Exception\RuntimeException If invalid constant found. + * @throws RuntimeException If invalid constant found. */ final protected static function getConstants(): array { @@ -74915,7 +74915,7 @@ final protected static function getConstants(): array * * @param class-string $className The fully qualified class name. * @return array Map of constant names to values. - * @throws \WordPress\AiClient\Common\Exception\RuntimeException If invalid constant found. + * @throws RuntimeException If invalid constant found. */ protected static function determineClassEnumerations(string $className): array { @@ -74928,7 +74928,7 @@ protected static function determineClassEnumerations(string $className): array * @param string $name The method name. * @param array $arguments The method arguments. * @return bool True if the enum value matches. - * @throws \BadMethodCallException If the method doesn't exist. + * @throws BadMethodCallException If the method doesn't exist. */ final public function __call(string $name, array $arguments): bool { @@ -74941,7 +74941,7 @@ final public function __call(string $name, array $arguments): bool * @param string $name The method name. * @param array $arguments The method arguments. * @return static The enum instance. - * @throws \BadMethodCallException If the method doesn't exist. + * @throws BadMethodCallException If the method doesn't exist. */ final public static function __callStatic(string $name, array $arguments): self { @@ -75194,10 +75194,10 @@ class AfterGenerateResultEvent * * @since 0.4.0 * - * @param list<\WordPress\AiClient\Messages\DTO\Message> $messages The messages that were sent to the model. - * @param \WordPress\AiClient\Providers\Models\Contracts\ModelInterface $model The model that processed the prompt. - * @param \WordPress\AiClient\Providers\Models\Enums\CapabilityEnum|null $capability The capability that was used for generation. - * @param \WordPress\AiClient\Results\DTO\GenerativeAiResult $result The result from the model. + * @param list $messages The messages that were sent to the model. + * @param ModelInterface $model The model that processed the prompt. + * @param CapabilityEnum|null $capability The capability that was used for generation. + * @param GenerativeAiResult $result The result from the model. */ public function __construct(array $messages, \WordPress\AiClient\Providers\Models\Contracts\ModelInterface $model, ?\WordPress\AiClient\Providers\Models\Enums\CapabilityEnum $capability, \WordPress\AiClient\Results\DTO\GenerativeAiResult $result) { @@ -75207,7 +75207,7 @@ public function __construct(array $messages, \WordPress\AiClient\Providers\Model * * @since 0.4.0 * - * @return list<\WordPress\AiClient\Messages\DTO\Message> The messages. + * @return list The messages. */ public function getMessages(): array { @@ -75217,7 +75217,7 @@ public function getMessages(): array * * @since 0.4.0 * - * @return \WordPress\AiClient\Providers\Models\Contracts\ModelInterface The model. + * @return ModelInterface The model. */ public function getModel(): \WordPress\AiClient\Providers\Models\Contracts\ModelInterface { @@ -75227,7 +75227,7 @@ public function getModel(): \WordPress\AiClient\Providers\Models\Contracts\Model * * @since 0.4.0 * - * @return \WordPress\AiClient\Providers\Models\Enums\CapabilityEnum|null The capability, or null if not specified. + * @return CapabilityEnum|null The capability, or null if not specified. */ public function getCapability(): ?\WordPress\AiClient\Providers\Models\Enums\CapabilityEnum { @@ -75237,7 +75237,7 @@ public function getCapability(): ?\WordPress\AiClient\Providers\Models\Enums\Cap * * @since 0.4.0 * - * @return \WordPress\AiClient\Results\DTO\GenerativeAiResult The result. + * @return GenerativeAiResult The result. */ public function getResult(): \WordPress\AiClient\Results\DTO\GenerativeAiResult { @@ -75271,9 +75271,9 @@ class BeforeGenerateResultEvent * * @since 0.4.0 * - * @param list<\WordPress\AiClient\Messages\DTO\Message> $messages The messages to be sent to the model. - * @param \WordPress\AiClient\Providers\Models\Contracts\ModelInterface $model The model that will process the prompt. - * @param \WordPress\AiClient\Providers\Models\Enums\CapabilityEnum|null $capability The capability being used for generation. + * @param list $messages The messages to be sent to the model. + * @param ModelInterface $model The model that will process the prompt. + * @param CapabilityEnum|null $capability The capability being used for generation. */ public function __construct(array $messages, \WordPress\AiClient\Providers\Models\Contracts\ModelInterface $model, ?\WordPress\AiClient\Providers\Models\Enums\CapabilityEnum $capability) { @@ -75283,7 +75283,7 @@ public function __construct(array $messages, \WordPress\AiClient\Providers\Model * * @since 0.4.0 * - * @return list<\WordPress\AiClient\Messages\DTO\Message> The messages. + * @return list The messages. */ public function getMessages(): array { @@ -75293,7 +75293,7 @@ public function getMessages(): array * * @since 0.4.0 * - * @return \WordPress\AiClient\Providers\Models\Contracts\ModelInterface The model. + * @return ModelInterface The model. */ public function getModel(): \WordPress\AiClient\Providers\Models\Contracts\ModelInterface { @@ -75303,7 +75303,7 @@ public function getModel(): \WordPress\AiClient\Providers\Models\Contracts\Model * * @since 0.4.0 * - * @return \WordPress\AiClient\Providers\Models\Enums\CapabilityEnum|null The capability, or null if not specified. + * @return CapabilityEnum|null The capability, or null if not specified. */ public function getCapability(): ?\WordPress\AiClient\Providers\Models\Enums\CapabilityEnum { @@ -75338,7 +75338,7 @@ public function __clone() * base64Data?: string * } * - * @extends \WordPress\AiClient\Common\AbstractDataTransferObject + * @extends AbstractDataTransferObject */ class File extends \WordPress\AiClient\Common\AbstractDataTransferObject { @@ -75353,7 +75353,7 @@ class File extends \WordPress\AiClient\Common\AbstractDataTransferObject * * @param string $file The file string (URL, base64 data, or local path). * @param string|null $mimeType The MIME type of the file (optional). - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the file format is invalid or MIME type cannot be determined. + * @throws InvalidArgumentException If the file format is invalid or MIME type cannot be determined. * @phpstan-return void */ public function __construct(string $file, ?string $mimeType = null) @@ -75364,7 +75364,7 @@ public function __construct(string $file, ?string $mimeType = null) * * @since 0.1.0 * - * @return \WordPress\AiClient\Files\Enums\FileTypeEnum The file type. + * @return FileTypeEnum The file type. */ public function getFileType(): \WordPress\AiClient\Files\Enums\FileTypeEnum { @@ -75434,7 +75434,7 @@ public function getMimeType(): string * * @since 0.1.0 * - * @return \WordPress\AiClient\Files\ValueObjects\MimeType The MIME type object. + * @return MimeType The MIME type object. */ public function getMimeTypeObject(): \WordPress\AiClient\Files\ValueObjects\MimeType { @@ -75617,7 +75617,7 @@ final class MimeType * @since 0.1.0 * * @param string $value The MIME type value. - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the MIME type is invalid. + * @throws InvalidArgumentException If the MIME type is invalid. */ public function __construct(string $value) { @@ -75628,7 +75628,7 @@ public function __construct(string $value) * @since 0.1.0 * * @return string The file extension (without the dot). - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If no known extension exists for this MIME type. + * @throws InvalidArgumentException If no known extension exists for this MIME type. */ public function toExtension(): string { @@ -75640,7 +75640,7 @@ public function toExtension(): string * * @param string $extension The file extension (without the dot). * @return self The MimeType instance. - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the extension is not recognized. + * @throws InvalidArgumentException If the extension is not recognized. */ public static function fromExtension(string $extension): self { @@ -75727,7 +75727,7 @@ public function isDocument(): bool * * @param self|string $other The other MIME type to compare. * @return bool True if equal. - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the other MIME type is invalid. + * @throws InvalidArgumentException If the other MIME type is invalid. */ public function equals($other): bool { @@ -75760,14 +75760,14 @@ public function __toString(): string * parts: array * } * - * @extends \WordPress\AiClient\Common\AbstractDataTransferObject + * @extends AbstractDataTransferObject */ class Message extends \WordPress\AiClient\Common\AbstractDataTransferObject { public const KEY_ROLE = 'role'; public const KEY_PARTS = 'parts'; /** - * @var \WordPress\AiClient\Messages\Enums\MessageRoleEnum The role of the message sender. + * @var MessageRoleEnum The role of the message sender. */ protected \WordPress\AiClient\Messages\Enums\MessageRoleEnum $role; /** @@ -75779,9 +75779,9 @@ class Message extends \WordPress\AiClient\Common\AbstractDataTransferObject * * @since 0.1.0 * - * @param \WordPress\AiClient\Messages\Enums\MessageRoleEnum $role The role of the message sender. + * @param MessageRoleEnum $role The role of the message sender. * @param MessagePart[] $parts The parts that make up this message. - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If parts contain invalid content for the role. + * @throws InvalidArgumentException If parts contain invalid content for the role. */ public function __construct(\WordPress\AiClient\Messages\Enums\MessageRoleEnum $role, array $parts) { @@ -75791,7 +75791,7 @@ public function __construct(\WordPress\AiClient\Messages\Enums\MessageRoleEnum $ * * @since 0.1.0 * - * @return \WordPress\AiClient\Messages\Enums\MessageRoleEnum The role. + * @return MessageRoleEnum The role. */ public function getRole(): \WordPress\AiClient\Messages\Enums\MessageRoleEnum { @@ -75813,7 +75813,7 @@ public function getParts(): array * * @param MessagePart $part The part to append. * @return Message A new instance with the part appended. - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the part is invalid for the role. + * @throws InvalidArgumentException If the part is invalid for the role. */ public function withPart(\WordPress\AiClient\Messages\DTO\MessagePart $part): \WordPress\AiClient\Messages\DTO\Message { @@ -75866,9 +75866,9 @@ public function __clone() * * @since 0.1.0 * - * @phpstan-import-type FileArrayShape from \WordPress\AiClient\Files\DTO\File - * @phpstan-import-type FunctionCallArrayShape from \WordPress\AiClient\Tools\DTO\FunctionCall - * @phpstan-import-type FunctionResponseArrayShape from \WordPress\AiClient\Tools\DTO\FunctionResponse + * @phpstan-import-type FileArrayShape from File + * @phpstan-import-type FunctionCallArrayShape from FunctionCall + * @phpstan-import-type FunctionResponseArrayShape from FunctionResponse * * @phpstan-type MessagePartArrayShape array{ * channel: string, @@ -75880,7 +75880,7 @@ public function __clone() * functionResponse?: FunctionResponseArrayShape * } * - * @extends \WordPress\AiClient\Common\AbstractDataTransferObject + * @extends AbstractDataTransferObject */ class MessagePart extends \WordPress\AiClient\Common\AbstractDataTransferObject { @@ -75897,9 +75897,9 @@ class MessagePart extends \WordPress\AiClient\Common\AbstractDataTransferObject * @since 0.1.0 * * @param mixed $content The content of this message part. - * @param \WordPress\AiClient\Messages\Enums\MessagePartChannelEnum|null $channel The channel this part belongs to. Defaults to CONTENT. + * @param MessagePartChannelEnum|null $channel The channel this part belongs to. Defaults to CONTENT. * @param string|null $thoughtSignature Optional thought signature for extended thinking. - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If an unsupported content type is provided. + * @throws InvalidArgumentException If an unsupported content type is provided. */ public function __construct($content, ?\WordPress\AiClient\Messages\Enums\MessagePartChannelEnum $channel = null, ?string $thoughtSignature = null) { @@ -75909,7 +75909,7 @@ public function __construct($content, ?\WordPress\AiClient\Messages\Enums\Messag * * @since 0.1.0 * - * @return \WordPress\AiClient\Messages\Enums\MessagePartChannelEnum The channel. + * @return MessagePartChannelEnum The channel. */ public function getChannel(): \WordPress\AiClient\Messages\Enums\MessagePartChannelEnum { @@ -75919,7 +75919,7 @@ public function getChannel(): \WordPress\AiClient\Messages\Enums\MessagePartChan * * @since 0.1.0 * - * @return \WordPress\AiClient\Messages\Enums\MessagePartTypeEnum The type. + * @return MessagePartTypeEnum The type. */ public function getType(): \WordPress\AiClient\Messages\Enums\MessagePartTypeEnum { @@ -75949,7 +75949,7 @@ public function getText(): ?string * * @since 0.1.0 * - * @return \WordPress\AiClient\Files\DTO\File|null The file or null if not a file part. + * @return File|null The file or null if not a file part. */ public function getFile(): ?\WordPress\AiClient\Files\DTO\File { @@ -75959,7 +75959,7 @@ public function getFile(): ?\WordPress\AiClient\Files\DTO\File * * @since 0.1.0 * - * @return \WordPress\AiClient\Tools\DTO\FunctionCall|null The function call or null if not a function call part. + * @return FunctionCall|null The function call or null if not a function call part. */ public function getFunctionCall(): ?\WordPress\AiClient\Tools\DTO\FunctionCall { @@ -75969,7 +75969,7 @@ public function getFunctionCall(): ?\WordPress\AiClient\Tools\DTO\FunctionCall * * @since 0.1.0 * - * @return \WordPress\AiClient\Tools\DTO\FunctionResponse|null The function response or null if not a function response part. + * @return FunctionResponse|null The function response or null if not a function response part. */ public function getFunctionResponse(): ?\WordPress\AiClient\Tools\DTO\FunctionResponse { @@ -76202,7 +76202,7 @@ public function getId(): string; * * @since 0.1.0 * - * @return \WordPress\AiClient\Operations\Enums\OperationStateEnum The operation state. + * @return OperationStateEnum The operation state. */ public function getState(): \WordPress\AiClient\Operations\Enums\OperationStateEnum; } @@ -76216,11 +76216,11 @@ public function getState(): \WordPress\AiClient\Operations\Enums\OperationStateE * * @since 0.1.0 * - * @phpstan-import-type GenerativeAiResultArrayShape from \WordPress\AiClient\Results\DTO\GenerativeAiResult + * @phpstan-import-type GenerativeAiResultArrayShape from GenerativeAiResult * * @phpstan-type GenerativeAiOperationArrayShape array{id: string, state: string, result?: GenerativeAiResultArrayShape} * - * @extends \WordPress\AiClient\Common\AbstractDataTransferObject + * @extends AbstractDataTransferObject */ class GenerativeAiOperation extends \WordPress\AiClient\Common\AbstractDataTransferObject implements \WordPress\AiClient\Operations\Contracts\OperationInterface { @@ -76233,8 +76233,8 @@ class GenerativeAiOperation extends \WordPress\AiClient\Common\AbstractDataTrans * @since 0.1.0 * * @param string $id Unique identifier for this operation. - * @param \WordPress\AiClient\Operations\Enums\OperationStateEnum $state The current state of the operation. - * @param \WordPress\AiClient\Results\DTO\GenerativeAiResult|null $result The result once the operation completes. + * @param OperationStateEnum $state The current state of the operation. + * @param GenerativeAiResult|null $result The result once the operation completes. */ public function __construct(string $id, \WordPress\AiClient\Operations\Enums\OperationStateEnum $state, ?\WordPress\AiClient\Results\DTO\GenerativeAiResult $result = null) { @@ -76272,7 +76272,7 @@ public function getState(): \WordPress\AiClient\Operations\Enums\OperationStateE * * @since 0.1.0 * - * @return \WordPress\AiClient\Results\DTO\GenerativeAiResult|null The result or null if not yet complete. + * @return GenerativeAiResult|null The result or null if not yet complete. */ public function getResult(): ?\WordPress\AiClient\Results\DTO\GenerativeAiResult { @@ -76362,7 +76362,7 @@ interface ProviderInterface * * @since 0.1.0 * - * @return \WordPress\AiClient\Providers\DTO\ProviderMetadata Provider metadata. + * @return ProviderMetadata Provider metadata. */ public static function metadata(): \WordPress\AiClient\Providers\DTO\ProviderMetadata; /** @@ -76371,9 +76371,9 @@ public static function metadata(): \WordPress\AiClient\Providers\DTO\ProviderMet * @since 0.1.0 * * @param string $modelId Model identifier. - * @param ?\WordPress\AiClient\Providers\Models\DTO\ModelConfig $modelConfig Model configuration. - * @return \WordPress\AiClient\Providers\Models\Contracts\ModelInterface Model instance. - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If model not found or configuration invalid. + * @param ?ModelConfig $modelConfig Model configuration. + * @return ModelInterface Model instance. + * @throws InvalidArgumentException If model not found or configuration invalid. */ public static function model(string $modelId, ?\WordPress\AiClient\Providers\Models\DTO\ModelConfig $modelConfig = null): \WordPress\AiClient\Providers\Models\Contracts\ModelInterface; /** @@ -76439,9 +76439,9 @@ final public static function modelMetadataDirectory(): \WordPress\AiClient\Provi * * @since 0.1.0 * - * @param \WordPress\AiClient\Providers\Models\DTO\ModelMetadata $modelMetadata The model metadata. - * @param \WordPress\AiClient\Providers\DTO\ProviderMetadata $providerMetadata The provider metadata. - * @return \WordPress\AiClient\Providers\Models\Contracts\ModelInterface The new model instance. + * @param ModelMetadata $modelMetadata The model metadata. + * @param ProviderMetadata $providerMetadata The provider metadata. + * @return ModelInterface The new model instance. */ abstract protected static function createModel(\WordPress\AiClient\Providers\Models\DTO\ModelMetadata $modelMetadata, \WordPress\AiClient\Providers\DTO\ProviderMetadata $providerMetadata): \WordPress\AiClient\Providers\Models\Contracts\ModelInterface; /** @@ -76449,7 +76449,7 @@ abstract protected static function createModel(\WordPress\AiClient\Providers\Mod * * @since 0.1.0 * - * @return \WordPress\AiClient\Providers\DTO\ProviderMetadata The provider metadata. + * @return ProviderMetadata The provider metadata. */ abstract protected static function createProviderMetadata(): \WordPress\AiClient\Providers\DTO\ProviderMetadata; /** @@ -76457,7 +76457,7 @@ abstract protected static function createProviderMetadata(): \WordPress\AiClient * * @since 0.1.0 * - * @return \WordPress\AiClient\Providers\Contracts\ProviderAvailabilityInterface The provider availability. + * @return ProviderAvailabilityInterface The provider availability. */ abstract protected static function createProviderAvailability(): \WordPress\AiClient\Providers\Contracts\ProviderAvailabilityInterface; /** @@ -76465,7 +76465,7 @@ abstract protected static function createProviderAvailability(): \WordPress\AiCl * * @since 0.1.0 * - * @return \WordPress\AiClient\Providers\Contracts\ModelMetadataDirectoryInterface The model metadata directory. + * @return ModelMetadataDirectoryInterface The model metadata directory. */ abstract protected static function createModelMetadataDirectory(): \WordPress\AiClient\Providers\Contracts\ModelMetadataDirectoryInterface; } @@ -76486,7 +76486,7 @@ interface ModelInterface * * @since 0.1.0 * - * @return \WordPress\AiClient\Providers\Models\DTO\ModelMetadata Model metadata. + * @return ModelMetadata Model metadata. */ public function metadata(): \WordPress\AiClient\Providers\Models\DTO\ModelMetadata; /** @@ -76494,7 +76494,7 @@ public function metadata(): \WordPress\AiClient\Providers\Models\DTO\ModelMetada * * @since 0.1.0 * - * @return \WordPress\AiClient\Providers\DTO\ProviderMetadata The provider metadata. + * @return ProviderMetadata The provider metadata. */ public function providerMetadata(): \WordPress\AiClient\Providers\DTO\ProviderMetadata; /** @@ -76502,7 +76502,7 @@ public function providerMetadata(): \WordPress\AiClient\Providers\DTO\ProviderMe * * @since 0.1.0 * - * @param \WordPress\AiClient\Providers\Models\DTO\ModelConfig $config Model configuration. + * @param ModelConfig $config Model configuration. * @return void */ public function setConfig(\WordPress\AiClient\Providers\Models\DTO\ModelConfig $config): void; @@ -76511,7 +76511,7 @@ public function setConfig(\WordPress\AiClient\Providers\Models\DTO\ModelConfig $ * * @since 0.1.0 * - * @return \WordPress\AiClient\Providers\Models\DTO\ModelConfig Current model configuration. + * @return ModelConfig Current model configuration. */ public function getConfig(): \WordPress\AiClient\Providers\Models\DTO\ModelConfig; } @@ -76532,7 +76532,7 @@ interface ApiBasedModelInterface extends \WordPress\AiClient\Providers\Models\Co * * @since 0.3.0 * - * @param \WordPress\AiClient\Providers\Http\DTO\RequestOptions $requestOptions The request options to use. + * @param RequestOptions $requestOptions The request options to use. * @return void */ public function setRequestOptions(\WordPress\AiClient\Providers\Http\DTO\RequestOptions $requestOptions): void; @@ -76541,7 +76541,7 @@ public function setRequestOptions(\WordPress\AiClient\Providers\Http\DTO\Request * * @since 0.3.0 * - * @return \WordPress\AiClient\Providers\Http\DTO\RequestOptions|null The request options, or null if not set. + * @return RequestOptions|null The request options, or null if not set. */ public function getRequestOptions(): ?\WordPress\AiClient\Providers\Http\DTO\RequestOptions; } @@ -76607,7 +76607,7 @@ public function getRequestAuthentication(): \WordPress\AiClient\Providers\Http\C trait WithHttpTransporterTrait { /** - * @var \WordPress\AiClient\Providers\Http\Contracts\HttpTransporterInterface|null The HTTP transporter instance. + * @var HttpTransporterInterface|null The HTTP transporter instance. */ private ?\WordPress\AiClient\Providers\Http\Contracts\HttpTransporterInterface $httpTransporter = null; /** @@ -76635,7 +76635,7 @@ public function getHttpTransporter(): \WordPress\AiClient\Providers\Http\Contrac trait WithRequestAuthenticationTrait { /** - * @var \WordPress\AiClient\Providers\Http\Contracts\RequestAuthenticationInterface|null The request authentication instance. + * @var RequestAuthenticationInterface|null The request authentication instance. */ private ?\WordPress\AiClient\Providers\Http\Contracts\RequestAuthenticationInterface $requestAuthentication = null; /** @@ -76674,8 +76674,8 @@ abstract class AbstractApiBasedModel implements \WordPress\AiClient\Providers\Ap * * @since 0.1.0 * - * @param \WordPress\AiClient\Providers\Models\DTO\ModelMetadata $metadata The metadata for the model. - * @param \WordPress\AiClient\Providers\DTO\ProviderMetadata $providerMetadata The metadata for the model's provider. + * @param ModelMetadata $metadata The metadata for the model. + * @param ProviderMetadata $providerMetadata The metadata for the model's provider. */ public function __construct(\WordPress\AiClient\Providers\Models\DTO\ModelMetadata $metadata, \WordPress\AiClient\Providers\DTO\ProviderMetadata $providerMetadata) { @@ -76746,7 +76746,7 @@ interface ModelMetadataDirectoryInterface * * @since 0.1.0 * - * @return list<\WordPress\AiClient\Providers\Models\DTO\ModelMetadata> Array of model metadata. + * @return list Array of model metadata. */ public function listModelMetadata(): array; /** @@ -76764,8 +76764,8 @@ public function hasModelMetadata(string $modelId): bool; * @since 0.1.0 * * @param string $modelId Model identifier. - * @return \WordPress\AiClient\Providers\Models\DTO\ModelMetadata Model metadata. - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If model metadata not found. + * @return ModelMetadata Model metadata. + * @throws InvalidArgumentException If model metadata not found. */ public function getModelMetadata(string $modelId): \WordPress\AiClient\Providers\Models\DTO\ModelMetadata; } @@ -76826,7 +76826,7 @@ protected function getBaseCacheKey(): string * * @since 0.1.0 * - * @return array Map of model ID to model metadata. + * @return array Map of model ID to model metadata. */ abstract protected function sendListModelsRequest(): array; } @@ -76908,7 +76908,7 @@ class GenerateTextApiBasedProviderAvailability implements \WordPress\AiClient\Pr * * @since 0.1.0 * - * @param \WordPress\AiClient\Providers\Models\Contracts\ModelInterface $model The model to use for checking availability. + * @param ModelInterface $model The model to use for checking availability. */ public function __construct(\WordPress\AiClient\Providers\Models\Contracts\ModelInterface $model) { @@ -76938,7 +76938,7 @@ class ListModelsApiBasedProviderAvailability implements \WordPress\AiClient\Prov * * @since 0.1.0 * - * @param \WordPress\AiClient\Providers\Contracts\ModelMetadataDirectoryInterface $modelMetadataDirectory The model metadata directory to use for checking + * @param ModelMetadataDirectoryInterface $modelMetadataDirectory The model metadata directory to use for checking * availability. */ public function __construct(\WordPress\AiClient\Providers\Contracts\ModelMetadataDirectoryInterface $modelMetadataDirectory) @@ -76972,8 +76972,8 @@ interface ProviderOperationsHandlerInterface * @since 0.1.0 * * @param string $operationId Operation identifier. - * @return \WordPress\AiClient\Operations\Contracts\OperationInterface The operation. - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If operation not found. + * @return OperationInterface The operation. + * @throws InvalidArgumentException If operation not found. */ public function getOperation(string $operationId): \WordPress\AiClient\Operations\Contracts\OperationInterface; } @@ -77018,7 +77018,7 @@ public static function operationsHandler(): \WordPress\AiClient\Providers\Contra * logoPath?: ?string * } * - * @extends \WordPress\AiClient\Common\AbstractDataTransferObject + * @extends AbstractDataTransferObject */ class ProviderMetadata extends \WordPress\AiClient\Common\AbstractDataTransferObject { @@ -77042,7 +77042,7 @@ class ProviderMetadata extends \WordPress\AiClient\Common\AbstractDataTransferOb */ protected ?string $description; /** - * @var \WordPress\AiClient\Providers\Enums\ProviderTypeEnum The provider type. + * @var ProviderTypeEnum The provider type. */ protected \WordPress\AiClient\Providers\Enums\ProviderTypeEnum $type; /** @@ -77050,7 +77050,7 @@ class ProviderMetadata extends \WordPress\AiClient\Common\AbstractDataTransferOb */ protected ?string $credentialsUrl; /** - * @var \WordPress\AiClient\Providers\Http\Enums\RequestAuthenticationMethod|null The authentication method. + * @var RequestAuthenticationMethod|null The authentication method. */ protected ?\WordPress\AiClient\Providers\Http\Enums\RequestAuthenticationMethod $authenticationMethod; /** @@ -77066,12 +77066,12 @@ class ProviderMetadata extends \WordPress\AiClient\Common\AbstractDataTransferOb * * @param string $id The provider's unique identifier. * @param string $name The provider's display name. - * @param \WordPress\AiClient\Providers\Enums\ProviderTypeEnum $type The provider type. + * @param ProviderTypeEnum $type The provider type. * @param string|null $credentialsUrl The URL where users can get credentials. - * @param \WordPress\AiClient\Providers\Http\Enums\RequestAuthenticationMethod|null $authenticationMethod The authentication method. + * @param RequestAuthenticationMethod|null $authenticationMethod The authentication method. * @param string|null $description The provider's description. * @param string|null $logoPath The full path to the provider's logo image file. - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the provider ID contains invalid characters. + * @throws InvalidArgumentException If the provider ID contains invalid characters. */ public function __construct(string $id, string $name, \WordPress\AiClient\Providers\Enums\ProviderTypeEnum $type, ?string $credentialsUrl = null, ?\WordPress\AiClient\Providers\Http\Enums\RequestAuthenticationMethod $authenticationMethod = null, ?string $description = null, ?string $logoPath = null) { @@ -77111,7 +77111,7 @@ public function getDescription(): ?string * * @since 0.1.0 * - * @return \WordPress\AiClient\Providers\Enums\ProviderTypeEnum The provider type. + * @return ProviderTypeEnum The provider type. */ public function getType(): \WordPress\AiClient\Providers\Enums\ProviderTypeEnum { @@ -77131,7 +77131,7 @@ public function getCredentialsUrl(): ?string * * @since 0.4.0 * - * @return \WordPress\AiClient\Providers\Http\Enums\RequestAuthenticationMethod|null The authentication method. + * @return RequestAuthenticationMethod|null The authentication method. */ public function getAuthenticationMethod(): ?\WordPress\AiClient\Providers\Http\Enums\RequestAuthenticationMethod { @@ -77188,14 +77188,14 @@ public static function fromArray(array $array): self * @since 0.1.0 * * @phpstan-import-type ProviderMetadataArrayShape from ProviderMetadata - * @phpstan-import-type ModelMetadataArrayShape from \WordPress\AiClient\Providers\Models\DTO\ModelMetadata + * @phpstan-import-type ModelMetadataArrayShape from ModelMetadata * * @phpstan-type ProviderModelsMetadataArrayShape array{ * provider: ProviderMetadataArrayShape, * models: list * } * - * @extends \WordPress\AiClient\Common\AbstractDataTransferObject + * @extends AbstractDataTransferObject */ class ProviderModelsMetadata extends \WordPress\AiClient\Common\AbstractDataTransferObject { @@ -77206,7 +77206,7 @@ class ProviderModelsMetadata extends \WordPress\AiClient\Common\AbstractDataTran */ protected \WordPress\AiClient\Providers\DTO\ProviderMetadata $provider; /** - * @var list<\WordPress\AiClient\Providers\Models\DTO\ModelMetadata> The available models. + * @var list The available models. */ protected array $models; /** @@ -77215,9 +77215,9 @@ class ProviderModelsMetadata extends \WordPress\AiClient\Common\AbstractDataTran * @since 0.1.0 * * @param ProviderMetadata $provider The provider metadata. - * @param list<\WordPress\AiClient\Providers\Models\DTO\ModelMetadata> $models The available models. + * @param list $models The available models. * - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If models is not a list. + * @throws InvalidArgumentException If models is not a list. */ public function __construct(\WordPress\AiClient\Providers\DTO\ProviderMetadata $provider, array $models) { @@ -77248,7 +77248,7 @@ public function getProvider(): \WordPress\AiClient\Providers\DTO\ProviderMetadat * * @since 0.1.0 * - * @return list<\WordPress\AiClient\Providers\Models\DTO\ModelMetadata> The available models. + * @return list The available models. */ public function getModels(): array { @@ -77425,9 +77425,9 @@ interface HttpTransporterInterface * * @since 0.1.0 * - * @param \WordPress\AiClient\Providers\Http\DTO\Request $request The request to send. - * @param \WordPress\AiClient\Providers\Http\DTO\RequestOptions|null $options Optional transport options for the request. - * @return \WordPress\AiClient\Providers\Http\DTO\Response The response received. + * @param Request $request The request to send. + * @param RequestOptions|null $options Optional transport options for the request. + * @return Response The response received. */ public function send(\WordPress\AiClient\Providers\Http\DTO\Request $request, ?\WordPress\AiClient\Providers\Http\DTO\RequestOptions $options = null): \WordPress\AiClient\Providers\Http\DTO\Response; } @@ -77443,8 +77443,8 @@ interface RequestAuthenticationInterface extends \WordPress\AiClient\Common\Cont * * @since 0.1.0 * - * @param \WordPress\AiClient\Providers\Http\DTO\Request $request The request to authenticate. - * @return \WordPress\AiClient\Providers\Http\DTO\Request The authenticated request. + * @param Request $request The request to authenticate. + * @return Request The authenticated request. */ public function authenticateRequest(\WordPress\AiClient\Providers\Http\DTO\Request $request): \WordPress\AiClient\Providers\Http\DTO\Request; } @@ -77459,7 +77459,7 @@ public function authenticateRequest(\WordPress\AiClient\Providers\Http\DTO\Reque * apiKey: string * } * - * @extends \WordPress\AiClient\Common\AbstractDataTransferObject + * @extends AbstractDataTransferObject */ class ApiKeyRequestAuthentication extends \WordPress\AiClient\Common\AbstractDataTransferObject implements \WordPress\AiClient\Providers\Http\Contracts\RequestAuthenticationInterface { @@ -77544,7 +77544,7 @@ public static function getJsonSchema(): array * options?: RequestOptionsArrayShape * } * - * @extends \WordPress\AiClient\Common\AbstractDataTransferObject + * @extends AbstractDataTransferObject */ class Request extends \WordPress\AiClient\Common\AbstractDataTransferObject { @@ -77554,7 +77554,7 @@ class Request extends \WordPress\AiClient\Common\AbstractDataTransferObject public const KEY_BODY = 'body'; public const KEY_OPTIONS = 'options'; /** - * @var \WordPress\AiClient\Providers\Http\Enums\HttpMethodEnum The HTTP method. + * @var HttpMethodEnum The HTTP method. */ protected \WordPress\AiClient\Providers\Http\Enums\HttpMethodEnum $method; /** @@ -77562,7 +77562,7 @@ class Request extends \WordPress\AiClient\Common\AbstractDataTransferObject */ protected string $uri; /** - * @var \WordPress\AiClient\Providers\Http\Collections\HeadersCollection The request headers. + * @var HeadersCollection The request headers. */ protected \WordPress\AiClient\Providers\Http\Collections\HeadersCollection $headers; /** @@ -77582,13 +77582,13 @@ class Request extends \WordPress\AiClient\Common\AbstractDataTransferObject * * @since 0.1.0 * - * @param \WordPress\AiClient\Providers\Http\Enums\HttpMethodEnum $method The HTTP method. + * @param HttpMethodEnum $method The HTTP method. * @param string $uri The request URI. * @param array> $headers The request headers. * @param string|array|null $data The request data. * @param RequestOptions|null $options The request transport options. * - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the URI is empty. + * @throws InvalidArgumentException If the URI is empty. */ public function __construct(\WordPress\AiClient\Providers\Http\Enums\HttpMethodEnum $method, string $uri, array $headers = [], $data = null, ?\WordPress\AiClient\Providers\Http\DTO\RequestOptions $options = null) { @@ -77610,7 +77610,7 @@ public function __clone() * * @since 0.1.0 * - * @return \WordPress\AiClient\Providers\Http\Enums\HttpMethodEnum The HTTP method. + * @return HttpMethodEnum The HTTP method. */ public function getMethod(): \WordPress\AiClient\Providers\Http\Enums\HttpMethodEnum { @@ -77682,7 +77682,7 @@ public function hasHeader(string $name): bool * @since 0.1.0 * * @return string|null The body. - * @throws \JsonException If the data cannot be encoded to JSON. + * @throws JsonException If the data cannot be encoded to JSON. */ public function getBody(): ?string { @@ -77772,9 +77772,9 @@ public static function fromArray(array $array): self * * @since 0.2.0 * - * @param \WordPress\AiClientDependencies\Psr\Http\Message\RequestInterface $psrRequest The PSR-7 request to convert. + * @param RequestInterface $psrRequest The PSR-7 request to convert. * @return self A new Request instance. - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the HTTP method is not supported. + * @throws InvalidArgumentException If the HTTP method is not supported. */ public static function fromPsrRequest(\WordPress\AiClientDependencies\Psr\Http\Message\RequestInterface $psrRequest): self { @@ -77793,7 +77793,7 @@ public static function fromPsrRequest(\WordPress\AiClientDependencies\Psr\Http\M * maxRedirects?: int|null * } * - * @extends \WordPress\AiClient\Common\AbstractDataTransferObject + * @extends AbstractDataTransferObject */ class RequestOptions extends \WordPress\AiClient\Common\AbstractDataTransferObject { @@ -77820,7 +77820,7 @@ class RequestOptions extends \WordPress\AiClient\Common\AbstractDataTransferObje * @param float|null $timeout Timeout in seconds. * @return void * - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException When timeout is negative. + * @throws InvalidArgumentException When timeout is negative. */ public function setTimeout(?float $timeout): void { @@ -77833,7 +77833,7 @@ public function setTimeout(?float $timeout): void * @param float|null $timeout Connection timeout in seconds. * @return void * - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException When timeout is negative. + * @throws InvalidArgumentException When timeout is negative. */ public function setConnectTimeout(?float $timeout): void { @@ -77849,7 +77849,7 @@ public function setConnectTimeout(?float $timeout): void * @param int|null $maxRedirects Maximum redirects to follow, or 0 to disable, or null for unspecified. * @return void * - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException When redirect count is negative. + * @throws InvalidArgumentException When redirect count is negative. */ public function setMaxRedirects(?int $maxRedirects): void { @@ -77937,7 +77937,7 @@ public static function getJsonSchema(): array * body?: string|null * } * - * @extends \WordPress\AiClient\Common\AbstractDataTransferObject + * @extends AbstractDataTransferObject */ class Response extends \WordPress\AiClient\Common\AbstractDataTransferObject { @@ -77949,7 +77949,7 @@ class Response extends \WordPress\AiClient\Common\AbstractDataTransferObject */ protected int $statusCode; /** - * @var \WordPress\AiClient\Providers\Http\Collections\HeadersCollection The response headers. + * @var HeadersCollection The response headers. */ protected \WordPress\AiClient\Providers\Http\Collections\HeadersCollection $headers; /** @@ -77965,7 +77965,7 @@ class Response extends \WordPress\AiClient\Common\AbstractDataTransferObject * @param array> $headers The response headers. * @param string|null $body The response body. * - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the status code is invalid. + * @throws InvalidArgumentException If the status code is invalid. */ public function __construct(int $statusCode, array $headers, ?string $body = null) { @@ -78217,7 +78217,7 @@ class RequestAuthenticationMethod extends \WordPress\AiClient\Common\AbstractEnu * * @since 0.4.0 * - * @return class-string<\WordPress\AiClient\Providers\Http\Contracts\RequestAuthenticationInterface&\WordPress\AiClient\Common\Contracts\WithArrayTransformationInterface> The implementation class. + * @return class-string The implementation class. * * @phpstan-ignore missingType.generics */ @@ -78240,7 +78240,7 @@ class ClientException extends \WordPress\AiClient\Common\Exception\InvalidArgume /** * The request that failed. * - * @var \WordPress\AiClient\Providers\Http\DTO\Request|null + * @var Request|null */ protected ?\WordPress\AiClient\Providers\Http\DTO\Request $request = null; /** @@ -78248,7 +78248,7 @@ class ClientException extends \WordPress\AiClient\Common\Exception\InvalidArgume * * @since 0.2.0 * - * @return \WordPress\AiClient\Providers\Http\DTO\Request + * @return Request * @throws \RuntimeException If no request is available */ public function getRequest(): \WordPress\AiClient\Providers\Http\DTO\Request @@ -78262,7 +78262,7 @@ public function getRequest(): \WordPress\AiClient\Providers\Http\DTO\Request * * @since 0.2.0 * - * @param \WordPress\AiClient\Providers\Http\DTO\Response $response The HTTP response that failed. + * @param Response $response The HTTP response that failed. * @return self */ public static function fromClientErrorResponse(\WordPress\AiClient\Providers\Http\DTO\Response $response): self @@ -78282,7 +78282,7 @@ class NetworkException extends \WordPress\AiClient\Common\Exception\RuntimeExcep /** * The request that failed. * - * @var \WordPress\AiClient\Providers\Http\DTO\Request|null + * @var Request|null */ protected ?\WordPress\AiClient\Providers\Http\DTO\Request $request = null; /** @@ -78290,7 +78290,7 @@ class NetworkException extends \WordPress\AiClient\Common\Exception\RuntimeExcep * * @since 0.2.0 * - * @return \WordPress\AiClient\Providers\Http\DTO\Request + * @return Request * @throws \RuntimeException If no request is available */ public function getRequest(): \WordPress\AiClient\Providers\Http\DTO\Request @@ -78301,7 +78301,7 @@ public function getRequest(): \WordPress\AiClient\Providers\Http\DTO\Request * * @since 0.2.0 * - * @param \WordPress\AiClientDependencies\Psr\Http\Message\RequestInterface $psrRequest The PSR-7 request that failed. + * @param RequestInterface $psrRequest The PSR-7 request that failed. * @param \Throwable $networkException The PSR-18 network exception. * @return self */ @@ -78328,7 +78328,7 @@ class RedirectException extends \WordPress\AiClient\Common\Exception\RuntimeExce * * @since 0.2.0 * - * @param \WordPress\AiClient\Providers\Http\DTO\Response $response The HTTP redirect response. + * @param Response $response The HTTP redirect response. * @return self */ public static function fromRedirectResponse(\WordPress\AiClient\Providers\Http\DTO\Response $response): self @@ -78390,7 +78390,7 @@ class ServerException extends \WordPress\AiClient\Common\Exception\RuntimeExcept * * @since 0.2.0 * - * @param \WordPress\AiClient\Providers\Http\DTO\Response $response The HTTP response that failed. + * @param Response $response The HTTP response that failed. * @return self */ public static function fromServerErrorResponse(\WordPress\AiClient\Providers\Http\DTO\Response $response): self @@ -78415,9 +78415,9 @@ class HttpTransporter implements \WordPress\AiClient\Providers\Http\Contracts\Ht * * @since 0.1.0 * - * @param \WordPress\AiClientDependencies\Psr\Http\Client\ClientInterface|null $client PSR-18 HTTP client. - * @param \WordPress\AiClientDependencies\Psr\Http\Message\RequestFactoryInterface|null $requestFactory PSR-17 request factory. - * @param \WordPress\AiClientDependencies\Psr\Http\Message\StreamFactoryInterface|null $streamFactory PSR-17 stream factory. + * @param ClientInterface|null $client PSR-18 HTTP client. + * @param RequestFactoryInterface|null $requestFactory PSR-17 request factory. + * @param StreamFactoryInterface|null $streamFactory PSR-17 stream factory. */ public function __construct(?\WordPress\AiClientDependencies\Psr\Http\Client\ClientInterface $client = null, ?\WordPress\AiClientDependencies\Psr\Http\Message\RequestFactoryInterface $requestFactory = null, ?\WordPress\AiClientDependencies\Psr\Http\Message\StreamFactoryInterface $streamFactory = null) { @@ -78450,7 +78450,7 @@ class HttpTransporterFactory * * @since 0.1.0 * - * @return \WordPress\AiClient\Providers\Http\Contracts\HttpTransporterInterface The HTTP transporter. + * @return HttpTransporterInterface The HTTP transporter. */ public static function createTransporter(): \WordPress\AiClient\Providers\Http\Contracts\HttpTransporterInterface { @@ -78505,10 +78505,10 @@ class ResponseUtil * * @since 0.1.0 * - * @param \WordPress\AiClient\Providers\Http\DTO\Response $response The HTTP response to check. - * @throws \WordPress\AiClient\Providers\Http\Exception\RedirectException If the response indicates a redirect (3xx). - * @throws \WordPress\AiClient\Providers\Http\Exception\ClientException If the response indicates a client error (4xx). - * @throws \WordPress\AiClient\Providers\Http\Exception\ServerException If the response indicates a server error (5xx). + * @param Response $response The HTTP response to check. + * @throws RedirectException If the response indicates a redirect (3xx). + * @throws ClientException If the response indicates a client error (4xx). + * @throws ServerException If the response indicates a server error (5xx). * @throws \RuntimeException If the response has an invalid status code. */ public static function throwIfNotSuccessful(\WordPress\AiClient\Providers\Http\DTO\Response $response): void @@ -78526,8 +78526,8 @@ public static function throwIfNotSuccessful(\WordPress\AiClient\Providers\Http\D * * @since 0.1.0 * - * @phpstan-import-type FunctionDeclarationArrayShape from \WordPress\AiClient\Tools\DTO\FunctionDeclaration - * @phpstan-import-type WebSearchArrayShape from \WordPress\AiClient\Tools\DTO\WebSearch + * @phpstan-import-type FunctionDeclarationArrayShape from FunctionDeclaration + * @phpstan-import-type WebSearchArrayShape from WebSearch * * @phpstan-type ModelConfigArrayShape array{ * outputModalities?: list, @@ -78553,7 +78553,7 @@ public static function throwIfNotSuccessful(\WordPress\AiClient\Providers\Http\D * customOptions?: array * } * - * @extends \WordPress\AiClient\Common\AbstractDataTransferObject + * @extends AbstractDataTransferObject */ class ModelConfig extends \WordPress\AiClient\Common\AbstractDataTransferObject { @@ -78585,7 +78585,7 @@ class ModelConfig extends \WordPress\AiClient\Common\AbstractDataTransferObject */ public const KEY_INPUT_MODALITIES = 'inputModalities'; /** - * @var list<\WordPress\AiClient\Messages\Enums\ModalityEnum>|null Output modalities for the model. + * @var list|null Output modalities for the model. */ protected ?array $outputModalities = null; /** @@ -78633,15 +78633,15 @@ class ModelConfig extends \WordPress\AiClient\Common\AbstractDataTransferObject */ protected ?int $topLogprobs = null; /** - * @var list<\WordPress\AiClient\Tools\DTO\FunctionDeclaration>|null Function declarations available to the model. + * @var list|null Function declarations available to the model. */ protected ?array $functionDeclarations = null; /** - * @var \WordPress\AiClient\Tools\DTO\WebSearch|null Web search configuration for the model. + * @var WebSearch|null Web search configuration for the model. */ protected ?\WordPress\AiClient\Tools\DTO\WebSearch $webSearch = null; /** - * @var \WordPress\AiClient\Files\Enums\FileTypeEnum|null Output file type. + * @var FileTypeEnum|null Output file type. */ protected ?\WordPress\AiClient\Files\Enums\FileTypeEnum $outputFileType = null; /** @@ -78653,7 +78653,7 @@ class ModelConfig extends \WordPress\AiClient\Common\AbstractDataTransferObject */ protected ?array $outputSchema = null; /** - * @var \WordPress\AiClient\Files\Enums\MediaOrientationEnum|null Output media orientation. + * @var MediaOrientationEnum|null Output media orientation. */ protected ?\WordPress\AiClient\Files\Enums\MediaOrientationEnum $outputMediaOrientation = null; /** @@ -78686,9 +78686,9 @@ public function __clone() * * @since 0.1.0 * - * @param list<\WordPress\AiClient\Messages\Enums\ModalityEnum> $outputModalities The output modalities. + * @param list $outputModalities The output modalities. * - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the array is not a list. + * @throws InvalidArgumentException If the array is not a list. */ public function setOutputModalities(array $outputModalities): void { @@ -78698,7 +78698,7 @@ public function setOutputModalities(array $outputModalities): void * * @since 0.1.0 * - * @return list<\WordPress\AiClient\Messages\Enums\ModalityEnum>|null The output modalities. + * @return list|null The output modalities. */ public function getOutputModalities(): ?array { @@ -78830,7 +78830,7 @@ public function getTopK(): ?int * * @param list $stopSequences The stop sequences. * - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the array is not a list. + * @throws InvalidArgumentException If the array is not a list. */ public function setStopSequences(array $stopSequences): void { @@ -78930,9 +78930,9 @@ public function getTopLogprobs(): ?int * * @since 0.1.0 * - * @param list<\WordPress\AiClient\Tools\DTO\FunctionDeclaration> $functionDeclarations The function declarations. + * @param list $functionDeclarations The function declarations. * - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the array is not a list. + * @throws InvalidArgumentException If the array is not a list. */ public function setFunctionDeclarations(array $functionDeclarations): void { @@ -78942,7 +78942,7 @@ public function setFunctionDeclarations(array $functionDeclarations): void * * @since 0.1.0 * - * @return list<\WordPress\AiClient\Tools\DTO\FunctionDeclaration>|null The function declarations. + * @return list|null The function declarations. */ public function getFunctionDeclarations(): ?array { @@ -78952,7 +78952,7 @@ public function getFunctionDeclarations(): ?array * * @since 0.1.0 * - * @param \WordPress\AiClient\Tools\DTO\WebSearch $webSearch The web search configuration. + * @param WebSearch $webSearch The web search configuration. */ public function setWebSearch(\WordPress\AiClient\Tools\DTO\WebSearch $webSearch): void { @@ -78962,7 +78962,7 @@ public function setWebSearch(\WordPress\AiClient\Tools\DTO\WebSearch $webSearch) * * @since 0.1.0 * - * @return \WordPress\AiClient\Tools\DTO\WebSearch|null The web search configuration. + * @return WebSearch|null The web search configuration. */ public function getWebSearch(): ?\WordPress\AiClient\Tools\DTO\WebSearch { @@ -78972,7 +78972,7 @@ public function getWebSearch(): ?\WordPress\AiClient\Tools\DTO\WebSearch * * @since 0.1.0 * - * @param \WordPress\AiClient\Files\Enums\FileTypeEnum $outputFileType The output file type. + * @param FileTypeEnum $outputFileType The output file type. */ public function setOutputFileType(\WordPress\AiClient\Files\Enums\FileTypeEnum $outputFileType): void { @@ -78982,7 +78982,7 @@ public function setOutputFileType(\WordPress\AiClient\Files\Enums\FileTypeEnum $ * * @since 0.1.0 * - * @return \WordPress\AiClient\Files\Enums\FileTypeEnum|null The output file type. + * @return FileTypeEnum|null The output file type. */ public function getOutputFileType(): ?\WordPress\AiClient\Files\Enums\FileTypeEnum { @@ -79035,7 +79035,7 @@ public function getOutputSchema(): ?array * * @since 0.1.0 * - * @param \WordPress\AiClient\Files\Enums\MediaOrientationEnum $outputMediaOrientation The output media orientation. + * @param MediaOrientationEnum $outputMediaOrientation The output media orientation. */ public function setOutputMediaOrientation(\WordPress\AiClient\Files\Enums\MediaOrientationEnum $outputMediaOrientation): void { @@ -79045,7 +79045,7 @@ public function setOutputMediaOrientation(\WordPress\AiClient\Files\Enums\MediaO * * @since 0.1.0 * - * @return \WordPress\AiClient\Files\Enums\MediaOrientationEnum|null The output media orientation. + * @return MediaOrientationEnum|null The output media orientation. */ public function getOutputMediaOrientation(): ?\WordPress\AiClient\Files\Enums\MediaOrientationEnum { @@ -79077,7 +79077,7 @@ public function getOutputMediaAspectRatio(): ?string * * @since 0.4.0 * - * @param \WordPress\AiClient\Files\Enums\MediaOrientationEnum $orientation The desired media orientation. + * @param MediaOrientationEnum $orientation The desired media orientation. * @param string $aspectRatio The desired media aspect ratio. */ protected function validateMediaOrientationAspectRatioCompatibility(\WordPress\AiClient\Files\Enums\MediaOrientationEnum $orientation, string $aspectRatio): void @@ -79178,7 +79178,7 @@ public static function fromArray(array $array): self * supportedOptions: list * } * - * @extends \WordPress\AiClient\Common\AbstractDataTransferObject + * @extends AbstractDataTransferObject */ class ModelMetadata extends \WordPress\AiClient\Common\AbstractDataTransferObject { @@ -79195,7 +79195,7 @@ class ModelMetadata extends \WordPress\AiClient\Common\AbstractDataTransferObjec */ protected string $name; /** - * @var list<\WordPress\AiClient\Providers\Models\Enums\CapabilityEnum> The model's supported capabilities. + * @var list The model's supported capabilities. */ protected array $supportedCapabilities; /** @@ -79209,10 +79209,10 @@ class ModelMetadata extends \WordPress\AiClient\Common\AbstractDataTransferObjec * * @param string $id The model's unique identifier. * @param string $name The model's display name. - * @param list<\WordPress\AiClient\Providers\Models\Enums\CapabilityEnum> $supportedCapabilities The model's supported capabilities. + * @param list $supportedCapabilities The model's supported capabilities. * @param list $supportedOptions The model's supported configuration options. * - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If arrays are not lists. + * @throws InvalidArgumentException If arrays are not lists. */ public function __construct(string $id, string $name, array $supportedCapabilities, array $supportedOptions) { @@ -79242,7 +79242,7 @@ public function getName(): string * * @since 0.1.0 * - * @return list<\WordPress\AiClient\Providers\Models\Enums\CapabilityEnum> The supported capabilities. + * @return list The supported capabilities. */ public function getSupportedCapabilities(): array { @@ -79310,14 +79310,14 @@ public function __clone() * requiredOptions: list * } * - * @extends \WordPress\AiClient\Common\AbstractDataTransferObject + * @extends AbstractDataTransferObject */ class ModelRequirements extends \WordPress\AiClient\Common\AbstractDataTransferObject { public const KEY_REQUIRED_CAPABILITIES = 'requiredCapabilities'; public const KEY_REQUIRED_OPTIONS = 'requiredOptions'; /** - * @var list<\WordPress\AiClient\Providers\Models\Enums\CapabilityEnum> The capabilities that the model must support. + * @var list The capabilities that the model must support. */ protected array $requiredCapabilities; /** @@ -79329,10 +79329,10 @@ class ModelRequirements extends \WordPress\AiClient\Common\AbstractDataTransferO * * @since 0.1.0 * - * @param list<\WordPress\AiClient\Providers\Models\Enums\CapabilityEnum> $requiredCapabilities The capabilities that the model must support. + * @param list $requiredCapabilities The capabilities that the model must support. * @param list $requiredOptions The options that the model must support with specific values. * - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If arrays are not lists. + * @throws InvalidArgumentException If arrays are not lists. */ public function __construct(array $requiredCapabilities, array $requiredOptions) { @@ -79342,7 +79342,7 @@ public function __construct(array $requiredCapabilities, array $requiredOptions) * * @since 0.1.0 * - * @return list<\WordPress\AiClient\Providers\Models\Enums\CapabilityEnum> The required capabilities. + * @return list The required capabilities. */ public function getRequiredCapabilities(): array { @@ -79373,8 +79373,8 @@ public function areMetBy(\WordPress\AiClient\Providers\Models\DTO\ModelMetadata * * @since 0.2.0 * - * @param \WordPress\AiClient\Providers\Models\Enums\CapabilityEnum $capability The capability the model must support. - * @param list<\WordPress\AiClient\Messages\DTO\Message> $messages The messages in the conversation. + * @param CapabilityEnum $capability The capability the model must support. + * @param list $messages The messages in the conversation. * @param ModelConfig $modelConfig The model configuration. * @return self The created requirements. */ @@ -79421,14 +79421,14 @@ public static function fromArray(array $array): self * value: mixed * } * - * @extends \WordPress\AiClient\Common\AbstractDataTransferObject + * @extends AbstractDataTransferObject */ class RequiredOption extends \WordPress\AiClient\Common\AbstractDataTransferObject { public const KEY_NAME = 'name'; public const KEY_VALUE = 'value'; /** - * @var \WordPress\AiClient\Providers\Models\Enums\OptionEnum The option name. + * @var OptionEnum The option name. */ protected \WordPress\AiClient\Providers\Models\Enums\OptionEnum $name; /** @@ -79440,7 +79440,7 @@ class RequiredOption extends \WordPress\AiClient\Common\AbstractDataTransferObje * * @since 0.1.0 * - * @param \WordPress\AiClient\Providers\Models\Enums\OptionEnum $name The option name. + * @param OptionEnum $name The option name. * @param mixed $value The value that the model must support for this option. */ public function __construct(\WordPress\AiClient\Providers\Models\Enums\OptionEnum $name, $value) @@ -79451,7 +79451,7 @@ public function __construct(\WordPress\AiClient\Providers\Models\Enums\OptionEnu * * @since 0.1.0 * - * @return \WordPress\AiClient\Providers\Models\Enums\OptionEnum The option name. + * @return OptionEnum The option name. */ public function getName(): \WordPress\AiClient\Providers\Models\Enums\OptionEnum { @@ -79506,14 +79506,14 @@ public static function fromArray(array $array): self * supportedValues?: list * } * - * @extends \WordPress\AiClient\Common\AbstractDataTransferObject + * @extends AbstractDataTransferObject */ class SupportedOption extends \WordPress\AiClient\Common\AbstractDataTransferObject { public const KEY_NAME = 'name'; public const KEY_SUPPORTED_VALUES = 'supportedValues'; /** - * @var \WordPress\AiClient\Providers\Models\Enums\OptionEnum The option name. + * @var OptionEnum The option name. */ protected \WordPress\AiClient\Providers\Models\Enums\OptionEnum $name; /** @@ -79525,10 +79525,10 @@ class SupportedOption extends \WordPress\AiClient\Common\AbstractDataTransferObj * * @since 0.1.0 * - * @param \WordPress\AiClient\Providers\Models\Enums\OptionEnum $name The option name. + * @param OptionEnum $name The option name. * @param list|null $supportedValues The supported values for this option, or null if any value is supported. * - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If supportedValues is not null and not a list. + * @throws InvalidArgumentException If supportedValues is not null and not a list. */ public function __construct(\WordPress\AiClient\Providers\Models\Enums\OptionEnum $name, ?array $supportedValues = null) { @@ -79538,7 +79538,7 @@ public function __construct(\WordPress\AiClient\Providers\Models\Enums\OptionEnu * * @since 0.1.0 * - * @return \WordPress\AiClient\Providers\Models\Enums\OptionEnum The option name. + * @return OptionEnum The option name. */ public function getName(): \WordPress\AiClient\Providers\Models\Enums\OptionEnum { @@ -79747,8 +79747,8 @@ interface ImageGenerationModelInterface * * @since 0.1.0 * - * @param list<\WordPress\AiClient\Messages\DTO\Message> $prompt Array of messages containing the image generation prompt. - * @return \WordPress\AiClient\Results\DTO\GenerativeAiResult Result containing generated images. + * @param list $prompt Array of messages containing the image generation prompt. + * @return GenerativeAiResult Result containing generated images. */ public function generateImageResult(array $prompt): \WordPress\AiClient\Results\DTO\GenerativeAiResult; } @@ -79766,8 +79766,8 @@ interface ImageGenerationOperationModelInterface * * @since 0.1.0 * - * @param list<\WordPress\AiClient\Messages\DTO\Message> $prompt Array of messages containing the image generation prompt. - * @return \WordPress\AiClient\Operations\DTO\GenerativeAiOperation The initiated image generation operation. + * @param list $prompt Array of messages containing the image generation prompt. + * @return GenerativeAiOperation The initiated image generation operation. */ public function generateImageOperation(array $prompt): \WordPress\AiClient\Operations\DTO\GenerativeAiOperation; } @@ -79787,8 +79787,8 @@ interface SpeechGenerationModelInterface * * @since 0.1.0 * - * @param list<\WordPress\AiClient\Messages\DTO\Message> $prompt Array of messages containing the speech generation prompt. - * @return \WordPress\AiClient\Results\DTO\GenerativeAiResult Result containing generated speech audio. + * @param list $prompt Array of messages containing the speech generation prompt. + * @return GenerativeAiResult Result containing generated speech audio. */ public function generateSpeechResult(array $prompt): \WordPress\AiClient\Results\DTO\GenerativeAiResult; } @@ -79806,8 +79806,8 @@ interface SpeechGenerationOperationModelInterface * * @since 0.1.0 * - * @param list<\WordPress\AiClient\Messages\DTO\Message> $prompt Array of messages containing the speech generation prompt. - * @return \WordPress\AiClient\Operations\DTO\GenerativeAiOperation The initiated speech generation operation. + * @param list $prompt Array of messages containing the speech generation prompt. + * @return GenerativeAiOperation The initiated speech generation operation. */ public function generateSpeechOperation(array $prompt): \WordPress\AiClient\Operations\DTO\GenerativeAiOperation; } @@ -79827,8 +79827,8 @@ interface TextGenerationModelInterface * * @since 0.1.0 * - * @param list<\WordPress\AiClient\Messages\DTO\Message> $prompt Array of messages containing the text generation prompt. - * @return \WordPress\AiClient\Results\DTO\GenerativeAiResult Result containing generated text. + * @param list $prompt Array of messages containing the text generation prompt. + * @return GenerativeAiResult Result containing generated text. */ public function generateTextResult(array $prompt): \WordPress\AiClient\Results\DTO\GenerativeAiResult; } @@ -79846,8 +79846,8 @@ interface TextGenerationOperationModelInterface * * @since 0.1.0 * - * @param list<\WordPress\AiClient\Messages\DTO\Message> $prompt Array of messages containing the text generation prompt. - * @return \WordPress\AiClient\Operations\DTO\GenerativeAiOperation The initiated text generation operation. + * @param list $prompt Array of messages containing the text generation prompt. + * @return GenerativeAiOperation The initiated text generation operation. */ public function generateTextOperation(array $prompt): \WordPress\AiClient\Operations\DTO\GenerativeAiOperation; } @@ -79867,8 +79867,8 @@ interface TextToSpeechConversionModelInterface * * @since 0.1.0 * - * @param list<\WordPress\AiClient\Messages\DTO\Message> $prompt Array of messages containing the text to convert to speech. - * @return \WordPress\AiClient\Results\DTO\GenerativeAiResult Result containing generated speech audio. + * @param list $prompt Array of messages containing the text to convert to speech. + * @return GenerativeAiResult Result containing generated speech audio. */ public function convertTextToSpeechResult(array $prompt): \WordPress\AiClient\Results\DTO\GenerativeAiResult; } @@ -79886,8 +79886,8 @@ interface TextToSpeechConversionOperationModelInterface * * @since 0.1.0 * - * @param list<\WordPress\AiClient\Messages\DTO\Message> $prompt Array of messages containing the text to convert to speech. - * @return \WordPress\AiClient\Operations\DTO\GenerativeAiOperation The initiated text-to-speech conversion operation. + * @param list $prompt Array of messages containing the text to convert to speech. + * @return GenerativeAiOperation The initiated text-to-speech conversion operation. */ public function convertTextToSpeechOperation(array $prompt): \WordPress\AiClient\Operations\DTO\GenerativeAiOperation; } @@ -79907,8 +79907,8 @@ interface VideoGenerationModelInterface * * @since 1.3.0 * - * @param list<\WordPress\AiClient\Messages\DTO\Message> $prompt Array of messages containing the video generation prompt. - * @return \WordPress\AiClient\Results\DTO\GenerativeAiResult Result containing generated videos. + * @param list $prompt Array of messages containing the video generation prompt. + * @return GenerativeAiResult Result containing generated videos. */ public function generateVideoResult(array $prompt): \WordPress\AiClient\Results\DTO\GenerativeAiResult; } @@ -79926,8 +79926,8 @@ interface VideoGenerationOperationModelInterface * * @since 1.3.0 * - * @param list<\WordPress\AiClient\Messages\DTO\Message> $prompt Array of messages containing the video generation prompt. - * @return \WordPress\AiClient\Operations\DTO\GenerativeAiOperation The initiated video generation operation. + * @param list $prompt Array of messages containing the video generation prompt. + * @return GenerativeAiOperation The initiated video generation operation. */ public function generateVideoOperation(array $prompt): \WordPress\AiClient\Operations\DTO\GenerativeAiOperation; } @@ -79981,7 +79981,7 @@ public function generateImageResult(array $prompt): \WordPress\AiClient\Results\ * * @since 0.1.0 * - * @param list<\WordPress\AiClient\Messages\DTO\Message> $prompt The prompt to generate an image for. Either a single message or a list of messages + * @param list $prompt The prompt to generate an image for. Either a single message or a list of messages * from a chat. However as of today, OpenAI compatible image generation endpoints only * support a single user message. * @return ImageGenerationParams The parameters for the API request. @@ -79994,7 +79994,7 @@ protected function prepareGenerateImageParams(array $prompt): array * * @since 0.1.0 * - * @param list<\WordPress\AiClient\Messages\DTO\Message> $messages The messages to prepare. However as of today, OpenAI compatible image generation + * @param list $messages The messages to prepare. However as of today, OpenAI compatible image generation * endpoints only support a single user message. * @return string The prepared prompt parameter. */ @@ -80006,7 +80006,7 @@ protected function preparePromptParam(array $messages): string * * @since 0.1.0 * - * @param \WordPress\AiClient\Files\Enums\MediaOrientationEnum|null $orientation The desired media orientation. + * @param MediaOrientationEnum|null $orientation The desired media orientation. * @param string|null $aspectRatio The desired media aspect ratio. * @return string The prepared size parameter. */ @@ -80021,11 +80021,11 @@ protected function prepareSizeParam(?\WordPress\AiClient\Files\Enums\MediaOrient * * @since 0.1.0 * - * @param \WordPress\AiClient\Providers\Http\Enums\HttpMethodEnum $method The HTTP method. + * @param HttpMethodEnum $method The HTTP method. * @param string $path The API endpoint path, relative to the base URI. * @param array> $headers The request headers. * @param string|array|null $data The request data. - * @return \WordPress\AiClient\Providers\Http\DTO\Request The request object. + * @return Request The request object. */ abstract protected function createRequest(\WordPress\AiClient\Providers\Http\Enums\HttpMethodEnum $method, string $path, array $headers = [], $data = null): \WordPress\AiClient\Providers\Http\DTO\Request; /** @@ -80033,8 +80033,8 @@ abstract protected function createRequest(\WordPress\AiClient\Providers\Http\Enu * * @since 0.1.0 * - * @param \WordPress\AiClient\Providers\Http\DTO\Response $response The HTTP response to check. - * @throws \WordPress\AiClient\Providers\Http\Exception\ResponseException If the response is not successful. + * @param Response $response The HTTP response to check. + * @throws ResponseException If the response is not successful. */ protected function throwIfNotSuccessful(\WordPress\AiClient\Providers\Http\DTO\Response $response): void { @@ -80044,9 +80044,9 @@ protected function throwIfNotSuccessful(\WordPress\AiClient\Providers\Http\DTO\R * * @since 0.1.0 * - * @param \WordPress\AiClient\Providers\Http\DTO\Response $response The response from the API endpoint. + * @param Response $response The response from the API endpoint. * @param string $expectedMimeType The expected MIME type the response is in. - * @return \WordPress\AiClient\Results\DTO\GenerativeAiResult The parsed generative AI result. + * @return GenerativeAiResult The parsed generative AI result. */ protected function parseResponseToGenerativeAiResult(\WordPress\AiClient\Providers\Http\DTO\Response $response, string $expectedMimeType = 'image/png'): \WordPress\AiClient\Results\DTO\GenerativeAiResult { @@ -80059,8 +80059,8 @@ protected function parseResponseToGenerativeAiResult(\WordPress\AiClient\Provide * @param ChoiceData $choiceData The choice data from the API response. * @param int $index The index of the choice in the choices array. * @param string $expectedMimeType The expected MIME type the response is in. - * @return \WordPress\AiClient\Results\DTO\Candidate The parsed candidate. - * @throws \WordPress\AiClient\Common\Exception\RuntimeException If the choice data is invalid. + * @return Candidate The parsed candidate. + * @throws RuntimeException If the choice data is invalid. */ protected function parseResponseChoiceToCandidate(array $choiceData, int $index, string $expectedMimeType = 'image/png'): \WordPress\AiClient\Results\DTO\Candidate { @@ -80101,11 +80101,11 @@ protected function sendListModelsRequest(): array * * @since 0.1.0 * - * @param \WordPress\AiClient\Providers\Http\Enums\HttpMethodEnum $method The HTTP method. + * @param HttpMethodEnum $method The HTTP method. * @param string $path The API endpoint path, relative to the base URI. * @param array> $headers The request headers. * @param string|array|null $data The request data. - * @return \WordPress\AiClient\Providers\Http\DTO\Request The request object. + * @return Request The request object. */ abstract protected function createRequest(\WordPress\AiClient\Providers\Http\Enums\HttpMethodEnum $method, string $path, array $headers = [], $data = null): \WordPress\AiClient\Providers\Http\DTO\Request; /** @@ -80113,8 +80113,8 @@ abstract protected function createRequest(\WordPress\AiClient\Providers\Http\Enu * * @since 0.1.0 * - * @param \WordPress\AiClient\Providers\Http\DTO\Response $response The HTTP response to check. - * @throws \WordPress\AiClient\Providers\Http\Exception\ResponseException If the response is not successful. + * @param Response $response The HTTP response to check. + * @throws ResponseException If the response is not successful. */ protected function throwIfNotSuccessful(\WordPress\AiClient\Providers\Http\DTO\Response $response): void { @@ -80124,8 +80124,8 @@ protected function throwIfNotSuccessful(\WordPress\AiClient\Providers\Http\DTO\R * * @since 0.1.0 * - * @param \WordPress\AiClient\Providers\Http\DTO\Response $response The response from the API endpoint to list models. - * @return list<\WordPress\AiClient\Providers\Models\DTO\ModelMetadata> List of model metadata objects. + * @param Response $response The response from the API endpoint to list models. + * @return list List of model metadata objects. */ abstract protected function parseResponseToModelMetadataList(\WordPress\AiClient\Providers\Http\DTO\Response $response): array; } @@ -80182,7 +80182,7 @@ final public function generateTextResult(array $prompt): \WordPress\AiClient\Res * * @since 0.1.0 * - * @param list<\WordPress\AiClient\Messages\DTO\Message> $prompt The prompt to generate text for. Either a single message or a list of messages + * @param list $prompt The prompt to generate text for. Either a single message or a list of messages * from a chat. * @return array The parameters for the API request. */ @@ -80194,7 +80194,7 @@ protected function prepareGenerateTextParams(array $prompt): array * * @since 0.1.0 * - * @param list<\WordPress\AiClient\Messages\DTO\Message> $messages The messages to prepare. + * @param list $messages The messages to prepare. * @param string|null $systemInstruction An optional system instruction to prepend to the messages. * @return list> The prepared messages parameter. */ @@ -80206,7 +80206,7 @@ protected function prepareMessagesParam(array $messages, ?string $systemInstruct * * @since 0.1.0 * - * @param \WordPress\AiClient\Messages\Enums\MessageRoleEnum $role The message role. + * @param MessageRoleEnum $role The message role. * @return string The role for the API request. */ protected function getMessageRoleString(\WordPress\AiClient\Messages\Enums\MessageRoleEnum $role): string @@ -80217,9 +80217,9 @@ protected function getMessageRoleString(\WordPress\AiClient\Messages\Enums\Messa * * @since 0.1.0 * - * @param \WordPress\AiClient\Messages\DTO\MessagePart $part The message part to get the data for. + * @param MessagePart $part The message part to get the data for. * @return ?array The data for the message content part, or null if not applicable. - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the message part type or data is unsupported. + * @throws InvalidArgumentException If the message part type or data is unsupported. */ protected function getMessagePartContentData(\WordPress\AiClient\Messages\DTO\MessagePart $part): ?array { @@ -80229,9 +80229,9 @@ protected function getMessagePartContentData(\WordPress\AiClient\Messages\DTO\Me * * @since 0.1.0 * - * @param \WordPress\AiClient\Messages\DTO\MessagePart $part The message part to get the data for. + * @param MessagePart $part The message part to get the data for. * @return ?array The data for the message tool call part, or null if not applicable. - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the message part type or data is unsupported. + * @throws InvalidArgumentException If the message part type or data is unsupported. */ protected function getMessagePartToolCallData(\WordPress\AiClient\Messages\DTO\MessagePart $part): ?array { @@ -80241,8 +80241,8 @@ protected function getMessagePartToolCallData(\WordPress\AiClient\Messages\DTO\M * * @since 0.1.0 * - * @param array<\WordPress\AiClient\Messages\Enums\ModalityEnum> $outputModalities The output modalities to validate. - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If no text output modality is present. + * @param array $outputModalities The output modalities to validate. + * @throws InvalidArgumentException If no text output modality is present. */ protected function validateOutputModalities(array $outputModalities): void { @@ -80252,7 +80252,7 @@ protected function validateOutputModalities(array $outputModalities): void * * @since 0.1.0 * - * @param array<\WordPress\AiClient\Messages\Enums\ModalityEnum> $modalities The modalities to prepare. + * @param array $modalities The modalities to prepare. * @return list The prepared modalities parameter. */ protected function prepareOutputModalitiesParam(array $modalities): array @@ -80263,7 +80263,7 @@ protected function prepareOutputModalitiesParam(array $modalities): array * * @since 0.1.0 * - * @param list<\WordPress\AiClient\Tools\DTO\FunctionDeclaration> $functionDeclarations The function declarations. + * @param list $functionDeclarations The function declarations. * @return list> The prepared tools parameter. */ protected function prepareToolsParam(array $functionDeclarations): array @@ -80290,11 +80290,11 @@ protected function prepareResponseFormatParam(?array $outputSchema): array * * @since 0.1.0 * - * @param \WordPress\AiClient\Providers\Http\Enums\HttpMethodEnum $method The HTTP method. + * @param HttpMethodEnum $method The HTTP method. * @param string $path The API endpoint path, relative to the base URI. * @param array> $headers The request headers. * @param string|array|null $data The request data. - * @return \WordPress\AiClient\Providers\Http\DTO\Request The request object. + * @return Request The request object. */ abstract protected function createRequest(\WordPress\AiClient\Providers\Http\Enums\HttpMethodEnum $method, string $path, array $headers = [], $data = null): \WordPress\AiClient\Providers\Http\DTO\Request; /** @@ -80302,8 +80302,8 @@ abstract protected function createRequest(\WordPress\AiClient\Providers\Http\Enu * * @since 0.1.0 * - * @param \WordPress\AiClient\Providers\Http\DTO\Response $response The HTTP response to check. - * @throws \WordPress\AiClient\Providers\Http\Exception\ResponseException If the response is not successful. + * @param Response $response The HTTP response to check. + * @throws ResponseException If the response is not successful. */ protected function throwIfNotSuccessful(\WordPress\AiClient\Providers\Http\DTO\Response $response): void { @@ -80313,8 +80313,8 @@ protected function throwIfNotSuccessful(\WordPress\AiClient\Providers\Http\DTO\R * * @since 0.1.0 * - * @param \WordPress\AiClient\Providers\Http\DTO\Response $response The response from the API endpoint. - * @return \WordPress\AiClient\Results\DTO\GenerativeAiResult The parsed generative AI result. + * @param Response $response The response from the API endpoint. + * @return GenerativeAiResult The parsed generative AI result. */ protected function parseResponseToGenerativeAiResult(\WordPress\AiClient\Providers\Http\DTO\Response $response): \WordPress\AiClient\Results\DTO\GenerativeAiResult { @@ -80326,8 +80326,8 @@ protected function parseResponseToGenerativeAiResult(\WordPress\AiClient\Provide * * @param ChoiceData $choiceData The choice data from the API response. * @param int $index The index of the choice in the choices array. - * @return \WordPress\AiClient\Results\DTO\Candidate The parsed candidate. - * @throws \WordPress\AiClient\Common\Exception\RuntimeException If the choice data is invalid. + * @return Candidate The parsed candidate. + * @throws RuntimeException If the choice data is invalid. */ protected function parseResponseChoiceToCandidate(array $choiceData, int $index): \WordPress\AiClient\Results\DTO\Candidate { @@ -80339,7 +80339,7 @@ protected function parseResponseChoiceToCandidate(array $choiceData, int $index) * * @param MessageData $messageData The message data from the API response. * @param int $index The index of the choice in the choices array. - * @return \WordPress\AiClient\Messages\DTO\Message The parsed message. + * @return Message The parsed message. */ protected function parseResponseChoiceMessage(array $messageData, int $index): \WordPress\AiClient\Messages\DTO\Message { @@ -80351,7 +80351,7 @@ protected function parseResponseChoiceMessage(array $messageData, int $index): \ * * @param MessageData $messageData The message data from the API response. * @param int $index The index of the choice in the choices array. - * @return \WordPress\AiClient\Messages\DTO\MessagePart[] The parsed message parts. + * @return MessagePart[] The parsed message parts. */ protected function parseResponseChoiceMessageParts(array $messageData, int $index): array { @@ -80362,7 +80362,7 @@ protected function parseResponseChoiceMessageParts(array $messageData, int $inde * @since 0.1.0 * * @param ToolCallData $toolCallData The tool call data from the API response. - * @return \WordPress\AiClient\Messages\DTO\MessagePart|null The parsed message part for the tool call, or null if not applicable. + * @return MessagePart|null The parsed message part for the tool call, or null if not applicable. */ protected function parseResponseChoiceMessageToolCallPart(array $toolCallData): ?\WordPress\AiClient\Messages\DTO\MessagePart { @@ -80388,9 +80388,9 @@ class ProviderRegistry implements \WordPress\AiClient\Providers\Http\Contracts\W * * @since 0.1.0 * - * @param class-string<\WordPress\AiClient\Providers\Contracts\ProviderInterface> $className The fully qualified provider class name implementing the + * @param class-string $className The fully qualified provider class name implementing the * ProviderInterface - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the class doesn't exist or implement the required interface. + * @throws InvalidArgumentException If the class doesn't exist or implement the required interface. */ public function registerProvider(string $className): void { @@ -80410,7 +80410,7 @@ public function getRegisteredProviderIds(): array * * @since 0.1.0 * - * @param string|class-string<\WordPress\AiClient\Providers\Contracts\ProviderInterface> $idOrClassName The provider ID or class name to check. + * @param string|class-string $idOrClassName The provider ID or class name to check. * @return bool True if the provider is registered. */ public function hasProvider(string $idOrClassName): bool @@ -80421,9 +80421,9 @@ public function hasProvider(string $idOrClassName): bool * * @since 0.1.0 * - * @param string|class-string<\WordPress\AiClient\Providers\Contracts\ProviderInterface> $idOrClassName The provider ID or class name. - * @return class-string<\WordPress\AiClient\Providers\Contracts\ProviderInterface> The provider class name. - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the provider is not registered. + * @param string|class-string $idOrClassName The provider ID or class name. + * @return class-string The provider class name. + * @throws InvalidArgumentException If the provider is not registered. */ public function getProviderClassName(string $idOrClassName): string { @@ -80433,9 +80433,9 @@ public function getProviderClassName(string $idOrClassName): string * * @since 0.2.0 * - * @param string|class-string<\WordPress\AiClient\Providers\Contracts\ProviderInterface> $idOrClassName The provider ID or class name. + * @param string|class-string $idOrClassName The provider ID or class name. * @return string The provider ID. - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the provider is not registered. + * @throws InvalidArgumentException If the provider is not registered. */ public function getProviderId(string $idOrClassName): string { @@ -80445,7 +80445,7 @@ public function getProviderId(string $idOrClassName): string * * @since 0.1.0 * - * @param string|class-string<\WordPress\AiClient\Providers\Contracts\ProviderInterface> $idOrClassName The provider ID or class name. + * @param string|class-string $idOrClassName The provider ID or class name. * @return bool True if the provider is configured and ready to use. */ public function isProviderConfigured(string $idOrClassName): bool @@ -80456,8 +80456,8 @@ public function isProviderConfigured(string $idOrClassName): bool * * @since 0.1.0 * - * @param \WordPress\AiClient\Providers\Models\DTO\ModelRequirements $modelRequirements The requirements to match against. - * @return list<\WordPress\AiClient\Providers\DTO\ProviderModelsMetadata> List of provider models metadata that match requirements. + * @param ModelRequirements $modelRequirements The requirements to match against. + * @return list List of provider models metadata that match requirements. */ public function findModelsMetadataForSupport(\WordPress\AiClient\Providers\Models\DTO\ModelRequirements $modelRequirements): array { @@ -80468,8 +80468,8 @@ public function findModelsMetadataForSupport(\WordPress\AiClient\Providers\Model * @since 0.1.0 * * @param string $idOrClassName The provider ID or class name. - * @param \WordPress\AiClient\Providers\Models\DTO\ModelRequirements $modelRequirements The requirements to match against. - * @return list<\WordPress\AiClient\Providers\Models\DTO\ModelMetadata> List of model metadata that match requirements. + * @param ModelRequirements $modelRequirements The requirements to match against. + * @return list List of model metadata that match requirements. */ public function findProviderModelsMetadataForSupport(string $idOrClassName, \WordPress\AiClient\Providers\Models\DTO\ModelRequirements $modelRequirements): array { @@ -80479,11 +80479,11 @@ public function findProviderModelsMetadataForSupport(string $idOrClassName, \Wor * * @since 0.1.0 * - * @param string|class-string<\WordPress\AiClient\Providers\Contracts\ProviderInterface> $idOrClassName The provider ID or class name. + * @param string|class-string $idOrClassName The provider ID or class name. * @param string $modelId The model identifier. - * @param \WordPress\AiClient\Providers\Models\DTO\ModelConfig|null $modelConfig The model configuration. - * @return \WordPress\AiClient\Providers\Models\Contracts\ModelInterface The configured model instance. - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If provider or model is not found. + * @param ModelConfig|null $modelConfig The model configuration. + * @return ModelInterface The configured model instance. + * @throws InvalidArgumentException If provider or model is not found. */ public function getProviderModel(string $idOrClassName, string $modelId, ?\WordPress\AiClient\Providers\Models\DTO\ModelConfig $modelConfig = null): \WordPress\AiClient\Providers\Models\Contracts\ModelInterface { @@ -80496,7 +80496,7 @@ public function getProviderModel(string $idOrClassName, string $modelId, ?\WordP * * @since 0.1.0 * - * @param \WordPress\AiClient\Providers\Models\Contracts\ModelInterface $modelInstance The model instance to bind dependencies to. + * @param ModelInterface $modelInstance The model instance to bind dependencies to. * @return void */ public function bindModelDependencies(\WordPress\AiClient\Providers\Models\Contracts\ModelInterface $modelInstance): void @@ -80515,8 +80515,8 @@ public function setHttpTransporter(\WordPress\AiClient\Providers\Http\Contracts\ * * @since 0.1.0 * - * @param string|class-string<\WordPress\AiClient\Providers\Contracts\ProviderInterface> $idOrClassName The provider ID or class name. - * @param \WordPress\AiClient\Providers\Http\Contracts\RequestAuthenticationInterface $requestAuthentication The request authentication instance. + * @param string|class-string $idOrClassName The provider ID or class name. + * @param RequestAuthenticationInterface $requestAuthentication The request authentication instance. */ public function setProviderRequestAuthentication(string $idOrClassName, \WordPress\AiClient\Providers\Http\Contracts\RequestAuthenticationInterface $requestAuthentication): void { @@ -80526,8 +80526,8 @@ public function setProviderRequestAuthentication(string $idOrClassName, \WordPre * * @since 0.1.0 * - * @param string|class-string<\WordPress\AiClient\Providers\Contracts\ProviderInterface> $idOrClassName The provider ID or class name. - * @return ?\WordPress\AiClient\Providers\Http\Contracts\RequestAuthenticationInterface The request authentication instance, or null if not set. + * @param string|class-string $idOrClassName The provider ID or class name. + * @return ?RequestAuthenticationInterface The request authentication instance, or null if not set. */ public function getProviderRequestAuthentication(string $idOrClassName): ?\WordPress\AiClient\Providers\Http\Contracts\RequestAuthenticationInterface { @@ -80558,7 +80558,7 @@ public function getId(): string; * * @since 0.1.0 * - * @return \WordPress\AiClient\Results\DTO\TokenUsage Token usage statistics. + * @return TokenUsage Token usage statistics. */ public function getTokenUsage(): \WordPress\AiClient\Results\DTO\TokenUsage; /** @@ -80566,7 +80566,7 @@ public function getTokenUsage(): \WordPress\AiClient\Results\DTO\TokenUsage; * * @since 0.1.0 * - * @return \WordPress\AiClient\Providers\DTO\ProviderMetadata The provider metadata. + * @return ProviderMetadata The provider metadata. */ public function getProviderMetadata(): \WordPress\AiClient\Providers\DTO\ProviderMetadata; /** @@ -80574,7 +80574,7 @@ public function getProviderMetadata(): \WordPress\AiClient\Providers\DTO\Provide * * @since 0.1.0 * - * @return \WordPress\AiClient\Providers\Models\DTO\ModelMetadata The model metadata. + * @return ModelMetadata The model metadata. */ public function getModelMetadata(): \WordPress\AiClient\Providers\Models\DTO\ModelMetadata; /** @@ -80596,11 +80596,11 @@ public function getAdditionalData(): array; * * @since 0.1.0 * - * @phpstan-import-type MessageArrayShape from \WordPress\AiClient\Messages\DTO\Message + * @phpstan-import-type MessageArrayShape from Message * * @phpstan-type CandidateArrayShape array{message: MessageArrayShape, finishReason: string} * - * @extends \WordPress\AiClient\Common\AbstractDataTransferObject + * @extends AbstractDataTransferObject */ class Candidate extends \WordPress\AiClient\Common\AbstractDataTransferObject { @@ -80611,8 +80611,8 @@ class Candidate extends \WordPress\AiClient\Common\AbstractDataTransferObject * * @since 0.1.0 * - * @param \WordPress\AiClient\Messages\DTO\Message $message The generated message. - * @param \WordPress\AiClient\Results\Enums\FinishReasonEnum $finishReason The reason generation stopped. + * @param Message $message The generated message. + * @param FinishReasonEnum $finishReason The reason generation stopped. */ public function __construct(\WordPress\AiClient\Messages\DTO\Message $message, \WordPress\AiClient\Results\Enums\FinishReasonEnum $finishReason) { @@ -80622,7 +80622,7 @@ public function __construct(\WordPress\AiClient\Messages\DTO\Message $message, \ * * @since 0.1.0 * - * @return \WordPress\AiClient\Messages\DTO\Message The message. + * @return Message The message. */ public function getMessage(): \WordPress\AiClient\Messages\DTO\Message { @@ -80632,7 +80632,7 @@ public function getMessage(): \WordPress\AiClient\Messages\DTO\Message * * @since 0.1.0 * - * @return \WordPress\AiClient\Results\Enums\FinishReasonEnum The finish reason. + * @return FinishReasonEnum The finish reason. */ public function getFinishReason(): \WordPress\AiClient\Results\Enums\FinishReasonEnum { @@ -80685,8 +80685,8 @@ public function __clone() * * @phpstan-import-type CandidateArrayShape from Candidate * @phpstan-import-type TokenUsageArrayShape from TokenUsage - * @phpstan-import-type ProviderMetadataArrayShape from \WordPress\AiClient\Providers\DTO\ProviderMetadata - * @phpstan-import-type ModelMetadataArrayShape from \WordPress\AiClient\Providers\Models\DTO\ModelMetadata + * @phpstan-import-type ProviderMetadataArrayShape from ProviderMetadata + * @phpstan-import-type ModelMetadataArrayShape from ModelMetadata * * @phpstan-type GenerativeAiResultArrayShape array{ * id: string, @@ -80697,7 +80697,7 @@ public function __clone() * additionalData?: array * } * - * @extends \WordPress\AiClient\Common\AbstractDataTransferObject + * @extends AbstractDataTransferObject */ class GenerativeAiResult extends \WordPress\AiClient\Common\AbstractDataTransferObject implements \WordPress\AiClient\Results\Contracts\ResultInterface { @@ -80715,10 +80715,10 @@ class GenerativeAiResult extends \WordPress\AiClient\Common\AbstractDataTransfer * @param string $id Unique identifier for this result. * @param Candidate[] $candidates The generated candidates. * @param TokenUsage $tokenUsage Token usage statistics. - * @param \WordPress\AiClient\Providers\DTO\ProviderMetadata $providerMetadata Provider metadata. - * @param \WordPress\AiClient\Providers\Models\DTO\ModelMetadata $modelMetadata Model metadata. + * @param ProviderMetadata $providerMetadata Provider metadata. + * @param ModelMetadata $modelMetadata Model metadata. * @param array $additionalData Additional data. - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If no candidates provided. + * @throws InvalidArgumentException If no candidates provided. */ public function __construct(string $id, array $candidates, \WordPress\AiClient\Results\DTO\TokenUsage $tokenUsage, \WordPress\AiClient\Providers\DTO\ProviderMetadata $providerMetadata, \WordPress\AiClient\Providers\Models\DTO\ModelMetadata $modelMetadata, array $additionalData = []) { @@ -80754,7 +80754,7 @@ public function getTokenUsage(): \WordPress\AiClient\Results\DTO\TokenUsage * * @since 0.1.0 * - * @return \WordPress\AiClient\Providers\DTO\ProviderMetadata The provider metadata. + * @return ProviderMetadata The provider metadata. */ public function getProviderMetadata(): \WordPress\AiClient\Providers\DTO\ProviderMetadata { @@ -80764,7 +80764,7 @@ public function getProviderMetadata(): \WordPress\AiClient\Providers\DTO\Provide * * @since 0.1.0 * - * @return \WordPress\AiClient\Providers\Models\DTO\ModelMetadata The model metadata. + * @return ModelMetadata The model metadata. */ public function getModelMetadata(): \WordPress\AiClient\Providers\Models\DTO\ModelMetadata { @@ -80805,7 +80805,7 @@ public function hasMultipleCandidates(): bool * @since 0.1.0 * * @return string The text content. - * @throws \WordPress\AiClient\Common\Exception\RuntimeException If no text content. + * @throws RuntimeException If no text content. */ public function toText(): string { @@ -80817,8 +80817,8 @@ public function toText(): string * * @since 0.1.0 * - * @return \WordPress\AiClient\Files\DTO\File The file. - * @throws \WordPress\AiClient\Common\Exception\RuntimeException If no file content. + * @return File The file. + * @throws RuntimeException If no file content. */ public function toFile(): \WordPress\AiClient\Files\DTO\File { @@ -80828,8 +80828,8 @@ public function toFile(): \WordPress\AiClient\Files\DTO\File * * @since 0.1.0 * - * @return \WordPress\AiClient\Files\DTO\File The image file. - * @throws \WordPress\AiClient\Common\Exception\RuntimeException If no image content. + * @return File The image file. + * @throws RuntimeException If no image content. */ public function toImageFile(): \WordPress\AiClient\Files\DTO\File { @@ -80839,8 +80839,8 @@ public function toImageFile(): \WordPress\AiClient\Files\DTO\File * * @since 0.1.0 * - * @return \WordPress\AiClient\Files\DTO\File The audio file. - * @throws \WordPress\AiClient\Common\Exception\RuntimeException If no audio content. + * @return File The audio file. + * @throws RuntimeException If no audio content. */ public function toAudioFile(): \WordPress\AiClient\Files\DTO\File { @@ -80850,8 +80850,8 @@ public function toAudioFile(): \WordPress\AiClient\Files\DTO\File * * @since 0.1.0 * - * @return \WordPress\AiClient\Files\DTO\File The video file. - * @throws \WordPress\AiClient\Common\Exception\RuntimeException If no video content. + * @return File The video file. + * @throws RuntimeException If no video content. */ public function toVideoFile(): \WordPress\AiClient\Files\DTO\File { @@ -80861,7 +80861,7 @@ public function toVideoFile(): \WordPress\AiClient\Files\DTO\File * * @since 0.1.0 * - * @return \WordPress\AiClient\Messages\DTO\Message The message. + * @return Message The message. */ public function toMessage(): \WordPress\AiClient\Messages\DTO\Message { @@ -80881,7 +80881,7 @@ public function toTexts(): array * * @since 0.1.0 * - * @return list<\WordPress\AiClient\Files\DTO\File> Array of files. + * @return list Array of files. */ public function toFiles(): array { @@ -80891,7 +80891,7 @@ public function toFiles(): array * * @since 0.1.0 * - * @return list<\WordPress\AiClient\Files\DTO\File> Array of image files. + * @return list Array of image files. */ public function toImageFiles(): array { @@ -80901,7 +80901,7 @@ public function toImageFiles(): array * * @since 0.1.0 * - * @return list<\WordPress\AiClient\Files\DTO\File> Array of audio files. + * @return list Array of audio files. */ public function toAudioFiles(): array { @@ -80911,7 +80911,7 @@ public function toAudioFiles(): array * * @since 0.1.0 * - * @return list<\WordPress\AiClient\Files\DTO\File> Array of video files. + * @return list Array of video files. */ public function toVideoFiles(): array { @@ -80921,7 +80921,7 @@ public function toVideoFiles(): array * * @since 0.1.0 * - * @return list<\WordPress\AiClient\Messages\DTO\Message> Array of messages. + * @return list Array of messages. */ public function toMessages(): array { @@ -80982,7 +80982,7 @@ public function __clone() * thoughtTokens?: int * } * - * @extends \WordPress\AiClient\Common\AbstractDataTransferObject + * @extends AbstractDataTransferObject */ class TokenUsage extends \WordPress\AiClient\Common\AbstractDataTransferObject { @@ -81123,7 +81123,7 @@ class FinishReasonEnum extends \WordPress\AiClient\Common\AbstractEnum * * @phpstan-type FunctionCallArrayShape array{id?: string, name?: string, args?: mixed} * - * @extends \WordPress\AiClient\Common\AbstractDataTransferObject + * @extends AbstractDataTransferObject */ class FunctionCall extends \WordPress\AiClient\Common\AbstractDataTransferObject { @@ -81138,7 +81138,7 @@ class FunctionCall extends \WordPress\AiClient\Common\AbstractDataTransferObject * @param string|null $id Unique identifier for this function call. * @param string|null $name The name of the function to call. * @param mixed $args The arguments to pass to the function. - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If neither id nor name is provided. + * @throws InvalidArgumentException If neither id nor name is provided. */ public function __construct(?string $id = null, ?string $name = null, $args = null) { @@ -81214,7 +81214,7 @@ public static function fromArray(array $array): self * parameters?: array * } * - * @extends \WordPress\AiClient\Common\AbstractDataTransferObject + * @extends AbstractDataTransferObject */ class FunctionDeclaration extends \WordPress\AiClient\Common\AbstractDataTransferObject { @@ -81300,7 +81300,7 @@ public static function fromArray(array $array): self * * @phpstan-type FunctionResponseArrayShape array{id?: string, name?: string, response: mixed} * - * @extends \WordPress\AiClient\Common\AbstractDataTransferObject + * @extends AbstractDataTransferObject */ class FunctionResponse extends \WordPress\AiClient\Common\AbstractDataTransferObject { @@ -81315,7 +81315,7 @@ class FunctionResponse extends \WordPress\AiClient\Common\AbstractDataTransferOb * @param string|null $id The ID of the function call this is responding to. * @param string|null $name The name of the function that was called. * @param mixed $response The response data from the function. - * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If neither id nor name is provided. + * @throws InvalidArgumentException If neither id nor name is provided. */ public function __construct(?string $id, ?string $name, $response) { @@ -81387,7 +81387,7 @@ public static function fromArray(array $array): self * * @phpstan-type WebSearchArrayShape array{allowedDomains?: string[], disallowedDomains?: string[]} * - * @extends \WordPress\AiClient\Common\AbstractDataTransferObject + * @extends AbstractDataTransferObject */ class WebSearch extends \WordPress\AiClient\Common\AbstractDataTransferObject { @@ -81469,7 +81469,7 @@ abstract class ClassDiscovery * * @return string|\Closure * - * @throws \WordPress\AiClientDependencies\Http\Discovery\Exception\DiscoveryFailedException + * @throws DiscoveryFailedException */ protected static function findOneByType($type) { @@ -81524,7 +81524,7 @@ protected static function evaluateCondition($condition) * * @return object * - * @throws \WordPress\AiClientDependencies\Http\Discovery\Exception\ClassInstantiationFailedException + * @throws ClassInstantiationFailedException */ protected static function instantiateClass($class) { @@ -81640,57 +81640,57 @@ final class PuliUnavailableException extends \WordPress\AiClientDependencies\Htt final class Psr17FactoryDiscovery extends \WordPress\AiClientDependencies\Http\Discovery\ClassDiscovery { /** - * @return \WordPress\AiClientDependencies\Psr\Http\Message\RequestFactoryInterface + * @return RequestFactoryInterface * - * @throws \WordPress\AiClientDependencies\Http\Discovery\Exception\NotFoundException + * @throws RealNotFoundException */ public static function findRequestFactory() { } /** - * @return \WordPress\AiClientDependencies\Psr\Http\Message\ResponseFactoryInterface + * @return ResponseFactoryInterface * - * @throws \WordPress\AiClientDependencies\Http\Discovery\Exception\NotFoundException + * @throws RealNotFoundException */ public static function findResponseFactory() { } /** - * @return \WordPress\AiClientDependencies\Psr\Http\Message\ServerRequestFactoryInterface + * @return ServerRequestFactoryInterface * - * @throws \WordPress\AiClientDependencies\Http\Discovery\Exception\NotFoundException + * @throws RealNotFoundException */ public static function findServerRequestFactory() { } /** - * @return \WordPress\AiClientDependencies\Psr\Http\Message\StreamFactoryInterface + * @return StreamFactoryInterface * - * @throws \WordPress\AiClientDependencies\Http\Discovery\Exception\NotFoundException + * @throws RealNotFoundException */ public static function findStreamFactory() { } /** - * @return \WordPress\AiClientDependencies\Psr\Http\Message\UploadedFileFactoryInterface + * @return UploadedFileFactoryInterface * - * @throws \WordPress\AiClientDependencies\Http\Discovery\Exception\NotFoundException + * @throws RealNotFoundException */ public static function findUploadedFileFactory() { } /** - * @return \WordPress\AiClientDependencies\Psr\Http\Message\UriFactoryInterface + * @return UriFactoryInterface * - * @throws \WordPress\AiClientDependencies\Http\Discovery\Exception\NotFoundException + * @throws RealNotFoundException */ public static function findUriFactory() { } /** - * @return \WordPress\AiClientDependencies\Psr\Http\Message\UriFactoryInterface + * @return UriFactoryInterface * - * @throws \WordPress\AiClientDependencies\Http\Discovery\Exception\NotFoundException + * @throws RealNotFoundException * * @deprecated This will be removed in 2.0. Consider using the findUriFactory() method. */ @@ -81708,9 +81708,9 @@ final class Psr18ClientDiscovery extends \WordPress\AiClientDependencies\Http\Di /** * Finds a PSR-18 HTTP Client. * - * @return \WordPress\AiClientDependencies\Psr\Http\Client\ClientInterface + * @return ClientInterface * - * @throws \WordPress\AiClientDependencies\Http\Discovery\Exception\NotFoundException + * @throws RealNotFoundException */ public static function find() { @@ -81777,11 +81777,11 @@ public static function getCandidates($type) class PuliBetaStrategy implements \WordPress\AiClientDependencies\Http\Discovery\Strategy\DiscoveryStrategy { /** - * @var \WordPress\AiClientDependencies\Puli\GeneratedPuliFactory + * @var GeneratedPuliFactory */ protected static $puliFactory; /** - * @var \WordPress\AiClientDependencies\Puli\Discovery\Api\Discovery + * @var Discovery */ protected static $puliDiscovery; public static function getCandidates($type) @@ -81968,7 +81968,7 @@ trait MessageTrait private $headerNames = []; /** @var string */ private $protocol = '1.1'; - /** @var \WordPress\AiClientDependencies\Psr\Http\Message\StreamInterface|null */ + /** @var StreamInterface|null */ private $stream; public function getProtocolVersion(): string { @@ -82353,7 +82353,7 @@ trait RequestTrait private $method; /** @var string|null */ private $requestTarget; - /** @var \WordPress\AiClientDependencies\Psr\Http\Message\UriInterface|null */ + /** @var UriInterface|null */ private $uri; public function getRequestTarget(): string { @@ -82398,9 +82398,9 @@ class Request implements \WordPress\AiClientDependencies\Psr\Http\Message\Reques use \WordPress\AiClientDependencies\Nyholm\Psr7\RequestTrait; /** * @param string $method HTTP method - * @param string|\WordPress\AiClientDependencies\Psr\Http\Message\UriInterface $uri URI + * @param string|UriInterface $uri URI * @param array $headers Request headers - * @param string|resource|\WordPress\AiClientDependencies\Psr\Http\Message\StreamInterface|null $body Request body + * @param string|resource|StreamInterface|null $body Request body * @param string $version Protocol version */ public function __construct(string $method, $uri, array $headers = [], $body = null, string $version = '1.1') @@ -82486,7 +82486,7 @@ class Response implements \WordPress\AiClientDependencies\Psr\Http\Message\Respo /** * @param int $status Status code * @param array $headers Response headers - * @param string|resource|\WordPress\AiClientDependencies\Psr\Http\Message\StreamInterface|null $body Response body + * @param string|resource|StreamInterface|null $body Response body * @param string $version Protocol version * @param string|null $reason Reason phrase (when empty a default will be used based on the status code) */ @@ -82768,9 +82768,9 @@ class ServerRequest implements \WordPress\AiClientDependencies\Psr\Http\Message\ use \WordPress\AiClientDependencies\Nyholm\Psr7\RequestTrait; /** * @param string $method HTTP method - * @param string|\WordPress\AiClientDependencies\Psr\Http\Message\UriInterface $uri URI + * @param string|UriInterface $uri URI * @param array $headers Request headers - * @param string|resource|\WordPress\AiClientDependencies\Psr\Http\Message\StreamInterface|null $body Request body + * @param string|resource|StreamInterface|null $body Request body * @param string $version Protocol version * @param array $serverParams Typically the $_SERVER superglobal */ @@ -83013,7 +83013,7 @@ public function __construct($body) /** * Creates a new PSR-7 stream. * - * @param string|resource|\WordPress\AiClientDependencies\Psr\Http\Message\StreamInterface $body + * @param string|resource|StreamInterface $body * * @throws \InvalidArgumentException */ @@ -83200,7 +83200,7 @@ public function getClientMediaType(): ?string; class UploadedFile implements \WordPress\AiClientDependencies\Psr\Http\Message\UploadedFileInterface { /** - * @param \WordPress\AiClientDependencies\Psr\Http\Message\StreamInterface|string|resource $streamOrFile + * @param StreamInterface|string|resource $streamOrFile * @param int $size * @param int $errorStatus * @param string|null $clientFilename @@ -83645,7 +83645,7 @@ interface NetworkExceptionInterface extends \WordPress\AiClientDependencies\Psr\ * * The request object MAY be a different object from the one passed to ClientInterface::sendRequest() * - * @return \WordPress\AiClientDependencies\Psr\Http\Message\RequestInterface + * @return RequestInterface */ public function getRequest(): \WordPress\AiClientDependencies\Psr\Http\Message\RequestInterface; } @@ -83663,7 +83663,7 @@ interface RequestExceptionInterface extends \WordPress\AiClientDependencies\Psr\ * * The request object MAY be a different object from the one passed to ClientInterface::sendRequest() * - * @return \WordPress\AiClientDependencies\Psr\Http\Message\RequestInterface + * @return RequestInterface */ public function getRequest(): \WordPress\AiClientDependencies\Psr\Http\Message\RequestInterface; } @@ -109588,7 +109588,7 @@ function wp_supports_ai(): bool * * @since 7.0.0 * - * @param string|\WordPress\AiClient\Messages\DTO\MessagePart|\WordPress\AiClient\Messages\DTO\Message|array|list|list<\WordPress\AiClient\Messages\DTO\Message>|null $prompt Optional. Initial prompt content. + * @param string|MessagePart|Message|array|list|list|null $prompt Optional. Initial prompt content. * A string for simple text prompts, * a MessagePart or Message object for * structured content, an array for a @@ -114656,7 +114656,6 @@ function block_core_shared_navigation_item_should_render($attributes, $block) * @since 5.9.0 * * @return string - * @phpstan-return non-falsy-string */ function block_core_shared_navigation_render_submenu_icon() { From 764d7ec9d28ad4b0b41c5bc90dbc97d71e32ca7d Mon Sep 17 00:00:00 2001 From: thelovekesh Date: Sun, 28 Jun 2026 23:23:12 +0530 Subject: [PATCH 22/23] Update phpstan return type for `block_core_shared_navigation_render_submenu_icon()` --- wordpress-stubs.php | 1 + 1 file changed, 1 insertion(+) diff --git a/wordpress-stubs.php b/wordpress-stubs.php index 8c3a7a27..cef3ab0a 100644 --- a/wordpress-stubs.php +++ b/wordpress-stubs.php @@ -114656,6 +114656,7 @@ function block_core_shared_navigation_item_should_render($attributes, $block) * @since 5.9.0 * * @return string + * @phpstan-return non-falsy-string */ function block_core_shared_navigation_render_submenu_icon() { From f2ce721cd8f3add24fcfa51b115b8efda5d4a5ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Sun, 28 Jun 2026 21:41:22 +0200 Subject: [PATCH 23/23] Simplify test execution in GitHub Actions --- .github/workflows/integrate.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/integrate.yml b/.github/workflows/integrate.yml index 3f729c31..c661802b 100644 --- a/.github/workflows/integrate.yml +++ b/.github/workflows/integrate.yml @@ -16,7 +16,6 @@ jobs: runs-on: "ubuntu-latest" strategy: - fail-fast: false matrix: php-version: - "7.4" @@ -44,7 +43,4 @@ jobs: - run: "php -l wordpress-stubs.php" - run: "git diff --exit-code" - run: "php -f wordpress-stubs.php" - - parallel: - - run: "composer run test:phpunit" - - run: "composer run test:phpstan" - - run: "composer run test:cs" + - run: "composer run test"