-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathphpstan-bootstrap.php
More file actions
28 lines (25 loc) · 937 Bytes
/
phpstan-bootstrap.php
File metadata and controls
28 lines (25 loc) · 937 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
/**
* PHPStan bootstrap stubs.
* Defines constants that are normally set at runtime by WordPress,
* so that static analysis can resolve them without a full WP environment.
*/
defined( 'OOTB_PLUGIN_URL' ) || define( 'OOTB_PLUGIN_URL', '' );
defined( 'OOTB_PLUGIN_PATH' ) || define( 'OOTB_PLUGIN_PATH', '' );
defined( 'OOTB_PLUGIN_BASENAME' ) || define( 'OOTB_PLUGIN_BASENAME', '' );
// Stubs for WordPress 7.0+ WP AI Client API (static analysis only).
if ( ! class_exists( 'OOTB_WP_AI_Client_Prompt' ) ) {
class OOTB_WP_AI_Client_Prompt {
public function using_system_instruction( string $instruction ): static {
return $this;
}
public function generate_text(): string|\WP_Error {
return '';
}
}
}
if ( ! function_exists( 'wp_ai_client_prompt' ) ) {
function wp_ai_client_prompt( string $prompt ): OOTB_WP_AI_Client_Prompt {
return new OOTB_WP_AI_Client_Prompt();
}
}