diff --git a/AGENTS.md b/AGENTS.md index c4b3e044b..9c78bd3c5 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -91,7 +91,7 @@ assets/ # JS, CSS, images, fonts classes or interfaces** — external addons extend these classes and PHP will fatal if the child class doesn't declare the same return type. Use `@return` PHPDoc tags instead. This applies to all classes in `inc/gateways/`, `inc/ui/class-base-element.php`, - `inc/models/class-base-model.php`, `inc/integrations/`, and `inc/checkout/signup-fields/`. + `inc/models/class-base-model.php`, `inc/integrations/`, and `inc/checkout/`. Private and final methods may use PHP return types freely. - **PHPDoc**: Required on classes and public methods in `inc/`. Not required in `tests/`. Every file header: `@package WP_Ultimo`, `@subpackage`, `@since`. diff --git a/inc/gateways/class-base-gateway.php b/inc/gateways/class-base-gateway.php index 65cf58bb5..a03981b5a 100644 --- a/inc/gateways/class-base-gateway.php +++ b/inc/gateways/class-base-gateway.php @@ -594,7 +594,7 @@ public function supports_payment_polling() { * @param int $payment_id The local payment ID to verify. * @return array{success: bool, status: string, message: string} */ - public function verify_and_complete_payment($payment_id) { + public function verify_and_complete_payment(int $payment_id) { unset($payment_id); @@ -823,7 +823,7 @@ public function get_confirm_url() { * @param string $message The error message. * @return void */ - public function redirect_with_error($message) { + public function redirect_with_error(string $message) { $url = remove_query_arg(['wu-confirm', 'payment', 'token', 'PayerID', 'ba_token', 'subscription_id', 'status'], $this->return_url ?: wu_get_current_url()); diff --git a/inc/integrations/host-providers/class-cloudflare-host-provider.php b/inc/integrations/host-providers/class-cloudflare-host-provider.php index 3e373fd7e..acf404baa 100644 --- a/inc/integrations/host-providers/class-cloudflare-host-provider.php +++ b/inc/integrations/host-providers/class-cloudflare-host-provider.php @@ -144,7 +144,7 @@ public function add_cloudflare_dns_entries($dns_records, $domain) { * * @since 2.0.0 */ - public function detect(): bool { + public function detect() { /** * As Cloudflare recently enabled wildcards for all customers, this integration is no longer required. * https://blog.cloudflare.com/wildcard-proxy-for-everyone/ diff --git a/inc/integrations/host-providers/class-cpanel-host-provider.php b/inc/integrations/host-providers/class-cpanel-host-provider.php index 929bdbf1b..12e83afe6 100644 --- a/inc/integrations/host-providers/class-cpanel-host-provider.php +++ b/inc/integrations/host-providers/class-cpanel-host-provider.php @@ -97,7 +97,7 @@ class CPanel_Host_Provider extends Base_Host_Provider { * * @since 2.0.0 */ - public function detect(): bool { + public function detect() { return false; } @@ -262,7 +262,7 @@ public function load_api() { * @since 1.6.2 * @param null|int $site_id The site id. */ - public function get_site_url($site_id = null): string { + public function get_site_url($site_id = null) { return trim(preg_replace('#^https?://#', '', get_site_url($site_id)), '/'); } diff --git a/inc/integrations/interface-capability-module.php b/inc/integrations/interface-capability-module.php index 4107bec5b..2741ded2e 100644 --- a/inc/integrations/interface-capability-module.php +++ b/inc/integrations/interface-capability-module.php @@ -56,7 +56,7 @@ public function get_supported_features(); * @param string $feature Feature identifier to check. * @return bool */ - public function supports($feature); + public function supports(string $feature); /** * Registers WordPress hooks for this capability. diff --git a/inc/ui/class-billing-info-element.php b/inc/ui/class-billing-info-element.php index 1f8da7b74..e073b7b2c 100644 --- a/inc/ui/class-billing-info-element.php +++ b/inc/ui/class-billing-info-element.php @@ -266,7 +266,7 @@ public function setup_preview() { * * @param array $atts Parameters of the block/shortcode. * @param string|null $content The content inside the shortcode. - * @return string + * @return void */ public function output($atts, $content = null) {