Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 779c38c

Browse filesBrowse files
committed
Add scalar typehints/return types to Dotenv
1 parent 0a084dd commit 779c38c
Copy full SHA for 779c38c

File tree

1 file changed

+3
-3
lines changed
Filter options

1 file changed

+3
-3
lines changed

‎src/Symfony/Component/Dotenv/Dotenv.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Dotenv/Dotenv.php
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ final class Dotenv
4545
* @throws FormatException when a file has a syntax error
4646
* @throws PathException when a file does not exist or is not readable
4747
*/
48-
public function load($path, ...$paths)
48+
public function load($path, string ...$paths): void
4949
{
5050
array_unshift($paths, $path);
5151

@@ -65,7 +65,7 @@ public function load($path, ...$paths)
6565
*
6666
* @param array $values An array of env variables
6767
*/
68-
public function populate($values)
68+
public function populate(array $values): void
6969
{
7070
foreach ($values as $name => $value) {
7171
if (isset($_ENV[$name]) || isset($_SERVER[$name]) || false !== getenv($name)) {
@@ -88,7 +88,7 @@ public function populate($values)
8888
*
8989
* @throws FormatException when a file has a syntax error
9090
*/
91-
public function parse($data, $path = '.env')
91+
public function parse(string $data, string $path = '.env')
9292
{
9393
$this->path = $path;
9494
$this->data = str_replace(array("\r\n", "\r"), "\n", $data);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.