Skip to content

Commit e25554d

Browse files
authored
Merge pull request #1056 from hydephp/refactor-hydefront-versioning
Add "hidden" configuration option for setting the HydeFront version
2 parents c75158b + aed4a50 commit e25554d

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

packages/framework/src/Framework/Services/AssetService.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ class AssetService
2424
*/
2525
public string $version = 'v2.0';
2626

27+
public function __construct()
28+
{
29+
if (config('hyde.hydefront_version')) {
30+
$this->version = config('hyde.hydefront_version');
31+
}
32+
}
33+
2734
public function version(): string
2835
{
2936
return $this->version;

packages/framework/tests/Feature/AssetServiceTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ public function test_version_method_returns_version_property_when_config_overrid
3232
$this->assertEquals($service->version, $service->version());
3333
}
3434

35+
public function test_version_can_be_set_in_config()
36+
{
37+
config(['hyde.hydefront_version' => '1.0.0']);
38+
$service = new AssetService();
39+
$this->assertEquals('1.0.0', $service->version());
40+
}
41+
3542
public function test_cdn_path_constructor_returns_cdn_uri()
3643
{
3744
$service = new AssetService();

0 commit comments

Comments
 (0)