1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 10:14:04 +00:00

Apply fixes from StyleCI

This commit is contained in:
stancl 2019-08-18 10:24:15 +00:00 committed by StyleCI Bot
parent 31d0d44261
commit a89017634b
2 changed files with 5 additions and 5 deletions

View file

@ -5,9 +5,9 @@ namespace Stancl\Tenancy;
use Stancl\Tenancy\Commands\Run;
use Stancl\Tenancy\Commands\Seed;
use Illuminate\Cache\CacheManager;
use Illuminate\Http\RedirectResponse;
use Stancl\Tenancy\Commands\Install;
use Stancl\Tenancy\Commands\Migrate;
use Illuminate\Http\RedirectResponse;
use Illuminate\Support\Facades\Route;
use Stancl\Tenancy\Commands\Rollback;
use Illuminate\Support\ServiceProvider;
@ -57,9 +57,9 @@ class TenancyServiceProvider extends ServiceProvider
RedirectResponse::macro('tenant', function (string $domain) {
// replace first occurance of hostname fragment with $domain
$url = $this->getTargetUrl();
$hostname = parse_url($url, PHP_URL_HOST);
$position = strpos($url, $hostname);
$this->setTargetUrl(substr_replace($url, $domain, $position, strlen($hostname)));
$hostname = \parse_url($url, PHP_URL_HOST);
$position = \strpos($url, $hostname);
$this->setTargetUrl(\substr_replace($url, $domain, $position, \strlen($hostname)));
return $this;
});

View file

@ -20,4 +20,4 @@ class TenantRedirectMacroTest extends TestCase
$this->get('/redirect')
->assertRedirect('http://abcd/foobar');
}
}
}