More code cleanup

This commit is contained in:
David Stone
2025-02-09 11:32:57 -07:00
parent 07a69d33e5
commit d9122a410d
14 changed files with 16 additions and 20 deletions

View File

@ -50,7 +50,8 @@
"symfony/polyfill-php81": "^1.31.0", "symfony/polyfill-php81": "^1.31.0",
"symfony/polyfill-php82": "^1.31.0", "symfony/polyfill-php82": "^1.31.0",
"symfony/polyfill-php83": "^1.31.0", "symfony/polyfill-php83": "^1.31.0",
"symfony/polyfill-php84": "^1.31.0" "symfony/polyfill-php84": "^1.31.0",
"ext-curl": "*"
}, },
"require-dev": { "require-dev": {
"composer/installers": "^1.9.0", "composer/installers": "^1.9.0",

View File

@ -73,7 +73,7 @@ class Dashboard_Statistics {
* @since 2.0.0 * @since 2.0.0
* @return void. * @return void.
*/ */
public function init() {} public function init(): void {}
/** /**
* Main function to call the get data functions based on the array of types. * Main function to call the get data functions based on the array of types.

View File

@ -29,6 +29,6 @@ class Domain_Mapping_Compat {
* @since 2.0.0 * @since 2.0.0
* @return void * @return void
*/ */
public function init() { public function init(): void {
} }
} }

View File

@ -36,7 +36,7 @@ abstract class Enum {
/** /**
* @var string * @var string
*/ */
private $value = ''; private $value;
/** /**
* Constructor method. Takes the value you want to set. * Constructor method. Takes the value you want to set.

View File

@ -24,12 +24,12 @@ if ( ! class_exists('MUCD_Log') ) {
/** /**
* @var string * @var string
*/ */
private $log_dir_path = ''; private $log_dir_path;
/** /**
* @var string * @var string
*/ */
private $log_file_name = ''; private $log_file_name;
/** /**
* Constructor * Constructor

View File

@ -74,12 +74,12 @@ class CPanel_API {
/** /**
* @var integer * @var integer
*/ */
private $port = 2083; private $port;
/** /**
* @var boolean * @var boolean
*/ */
private $log = false; private $log;
/** /**
* Creates the CPanel_API Object. * Creates the CPanel_API Object.

View File

@ -27,7 +27,7 @@ class Trial_Limits {
* @since 2.0.0 * @since 2.0.0
* @return void * @return void
*/ */
public function init() { public function init(): void {
} }
/** /**

View File

@ -277,5 +277,5 @@ class Membership_List_Table_Widget extends Base_List_Table {
* @since 2.0.0 * @since 2.0.0
* @return void * @return void
*/ */
public function _js_vars() {} public function _js_vars(): void {}
} }

View File

@ -241,5 +241,5 @@ class Payment_List_Table_Widget extends Base_List_Table {
* @since 2.0.0 * @since 2.0.0
* @return void * @return void
*/ */
public function _js_vars() {} public function _js_vars(): void {}
} }

View File

@ -31,6 +31,6 @@ class Job_Manager {
* @since 2.0.0 * @since 2.0.0
* @return void * @return void
*/ */
public function init() { public function init(): void {
} }
} }

View File

@ -244,7 +244,7 @@ class Broadcast extends Post_Base_Model {
* @param string $type The type being set. * @param string $type The type being set.
* @return void * @return void
*/ */
public function set_type($type) { public function set_type($type): void {
if ( ! in_array($type, $this->allowed_types, true)) { if ( ! in_array($type, $this->allowed_types, true)) {
$type = 'broadcast_notice'; $type = 'broadcast_notice';
@ -261,7 +261,7 @@ class Broadcast extends Post_Base_Model {
* @param string $status The status being set. * @param string $status The status being set.
* @return void * @return void
*/ */
public function set_status($status) { public function set_status($status): void {
if ( ! in_array($status, $this->allowed_status, true)) { if ( ! in_array($status, $this->allowed_status, true)) {
$status = 'publish'; $status = 'publish';

View File

@ -482,7 +482,7 @@ class Membership extends Base_Model {
if ($plan && ($plan->get_duration() !== $this->get_duration() || $plan->get_duration_unit() !== $this->get_duration_unit())) { if ($plan && ($plan->get_duration() !== $this->get_duration() || $plan->get_duration_unit() !== $this->get_duration_unit())) {
$variation = $plan->get_as_variation($this->get_duration(), $this->get_duration_unit()); $variation = $plan->get_as_variation($this->get_duration(), $this->get_duration_unit());
$plan = ($variation ?: null) ?? $plan; $plan = ($variation ? $variation : null) ?? $plan;
} }
return $plan; return $plan;

View File

@ -11,8 +11,6 @@
namespace WP_Ultimo\Objects; namespace WP_Ultimo\Objects;
use WP_Ultimo\Objects\Limitations;
// Exit if accessed directly // Exit if accessed directly
defined('ABSPATH') || exit; defined('ABSPATH') || exit;

View File

@ -7,8 +7,5 @@
<testsuite name="testing"> <testsuite name="testing">
<directory suffix="Test.php">./tests/</directory> <directory suffix="Test.php">./tests/</directory>
</testsuite> </testsuite>
<testsuite name="rector">
<directory>utils/rector/tests</directory>
</testsuite>
</testsuites> </testsuites>
</phpunit> </phpunit>