From ca9e659e36190b57873b0cc8f712bde437b0cce2 Mon Sep 17 00:00:00 2001 From: Pavel Levin Date: Mon, 10 Jul 2017 17:35:50 +0300 Subject: [PATCH] Correctly define default values More correctly way to define default values --- src/Adapter/Http/Options.php | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/src/Adapter/Http/Options.php b/src/Adapter/Http/Options.php index 89fe77b..8db861d 100644 --- a/src/Adapter/Http/Options.php +++ b/src/Adapter/Http/Options.php @@ -3,28 +3,15 @@ class Options { - private $host; - private $port; - private $username; - private $password; - private $protocol; + private $host = 'localhost'; + private $port = 8086; + private $username = 'root'; + private $password = 'root'; + private $protocol = 'http'; private $database; - private $retentionPolicy; - private $tags; - private $prefix; - - public function __construct() - { - $this->setHost("localhost"); - $this->setPort(8086); - $this->setUsername("root"); - $this->setPassword("root"); - $this->setProtocol("http"); - $this->setPrefix(""); - - $this->setRetentionPolicy("default"); - $this->setTags([]); - } + private $retentionPolicy = 'default'; + private $tags = []; + private $prefix = ''; public function getPrefix() {