Skip to content

Commit 904b47c

Browse files
gziolowestonruter
andauthored
Apply suggestions from code review
Co-authored-by: Weston Ruter <[email protected]>
1 parent 792a958 commit 904b47c

2 files changed

Lines changed: 15 additions & 11 deletions

File tree

src/wp-includes/class-wp-connector-registry.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,9 @@ public function unregister( string $id ): ?array {
216216
* @type string $description The connector's description.
217217
* @type string|null $logo_url Optional. URL to the connector's logo image.
218218
* @type string $type The connector type. Currently, only 'ai_provider' is supported.
219-
* @type array $plugin Optional. Plugin data for install/activate UI.
219+
* @type array $plugin {
220+
* Optional. Plugin data for install/activate UI.
221+
*
220222
* @type string $slug The WordPress.org plugin slug.
221223
* }
222224
* @type array $authentication {

src/wp-includes/connectors.php

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,17 @@ function wp_is_connector_registered( string $id ): bool {
3939
* @param string $id The connector identifier.
4040
* @return array|null The registered connector data, or null if not registered.
4141
* @phpstan-return ?array{
42-
* name: string,
43-
* description: string,
44-
* logo_url?: string|null,
45-
* type: string,
42+
* name: non-empty-string,
43+
* description: non-empty-string,
44+
* logo_url?: non-empty-string|null,
45+
* type: 'ai_provider',
4646
* authentication: array{
47-
* method: string,
48-
* credentials_url?: string|null,
49-
* setting_name?: string
47+
* method: 'api_key'|'none',
48+
* credentials_url?: non-empty-string|null,
49+
* setting_name?: non-empty-string
5050
* },
5151
* plugin?: array{
52-
* slug: string
52+
* slug: non-empty-string
5353
* }
5454
* }
5555
*/
@@ -79,8 +79,10 @@ function wp_get_connector( string $id ): ?array {
7979
* @type string $description The connector's description.
8080
* @type string|null $logo_url Optional. URL to the connector's logo image.
8181
* @type string $type The connector type. Currently, only 'ai_provider' is supported.
82-
* @type array $plugin Optional. Plugin data for install/activate UI.
83-
* @type string $slug The WordPress.org plugin slug.
82+
* @type array $plugin {
83+
* Optional. Plugin data for install/activate UI.
84+
*
85+
* @type string $slug The WordPress.org plugin slug.
8486
* }
8587
* @type array $authentication {
8688
* Authentication configuration. When method is 'api_key', includes

0 commit comments

Comments
 (0)