PluginProbe
Elementor Website Builder – more than just a page builder / 3.7.4
Elementor Website Builder – more than just a page builder v3.7.4
4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
← All changes | core/utils/version.php +4 -4 4.2.03.7.4 View file →
@@ -76,9 +76,9 @@
76 76 *
77 77 * @return bool
78 78 */
79 79 public static function is_valid_version( $version ) {
80 - return (bool) preg_match( '/^(\d+\.)?(\d+\.)?(\*|\d+)(-.+)?$/', $version );
80 + return ! ! preg_match( '/^(\d+\.)?(\d+\.)?(\*|\d+)(-.+)?$/', $version );
81 81 }
82 82
83 83 /**
84 84 * Creates a Version instance from a string.
@@ -86,13 +86,13 @@
86 86 * @param $version
87 87 * @param bool $should_validate
88 88 *
89 89 * @return static
90 - * @throws \Exception If version comparison fails or invalid version format is provided.
90 + * @throws \Exception
91 91 */
92 92 public static function create_from_string( $version, $should_validate = true ) {
93 93 if ( $should_validate && ! static::is_valid_version( $version ) ) {
94 - throw new \Exception( sprintf( '%s is an invalid version.', esc_html( $version ) ) );
94 + throw new \Exception( "{$version} is an invalid version." );
95 95 }
96 96
97 97 $parts = explode( '.', $version );
98 98 $patch_parts = [];
@@ -130,9 +130,9 @@
130 130 * @param $version
131 131 * @param string $part
132 132 *
133 133 * @return bool
134 - * @throws \Exception If version validation fails or parsing errors occur.
134 + * @throws \Exception
135 135 */
136 136 public function compare( $operator, $version, $part = self::PART_STAGE ) {
137 137 if ( ! ( $version instanceof Version ) ) {
138 138 if ( ! static::is_valid_version( $version ) ) {