From a6a0cdc7ea585bf2b97c3b9848c77b765673459e Mon Sep 17 00:00:00 2001 From: Austin Passy <367897+thefrosty@users.noreply.github.com> Date: Wed, 24 Apr 2024 11:31:40 -0700 Subject: [PATCH 1/2] Allow int values in Script version to allow `filemtime` to be used. --- src/Api/Script.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/Api/Script.php b/src/Api/Script.php index 90f5feb..969f908 100755 --- a/src/Api/Script.php +++ b/src/Api/Script.php @@ -96,26 +96,27 @@ public function getDependencies(): array /** * Script version. - * @var string $version + * @var int|string $version */ - protected string $version; + protected int|string $version; /** * Set the Script version. - * @param string $version + * @param int|string $version */ - public function setVersion(string $version = '0.0.1'): void + public function setVersion(int|string $version = ''): void { $this->version = $version; } /** * Get the Script version. - * @return string + * @return int|string */ - public function getVersion(): string + public function getVersion(): int|string { - return $this->version ?? '0.0.1'; + global $wp_version; + return $this->version === '' ? $wp_version : $this->version; } /** From 6898ca90d565640c65773ab7c2d21b40741ae9f7 Mon Sep 17 00:00:00 2001 From: Austin Passy <367897+thefrosty@users.noreply.github.com> Date: Wed, 24 Apr 2024 11:33:05 -0700 Subject: [PATCH 2/2] Update Style version to allow for int. --- src/Api/Style.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/Api/Style.php b/src/Api/Style.php index c906423..8bcda8a 100755 --- a/src/Api/Style.php +++ b/src/Api/Style.php @@ -94,26 +94,27 @@ public function getDependencies(): array /** * Style version. - * @var string $version + * @var int|string $version */ - protected string $version; + protected int|string $version; /** * Set Style version. - * @param string $version + * @param int|string $version */ - public function setVersion(string $version = '0.0.1'): void + public function setVersion(int|string $version = ''): void { $this->version = $version; } /** * Get Style version. - * @return string + * @return int|string */ - public function getVersion(): string + public function getVersion(): int|string { - return $this->version ?? '0.0.1'; + global $wp_version; + return $this->version === '' ? $wp_version : $this->version; } /**