@@ -38,6 +38,20 @@ function wp_is_connector_registered( string $id ): bool {
3838 *
3939 * @param string $id The connector identifier.
4040 * @return array|null The registered connector data, or null if not registered.
41+ * @phpstan-return ?array{
42+ * name: string,
43+ * description: string,
44+ * logo_url?: string|null,
45+ * type: string,
46+ * authentication: array{
47+ * method: string,
48+ * credentials_url?: string|null,
49+ * setting_name?: string
50+ * },
51+ * plugin?: array{
52+ * slug: string
53+ * }
54+ * }
4155 */
4256function wp_get_connector ( string $ id ): ?array {
4357 $ registry = WP_Connector_Registry::get_instance ();
@@ -55,8 +69,6 @@ function wp_get_connector( string $id ): ?array {
5569 *
5670 * @see WP_Connector_Registry::get_all_registered()
5771 *
58- * @phpstan-import-type Connector from WP_Connector_Registry
59- *
6072 * @return array {
6173 * Connector settings keyed by connector ID.
6274 *
@@ -65,7 +77,7 @@ function wp_get_connector( string $id ): ?array {
6577 *
6678 * @type string $name The connector's display name.
6779 * @type string $description The connector's description.
68- * @type string|null $logo_url Optional. URL to the connector's logo image.
80+ * @type string|null $logo_url Optional. URL to the connector's logo image.
6981 * @type string $type The connector type. Currently, only 'ai_provider' is supported.
7082 * @type array $plugin Optional. Plugin data for install/activate UI.
7183 * @type string $slug The WordPress.org plugin slug.
@@ -80,7 +92,20 @@ function wp_get_connector( string $id ): ?array {
8092 * }
8193 * }
8294 * }
83- * @phpstan-return array<string, Connector>
95+ * @phpstan-return array<string, array{
96+ * name: string,
97+ * description: string,
98+ * logo_url?: string|null,
99+ * type: string,
100+ * authentication: array{
101+ * method: string,
102+ * credentials_url?: string|null,
103+ * setting_name?: string
104+ * },
105+ * plugin?: array{
106+ * slug: string
107+ * }
108+ * }>
84109 */
85110function wp_get_connectors (): array {
86111 $ registry = WP_Connector_Registry::get_instance ();
0 commit comments