mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-06 16:14:05 +00:00
get down to 59 phpstan errors
This commit is contained in:
parent
193e044777
commit
a94227a19c
26 changed files with 130 additions and 130 deletions
|
|
@ -10,27 +10,22 @@ use Stancl\Tenancy\Contracts\Tenant;
|
|||
|
||||
class ScoutTenancyBootstrapper implements TenancyBootstrapper
|
||||
{
|
||||
/** @var Repository */
|
||||
protected $config;
|
||||
protected ?string $originalScoutPrefix = null;
|
||||
|
||||
/** @var string */
|
||||
protected $originalScoutPrefix;
|
||||
public function __construct(
|
||||
protected Repository $config,
|
||||
) {}
|
||||
|
||||
public function __construct(Repository $config)
|
||||
public function bootstrap(Tenant $tenant): void
|
||||
{
|
||||
$this->config = $config;
|
||||
}
|
||||
|
||||
public function bootstrap(Tenant $tenant)
|
||||
{
|
||||
if (! isset($this->originalScoutPrefix)) {
|
||||
if ($this->originalScoutPrefix !== null) {
|
||||
$this->originalScoutPrefix = $this->config->get('scout.prefix');
|
||||
}
|
||||
|
||||
$this->config->set('scout.prefix', $this->getTenantPrefix($tenant));
|
||||
}
|
||||
|
||||
public function revert()
|
||||
public function revert(): void
|
||||
{
|
||||
$this->config->set('scout.prefix', $this->originalScoutPrefix);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue