Skip to content

Commit 9a521b7

Browse files
committed
wip
1 parent c126f00 commit 9a521b7

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
### 0.2.1
4+
5+
- Fix array_filter filtering out all env variables
6+
- Change method name from `addEnvVars()` to `withEnvVars()` to match configuration.
7+
38
### 0.2.0
49

510
- Add method and configuration to allow the ability to add env variables to the array of env vars that will be passed to the process

index.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?php
2+
3+
var_dump($_ENV, getenv());

src/Server.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public function useRouter(string $path): self
114114
return $this;
115115
}
116116

117-
public function addEnvVars(array $vars): self
117+
public function withEnvVars(array $vars): self
118118
{
119119
$this->envVarsToPass = array_merge(
120120
$this->envVarsToPass,
@@ -164,7 +164,7 @@ private function buildServeCommand(): array
164164
private function buildPassingEnvVarArray(): array
165165
{
166166
return array_merge(array_filter($this->envVarsToPass, function ($key) {
167-
return in_array($key, $this->configuration['withoutEnvVars']);
167+
return !in_array($key, $this->configuration['withoutEnvVars']);
168168
}, ARRAY_FILTER_USE_KEY), $this->configuration['withEnvVars']);
169169
}
170170

0 commit comments

Comments
 (0)