Skip to content

Commit

Permalink
refactor: Remove unnecessary "silencing" of null
Browse files Browse the repository at this point in the history
  • Loading branch information
ollieread committed Sep 10, 2024
1 parent 8f30155 commit f31d886
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/Attributes/CurrentTenant.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@ public function __construct(?string $tenancy = null)

public function resolve(CurrentTenant $tenant, Container $container): ?Tenant
{
$manager = $container->make(TenancyManager::class);

if (! ($manager instanceof TenancyManager)) {
// We'll fail silently here...for reasons
return null;
}

return $manager->get($this->tenancy)->tenant();
/**
* It's not nullable, it'll be an exception
*
* @noinspection NullPointerExceptionInspection
*/
return $container->make(TenancyManager::class)->get($this->tenancy)->tenant();
}
}

0 comments on commit f31d886

Please sign in to comment.