Use PHP 7.4 featers and PHP 8 polyfills

This commit is contained in:
David Stone
2025-02-08 13:57:32 -07:00
parent 8bea6067cd
commit b41dc2b2eb
550 changed files with 15270 additions and 14627 deletions

View File

@ -32,7 +32,7 @@ class Base_Field_Template {
/**
* @var array
*/
protected $attributes = array();
protected $attributes = [];
/**
* Field Template Constructor
@ -41,7 +41,7 @@ class Base_Field_Template {
*
* @param array $attributes The attributes passed to the field.
*/
public function __construct($attributes = array()) {
public function __construct($attributes = []) {
$this->attributes = $attributes;
}

View File

@ -88,7 +88,7 @@ class Simple_Order_Bump_Field_Template extends Base_Field_Template {
*/
public function get_preview(): string {
return wu_get_asset('checkout-forms/clean-template-selection.png');
return wu_get_asset('checkout-forms/clean-template-selection.webp');
}
/**
@ -99,7 +99,7 @@ class Simple_Order_Bump_Field_Template extends Base_Field_Template {
* @param array $attributes The field template attributes.
* @return void
*/
public function output($attributes) {
public function output($attributes): void {
/**
* Loads the actual order-bump template

View File

@ -88,7 +88,7 @@ class Clean_Order_Summary_Field_Template extends Base_Field_Template {
*/
public function get_preview(): string {
return wu_get_asset('checkout-forms/clean-order-summary.png');
return wu_get_asset('checkout-forms/clean-order-summary.webp');
}
/**
@ -99,7 +99,7 @@ class Clean_Order_Summary_Field_Template extends Base_Field_Template {
* @param array $attributes The field template attributes.
* @return void
*/
public function output($attributes) {
public function output($attributes): void {
/**
* Loads the actual order-summary template

View File

@ -90,7 +90,7 @@ class Clean_Period_Selection_Field_Template extends Base_Field_Template {
*/
public function get_preview(): string {
return wu_get_asset('checkout-forms/clean-period-selection.png');
return wu_get_asset('checkout-forms/clean-period-selection.webp');
}
/**
@ -101,7 +101,7 @@ class Clean_Period_Selection_Field_Template extends Base_Field_Template {
* @param array $attributes The field template attributes.
* @return void
*/
public function output($attributes) {
public function output($attributes): void {
wu_get_template('checkout/templates/period-selection/clean', $attributes);
}

View File

@ -90,7 +90,7 @@ class Legacy_Period_Selection_Field_Template extends Base_Field_Template {
*/
public function get_preview(): string {
return wu_get_asset('checkout-forms/legacy-period-selection.png');
return wu_get_asset('checkout-forms/legacy-period-selection.webp');
}
/**
@ -101,7 +101,7 @@ class Legacy_Period_Selection_Field_Template extends Base_Field_Template {
* @param array $attributes The field template attributes.
* @return void
*/
public function output($attributes) {
public function output($attributes): void {
wu_get_template('checkout/templates/period-selection/legacy', $attributes);
}

View File

@ -90,7 +90,7 @@ class Legacy_Pricing_Table_Field_Template extends Base_Field_Template {
*/
public function get_preview(): string {
return wu_get_asset('checkout-forms/legacy-pricing-table.png');
return wu_get_asset('checkout-forms/legacy-pricing-table.webp');
}
/**
@ -101,7 +101,7 @@ class Legacy_Pricing_Table_Field_Template extends Base_Field_Template {
* @param array $attributes The field template attributes.
* @return void
*/
public function output($attributes) {
public function output($attributes): void {
wu_get_template('checkout/templates/pricing-table/legacy', $attributes);
}

View File

@ -68,7 +68,7 @@ class List_Pricing_Table_Field_Template extends Base_Field_Template {
*/
public function get_preview(): string {
return wu_get_asset('checkout-forms/list-pricing-table.png');
return wu_get_asset('checkout-forms/list-pricing-table.webp');
}
/**
@ -79,7 +79,7 @@ class List_Pricing_Table_Field_Template extends Base_Field_Template {
* @param array $attributes The field template attributes.
* @return void
*/
public function output($attributes) {
public function output($attributes): void {
wu_get_template('checkout/templates/pricing-table/list', $attributes);
}

View File

@ -88,7 +88,7 @@ class Clean_Steps_Field_Template extends Base_Field_Template {
*/
public function get_preview(): string {
return wu_get_asset('checkout-forms/clean-steps.png');
return wu_get_asset('checkout-forms/clean-steps.webp');
}
/**
@ -99,7 +99,7 @@ class Clean_Steps_Field_Template extends Base_Field_Template {
* @param array $attributes The field template attributes.
* @return void
*/
public function output($attributes) {
public function output($attributes): void {
wu_get_template('checkout/templates/steps/clean', $attributes);
}

View File

@ -88,7 +88,7 @@ class Legacy_Steps_Field_Template extends Base_Field_Template {
*/
public function get_preview(): string {
return wu_get_asset('checkout-forms/legacy-steps.png');
return wu_get_asset('checkout-forms/legacy-steps.webp');
}
/**
@ -99,7 +99,7 @@ class Legacy_Steps_Field_Template extends Base_Field_Template {
* @param array $attributes The field template attributes.
* @return void
*/
public function output($attributes) {
public function output($attributes): void {
wu_get_template('checkout/templates/steps/legacy', $attributes);
}

View File

@ -88,7 +88,7 @@ class Minimal_Steps_Field_Template extends Base_Field_Template {
*/
public function get_preview(): string {
return wu_get_asset('checkout-forms/minimal-steps.png');
return wu_get_asset('checkout-forms/minimal-steps.webp');
}
/**
@ -99,7 +99,7 @@ class Minimal_Steps_Field_Template extends Base_Field_Template {
* @param array $attributes The field template attributes.
* @return void
*/
public function output($attributes) {
public function output($attributes): void {
wu_get_template('checkout/templates/steps/minimal', $attributes);
}

View File

@ -88,7 +88,7 @@ class Clean_Template_Selection_Field_Template extends Base_Field_Template {
*/
public function get_preview(): string {
return wu_get_asset('checkout-forms/clean-template-selection.png');
return wu_get_asset('checkout-forms/clean-template-selection.webp');
}
/**
@ -99,7 +99,7 @@ class Clean_Template_Selection_Field_Template extends Base_Field_Template {
* @param array $attributes The field template attributes.
* @return void
*/
public function output($attributes) {
public function output($attributes): void {
wu_get_template('checkout/templates/template-selection/clean', $attributes);
}

View File

@ -79,7 +79,7 @@ class Legacy_Template_Selection_Field_Template extends Base_Field_Template {
*/
public function get_preview(): string {
return wu_get_asset('checkout-forms/legacy-template-selection.png');
return wu_get_asset('checkout-forms/legacy-template-selection.webp');
}
/**
@ -90,7 +90,7 @@ class Legacy_Template_Selection_Field_Template extends Base_Field_Template {
* @param array $attributes The field template attributes.
* @return void
*/
public function output($attributes) {
public function output($attributes): void {
wu_get_template('checkout/templates/template-selection/legacy', $attributes);
}

View File

@ -77,7 +77,7 @@ class Minimal_Template_Selection_Field_Template extends Base_Field_Template {
*/
public function get_preview(): string {
return wu_get_asset('checkout-forms/minimal-template-selection.png');
return wu_get_asset('checkout-forms/minimal-template-selection.webp');
}
/**
@ -88,7 +88,7 @@ class Minimal_Template_Selection_Field_Template extends Base_Field_Template {
* @param array $attributes The field template attributes.
* @return void
*/
public function output($attributes) {
public function output($attributes): void {
wu_get_template('checkout/templates/template-selection/minimal', $attributes);
}