Skip to content

Commit

Permalink
Remove nonrelevant methods
Browse files Browse the repository at this point in the history
  • Loading branch information
ernilambar committed Dec 5, 2024
1 parent b72a97b commit 41c11cc
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 95 deletions.
79 changes: 0 additions & 79 deletions includes/Traits/Version_Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,51 +47,6 @@ protected function get_wordpress_latest_version(): string {
return $version ?? get_bloginfo( 'version' );
}

/**
* Returns required PHP version.
*
* @since 1.4.0
*
* @return string Required PHP version.
*/
protected function get_php_required_version(): string {
$version = $this->get_latest_version_info( 'php_version' );

return $version ?? $this->get_required_php_version();
}

/**
* Returns required MySQL version.
*
* @since 1.4.0
*
* @return string Required MySQL version.
*/
protected function get_mysql_required_version(): string {
$version = $this->get_latest_version_info( 'mysql_version' );

return $version ?? $this->get_required_mysql_version();
}

/**
* Returns recommended PHP version.
*
* @since 1.4.0
*
* @return string Recommended PHP version.
*/
protected function get_php_recommended_version(): string {
$recommended_version = '7.4'; // Default fallback recommended version.

$version_details = wp_check_php_version();

if ( is_array( $version_details ) && ! empty( $version_details['recommended_version'] ) ) {
$recommended_version = $version_details['recommended_version'];
}

return $recommended_version;
}

/**
* Returns relative WordPress major version.
*
Expand Down Expand Up @@ -137,38 +92,4 @@ private function get_latest_version_info( string $key ) {

return array_key_exists( $key, $info ) ? $info[ $key ] : null;
}

/**
* Returns the current WordPress' required PHP version.
*
* @since 1.4.0
*
* @return string The current WordPress' required PHP version.
*/
private function get_required_php_version(): string {
static $required_php_version;

if ( ! isset( $required_php_version ) ) {
require ABSPATH . WPINC . '/version.php';
}

return $required_php_version;
}

/**
* Returns the current WordPress' required MySQL version.
*
* @since 1.4.0
*
* @return string The current WordPress' required MySQL version.
*/
private function get_required_mysql_version(): string {
static $required_mysql_version;

if ( ! isset( $required_mysql_version ) ) {
require ABSPATH . WPINC . '/version.php';
}

return $required_mysql_version;
}
}
1 change: 0 additions & 1 deletion tests/phpstan/bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

define( 'WPINC', '' );
define( 'WP_PLUGIN_CHECK_PLUGIN_DIR_PATH', '' );
define( 'WP_PLUGIN_CHECK_PLUGIN_DIR_URL', '' );
15 changes: 0 additions & 15 deletions tests/phpunit/tests/Traits/Version_Utils_Tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,21 +62,6 @@ public function test_wordpress_stable_version() {
$this->assertSame( '6.7', $version );
}

public function test_wordpress_required_php_version() {
$version = $this->get_php_required_version();
$this->assertSame( '7.2.24', $version );
}

public function test_wordpress_required_mysql_version() {
$version = $this->get_mysql_required_version();
$this->assertSame( '5.5.5', $version );
}

public function test_wordpress_recommended_php_version() {
$version = $this->get_php_recommended_version();
$this->assertSame( '7.4', $version );
}

/**
* @dataProvider data_wordpress_version_items
*/
Expand Down

0 comments on commit 41c11cc

Please sign in to comment.