Skip to content

Commit 677cf3b

Browse files
authored
chore(core): setup fixes (#749)
1 parent 99933ff commit 677cf3b

File tree

4 files changed

+2
-13
lines changed

4 files changed

+2
-13
lines changed

src/Tempest/Core/src/Composer.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ public function __construct(
3939
if (! isset($this->mainNamespace) && count($this->namespaces)) {
4040
$this->mainNamespace = $this->namespaces[0];
4141
}
42-
43-
if (! isset($this->mainNamespace)) {
44-
throw new KernelException("Tempest requires at least one PSR-4 namespace to be defined in composer.json.");
45-
}
4642
}
4743

4844
public function setMainNamespace(ComposerNamespace $namespace): self

src/Tempest/Core/src/Environment.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function isOther(): bool
4747

4848
public static function fromEnv(): self
4949
{
50-
$value = env('ENVIRONMENT', 'production');
50+
$value = env('ENVIRONMENT', 'local');
5151

5252
return self::tryFrom($value) ?? throw new InvalidEnvironment($value);
5353
}

src/Tempest/Core/src/Kernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ private function registerKernelErrorHandler(): self
186186
$handler = new HttpProductionErrorHandler();
187187
set_exception_handler($handler->handleException(...));
188188
set_error_handler($handler->handleError(...)); // @phpstan-ignore-line
189-
} else {
189+
} elseif (PHP_SAPI !== 'cli') {
190190
$whoops = new Run();
191191
$whoops->pushHandler(new PrettyPageHandler());
192192
$whoops->register();

tests/Integration/Core/ComposerTest.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,6 @@ public function takes_src_namespace_in_priority(): void
9292
$this->assertSame('src/', $composer->mainNamespace->path);
9393
}
9494

95-
#[Test]
96-
public function errors_without_namespace(): void
97-
{
98-
$this->expectException(KernelException::class);
99-
$this->initializeComposer([]);
100-
}
101-
10295
#[Test]
10396
public function errors_without_composer_file(): void
10497
{

0 commit comments

Comments
 (0)