diff options
author | Александр Кирюхин <alexander@kiryukhin.su> | 2018-01-19 19:03:26 +0300 |
---|---|---|
committer | Александр Кирюхин <alexander@kiryukhin.su> | 2018-01-19 19:03:26 +0300 |
commit | 8ea647570b87adda400e5a3ce6c91f4b51327a0d (patch) | |
tree | 7c5d328b41e64c3e78ac89c9674747346233c87a /src/Parser | |
parent | 47c9d580c6e799e72b6a70b22dd5107790b1d3e9 (diff) |
Diffstat (limited to 'src/Parser')
-rw-r--r-- | src/Parser/Parser.php | 6 | ||||
-rw-r--r-- | src/Parser/ParserInterface.php | 6 |
2 files changed, 4 insertions, 8 deletions
diff --git a/src/Parser/Parser.php b/src/Parser/Parser.php index 7a5c37b..36410fc 100644 --- a/src/Parser/Parser.php +++ b/src/Parser/Parser.php @@ -8,8 +8,6 @@ declare(strict_types=1); namespace NeonXP\Dotenv\Parser; -use NeonXP\Dotenv\Types\KeyValue; - /** * Class Parser * @package NeonXP\Dotenv\Parser @@ -28,7 +26,7 @@ class Parser implements ParserInterface const BOOLEAN = '/^(true|false)$/i'; const NUMBER = '/^(\d+)$/'; - public function parseLine(string $line): KeyValue + public function parseLine(string $line): array { $line = preg_replace(self::REGEX_EXPORT_PREFIX, '', $line); list($key, $value) = explode('=', $line, 2) + ['', '']; @@ -50,6 +48,6 @@ class Parser implements ParserInterface $value = intval($value); } - return new KeyValue($key, $value); + return ['key' => $key, 'value' => $value]; } }
\ No newline at end of file diff --git a/src/Parser/ParserInterface.php b/src/Parser/ParserInterface.php index f67ffb5..4e63b33 100644 --- a/src/Parser/ParserInterface.php +++ b/src/Parser/ParserInterface.php @@ -8,8 +8,6 @@ declare(strict_types=1); namespace NeonXP\Dotenv\Parser; -use NeonXP\Dotenv\Types\KeyValue; - /** * Interface ParserInterface * @package NeonXP\Dotenv\Parser @@ -18,7 +16,7 @@ interface ParserInterface { /** * @param string $line - * @return KeyValue + * @return array */ - public function parseLine(string $line): KeyValue; + public function parseLine(string $line): array; }
\ No newline at end of file |