Skip to content

Commit df89dde

Browse files
committedFeb 13, 2021
Branch refactor
1 parent 9a5eb17 commit df89dde

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed
 

‎README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use DevCoder\DotEnv;
1818

1919
echo getenv('APP_ENV');
2020
// dev
21-
echo getenv('DATABASE_DNS')
21+
echo getenv('DATABASE_DNS');
2222
// mysql:host=localhost;dbname=test;
2323
```
2424
Ideal for small project

‎src/DotEnv.php

+3-7
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function __construct(string $path, array $options = [])
4242
$this->processOptions($options);
4343
}
4444

45-
private function processOptions(array $options)
45+
private function processOptions(array $options) : void
4646
{
4747
$this->options = array_merge([
4848
static::PROCESS_BOOLEANS => true
@@ -52,10 +52,8 @@ private function processOptions(array $options)
5252
/**
5353
* Processes the $path of the instances and parses the values into $_SERVER and $_ENV, also returns all the data that has been read.
5454
* Skips empty and commented lines.
55-
*
56-
* @return array The values that have been loaded into ENV
5755
*/
58-
public function load() :array
56+
public function load() : void
5957
{
6058
if (!is_readable($this->path)) {
6159
throw new \RuntimeException(sprintf('%s file is not readable', $this->path));
@@ -81,11 +79,9 @@ public function load() :array
8179
$loaded[$name] = $value;
8280
}
8381
}
84-
85-
return $loaded;
8682
}
8783

88-
private function processValue($value) {
84+
private function processValue(string $value) {
8985
$trimmedValue = trim($value);
9086

9187
if (!empty($this->options[static::PROCESS_BOOLEANS])) {

0 commit comments

Comments
 (0)
Please sign in to comment.