135 文件 19,211 处自动修复:空格→Tab 缩进、括号间距、 函数声明空格、前置自增、尾逗号等纯格式化改动。 零逻辑变更,php -l + token 级对比验证通过。 新增 phpcs.xml.dist / phpstan.neon.dist 项目配置。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
56 lines
946 B
PHP
56 lines
946 B
PHP
<?php
|
|
/**
|
|
* 图像生成 Provider 接口
|
|
*
|
|
* @package WPMind
|
|
* @since 2.4.0
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace WPMind\Providers\Image;
|
|
|
|
defined( 'ABSPATH' ) || exit;
|
|
|
|
/**
|
|
* 图像生成 Provider 接口
|
|
*/
|
|
interface ImageProviderInterface {
|
|
|
|
/**
|
|
* 生成图像
|
|
*
|
|
* @param string $prompt 图像生成提示词
|
|
* @param array $options 选项(尺寸、风格等)
|
|
* @return array{success: bool, url?: string, error?: string}
|
|
*/
|
|
public function generate( string $prompt, array $options = [] ): array;
|
|
|
|
/**
|
|
* 测试连接
|
|
*
|
|
* @return array{success: bool, message: string}
|
|
*/
|
|
public function testConnection(): array;
|
|
|
|
/**
|
|
* 获取 Provider 标识
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getId(): string;
|
|
|
|
/**
|
|
* 获取 Provider 名称
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getName(): string;
|
|
|
|
/**
|
|
* 获取支持的模型列表
|
|
*
|
|
* @return array
|
|
*/
|
|
public function getModels(): array;
|
|
}
|