summaryrefslogtreecommitdiff
path: root/src/engine/VyOSElasticModernFulltextStorageEngine.php
diff options
context:
space:
mode:
authorYuriy Andamasov <yuriy@vyos.io>2026-05-23 13:13:22 +0300
committerYuriy Andamasov <yuriy@vyos.io>2026-05-23 13:13:22 +0300
commited0dee0333acf8a1c79845bba6455506c8210bad (patch)
treeded9334a63052323a074c3531273ee1c667f8855 /src/engine/VyOSElasticModernFulltextStorageEngine.php
parent04acd3d6b9a95ff49d430eaf4f65aabc25282d88 (diff)
downloadphorge-elasticsearch-modern-ed0dee0333acf8a1c79845bba6455506c8210bad.tar.gz
phorge-elasticsearch-modern-ed0dee0333acf8a1c79845bba6455506c8210bad.zip
E1 fixup: initialize $version to null; getVersion() throws if unset; use TestDouble in tests
🤖 Generated by [robots](https://vyos.io)
Diffstat (limited to 'src/engine/VyOSElasticModernFulltextStorageEngine.php')
-rw-r--r--src/engine/VyOSElasticModernFulltextStorageEngine.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/engine/VyOSElasticModernFulltextStorageEngine.php b/src/engine/VyOSElasticModernFulltextStorageEngine.php
index 60683b1..2570311 100644
--- a/src/engine/VyOSElasticModernFulltextStorageEngine.php
+++ b/src/engine/VyOSElasticModernFulltextStorageEngine.php
@@ -7,7 +7,7 @@
abstract class VyOSElasticModernFulltextStorageEngine
extends PhabricatorFulltextStorageEngine {
- private $version;
+ private $version = null;
public function setVersion($version) {
$version = (int)$version;
@@ -25,6 +25,10 @@ abstract class VyOSElasticModernFulltextStorageEngine
}
public function getVersion() {
+ if ($this->version === null) {
+ throw new Exception(
+ pht('Version not configured; call setVersion() or setService() first.'));
+ }
return $this->version;
}