From 110dc2831488937c1afb70c11657a341912fc8cd Mon Sep 17 00:00:00 2001 From: Peter Nguyen Date: Wed, 5 Feb 2025 00:44:12 -0600 Subject: Initial commit 2/25/2025 --- vendor/vlucas/phpdotenv/src/Parser/Value.php | 88 ++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 vendor/vlucas/phpdotenv/src/Parser/Value.php (limited to 'vendor/vlucas/phpdotenv/src/Parser/Value.php') diff --git a/vendor/vlucas/phpdotenv/src/Parser/Value.php b/vendor/vlucas/phpdotenv/src/Parser/Value.php new file mode 100644 index 0000000..9e495a1 --- /dev/null +++ b/vendor/vlucas/phpdotenv/src/Parser/Value.php @@ -0,0 +1,88 @@ +chars = $chars; + $this->vars = $vars; + } + + /** + * Create an empty value instance. + * + * @return \Dotenv\Parser\Value + */ + public static function blank() + { + return new self('', []); + } + + /** + * Create a new value instance, appending the characters. + * + * @param string $chars + * @param bool $var + * + * @return \Dotenv\Parser\Value + */ + public function append(string $chars, bool $var) + { + return new self( + $this->chars.$chars, + $var ? \array_merge($this->vars, [Str::len($this->chars)]) : $this->vars + ); + } + + /** + * Get the string representation of the parsed value. + * + * @return string + */ + public function getChars() + { + return $this->chars; + } + + /** + * Get the locations of the variables in the value. + * + * @return int[] + */ + public function getVars() + { + $vars = $this->vars; + + \rsort($vars); + + return $vars; + } +} -- cgit v1.2.3