Skip to content

Commit

Permalink
chore(core): setup fixes (#749)
Browse files Browse the repository at this point in the history
  • Loading branch information
brendt authored Nov 19, 2024
1 parent 99933ff commit 677cf3b
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 13 deletions.
4 changes: 0 additions & 4 deletions src/Tempest/Core/src/Composer.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ public function __construct(
if (! isset($this->mainNamespace) && count($this->namespaces)) {
$this->mainNamespace = $this->namespaces[0];
}

if (! isset($this->mainNamespace)) {
throw new KernelException("Tempest requires at least one PSR-4 namespace to be defined in composer.json.");
}
}

public function setMainNamespace(ComposerNamespace $namespace): self
Expand Down
2 changes: 1 addition & 1 deletion src/Tempest/Core/src/Environment.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function isOther(): bool

public static function fromEnv(): self
{
$value = env('ENVIRONMENT', 'production');
$value = env('ENVIRONMENT', 'local');

return self::tryFrom($value) ?? throw new InvalidEnvironment($value);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Tempest/Core/src/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ private function registerKernelErrorHandler(): self
$handler = new HttpProductionErrorHandler();
set_exception_handler($handler->handleException(...));
set_error_handler($handler->handleError(...)); // @phpstan-ignore-line
} else {
} elseif (PHP_SAPI !== 'cli') {
$whoops = new Run();
$whoops->pushHandler(new PrettyPageHandler());
$whoops->register();
Expand Down
7 changes: 0 additions & 7 deletions tests/Integration/Core/ComposerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,6 @@ public function takes_src_namespace_in_priority(): void
$this->assertSame('src/', $composer->mainNamespace->path);
}

#[Test]
public function errors_without_namespace(): void
{
$this->expectException(KernelException::class);
$this->initializeComposer([]);
}

#[Test]
public function errors_without_composer_file(): void
{
Expand Down

0 comments on commit 677cf3b

Please # to comment.