0.14.0
Supports string and MessageInterface return type in WebQuery
interface UserApiInterface
{
#[WebQuery('user_item')]
public function getUserData(string $id): array; // JSON: 連想配列に変換
#[WebQuery('user_item')]
public function getUserBody(string $id): string; // Raw response string: レスポンスボディをそのまま文字列で取得
#[WebQuery('user_item')]
public function getUserResponse(string $id): MessageInterface; // PS7 message: 生のレスポンスオブジェクトを取得
}What's Changed
- Add support non-JSON responses in WebApiQuery by @jingu in #60
- Set PHP version constraint to >=8.1 <8.4 in composer.json by @koriym in #63 #59
Full Changelog: 0.13.0...0.14.0
Additional Notes
This section was added later (2025-11-11) to provide detailed migration guides and examples.
Added
-
Support for
stringandMessageInterfacereturn types in#[WebQuery]attribute (#60)array: Decode JSON response to associative array (existing behavior)string: Return raw response body as stringMessageInterface: Return PSR-7 response object for full control
Example:
interface UserApiInterface { // JSON response - decoded to array #[WebQuery('user_item')] public function getUserData(string $id): array; // Raw response body as string #[WebQuery('user_item')] public function getUserBody(string $id): string; // PSR-7 response object #[WebQuery('user_item')] public function getUserResponse(string $id): MessageInterface; }
Changed
- Set PHP version constraint to
>=8.1 <8.4in composer.json (#63, #59)- Ensures compatibility with PHP 8.1, 8.2, and 8.3
- Prepares for PHP 8.4 compatibility in future releases
Thanks @jingu for the contribution!