From ed0dee0333acf8a1c79845bba6455506c8210bad Mon Sep 17 00:00:00 2001 From: Yuriy Andamasov Date: Sat, 23 May 2026 13:13:22 +0300 Subject: E1 fixup: initialize $version to null; getVersion() throws if unset; use TestDouble in tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated by [robots](https://vyos.io) --- src/engine/VyOSElasticModernFulltextStorageEngine.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/engine/VyOSElasticModernFulltextStorageEngine.php') 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; } -- cgit v1.2.3