Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/script version #83

Merged
merged 2 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions src/Api/Script.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down
15 changes: 8 additions & 7 deletions src/Api/Style.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down
Loading