diff options
| author | Yuriy Andamasov <yuriy@vyos.io> | 2026-05-23 13:13:22 +0300 |
|---|---|---|
| committer | Yuriy Andamasov <yuriy@vyos.io> | 2026-05-23 13:13:22 +0300 |
| commit | ed0dee0333acf8a1c79845bba6455506c8210bad (patch) | |
| tree | ded9334a63052323a074c3531273ee1c667f8855 /src/engine/VyOSElasticModernFulltextStorageEngine.php | |
| parent | 04acd3d6b9a95ff49d430eaf4f65aabc25282d88 (diff) | |
| download | phorge-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.php | 6 |
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; } |
