PluginProbe
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF / trunk
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF vtrunk
2.3.4 2.3.3 2.3.2 2.3.1 2.3.0 2.2.9 2.2.8 trunk 1.10 1.3.3 1.3.4 1.3.5 1.3.5.1 1.3.5.2 1.3.6 1.3.6.1 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.5 All 103 releases
imagify / classes / Abilities / CreditConsumingAbilityInterface.php

CreditConsumingAbilityInterface.php in Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF trunk, at classes/Abilities/CreditConsumingAbilityInterface.php

29 lines 809 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 declare(strict_types=1);
3
4 namespace Imagify\Abilities;
5
6 /**
7 * Contract for MCP abilities that spend Imagify quota.
8 *
9 * Implementing this interface opts an ability into
10 * `AbstractAbility::guard_credit_confirmation()`, the shared pre-flight
11 * quota/confirmation gate.
12 *
13 * @since 2.4.0
14 */
15 interface CreditConsumingAbilityInterface {
16
17 /**
18 * Returns a small associative array describing what the call is about to do.
19 *
20 * Used by `AbstractAbility::guard_credit_confirmation()` to build the
21 * `confirmation_required` response so the caller/AI can see the impact
22 * before confirming.
23 *
24 * @param array $args Raw input arguments passed to execute().
25 * @return array{unit: string, count: int, total?: int, label: string}
26 */
27 public function get_impact_estimate( array $args ): array;
28 }
29