diff --git a/src/Envy.php b/src/Envy.php index 77e7f2d..8b7d131 100755 --- a/src/Envy.php +++ b/src/Envy.php @@ -38,10 +38,9 @@ public function environmentCalls(bool $excludeCallsWithDefaults = false): Collec { // @phpstan-ignore-next-line return collect($this->finder->configFilePaths()) - ->map(fn (string $path) => ($this->findEnvironmentCalls)($path, $excludeCallsWithDefaults)) - ->flatten() - // @phpstan-ignore-next-line - ->sortBy(fn (EnvironmentCall $call) => $call->getKey()); + ->sort() + ->map(fn (string $path) => ($this->findEnvironmentCalls)($path, $excludeCallsWithDefaults)->sortBy(fn (EnvironmentCall $call) => $call->getKey())) + ->flatten(); } /**