1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-14 11:54:04 +00:00

Apply fixes from StyleCI (#80)

This commit is contained in:
Samuel Štancl 2019-08-02 20:01:10 +02:00 committed by GitHub
parent bd6583b6af
commit eceacd9422
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 83 additions and 70 deletions

View file

@ -13,7 +13,7 @@ trait BootstrapsTenancy
/**
* Was tenancy initialized/bootstrapped?
*
* @var boolean
* @var bool
*/
public $initialized = false;
@ -53,7 +53,7 @@ trait BootstrapsTenancy
foreach ($connections as $connection) {
$prefix = $this->app['config']['tenancy.redis.prefix_base'] . $this->tenant['uuid'];
$client = Redis::connection($connection)->client();
try {
$this->originalSettings['redis'][$connection] = $client->getOption($client::OPT_PREFIX);
$client->setOption($client::OPT_PREFIX, $prefix);
@ -67,7 +67,7 @@ trait BootstrapsTenancy
{
foreach ($connections as $connection) {
$client = Redis::connection($connection)->client();
try {
$client->setOption($client::OPT_PREFIX, $this->originalSettings['redis'][$connection]);
} catch (\Throwable $t) {
@ -106,12 +106,12 @@ trait BootstrapsTenancy
// Storage facade
foreach ($this->app['config']['tenancy.filesystem.disks'] as $disk) {
$old['disks'][$disk] = Storage::disk($disk)->getAdapter()->getPathPrefix();
if ($root = str_replace('%storage_path%', storage_path(), $this->app['config']["tenancy.filesystem.root_override.{$disk}"])) {
Storage::disk($disk)->getAdapter()->setPathPrefix($root);
} else {
$root = $this->app['config']["filesystems.disks.{$disk}.root"];
Storage::disk($disk)->getAdapter()->setPathPrefix($root . "/{$suffix}");
}
}

View file

@ -9,7 +9,7 @@ trait HasATenantsOption
protected function getOptions()
{
return array_merge([
['tenants', null, InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL, '', null]
['tenants', null, InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL, '', null],
], parent::getOptions());
}
}