File tree Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ use DevCoder\DotEnv;
1818
1919echo getenv('APP_ENV');
2020// dev
21- echo getenv('DATABASE_DNS')
21+ echo getenv('DATABASE_DNS');
2222// mysql:host=localhost;dbname=test;
2323```
2424Ideal for small project
Original file line number Diff line number Diff 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 ])) {
You can’t perform that action at this time.
0 commit comments