diff --git a/app/Server/Http/Controllers/Admin/StoreSubdomainController.php b/app/Server/Http/Controllers/Admin/StoreSubdomainController.php index 30aaf8f..a590b55 100644 --- a/app/Server/Http/Controllers/Admin/StoreSubdomainController.php +++ b/app/Server/Http/Controllers/Admin/StoreSubdomainController.php @@ -22,7 +22,7 @@ class StoreSubdomainController extends AdminController /** @var Configuration */ protected $configuration; - public function __construct(UserRepository $userRepository, SubdomainRepository $subdomainRepository, Configuration $configuration) + public function __construct(UserRepository $userRepository, SubdomainRepository $subdomainRepository, Configuration $configuration) { $this->userRepository = $userRepository; $this->subdomainRepository = $subdomainRepository; diff --git a/app/Server/Http/Controllers/ControlMessageController.php b/app/Server/Http/Controllers/ControlMessageController.php index 3a99919..69102ae 100644 --- a/app/Server/Http/Controllers/ControlMessageController.php +++ b/app/Server/Http/Controllers/ControlMessageController.php @@ -275,7 +275,7 @@ class ControlMessageController implements MessageComponentInterface $this->domainRepository ->getDomainsByUserId($user['id']) - ->then(function ($domains) use ($connection, $deferred, $user, $serverHost) { + ->then(function ($domains) use ($connection, $deferred , $serverHost) { $userDomain = collect($domains)->first(function ($domain) use ($serverHost) { return strtolower($domain['domain']) === strtolower($serverHost); }); @@ -290,6 +290,7 @@ class ControlMessageController implements MessageComponentInterface $connection->close(); $deferred->reject(null); + return; } @@ -324,7 +325,7 @@ class ControlMessageController implements MessageComponentInterface if (! is_null($subdomain)) { return $this->subdomainRepository->getSubdomainByNameAndDomain($subdomain, $serverHost) ->then(function ($foundSubdomain) use ($connection, $subdomain, $user, $serverHost) { - if (! is_null($foundSubdomain) && ! is_null($user) && $foundSubdomain['user_id'] !== $user['id']){ + if (! is_null($foundSubdomain) && ! is_null($user) && $foundSubdomain['user_id'] !== $user['id']) { $message = config('expose.admin.messages.subdomain_reserved'); $message = str_replace(':subdomain', $subdomain, $message); diff --git a/app/Server/SubdomainRepository/DatabaseSubdomainRepository.php b/app/Server/SubdomainRepository/DatabaseSubdomainRepository.php index ce742dd..d540eeb 100644 --- a/app/Server/SubdomainRepository/DatabaseSubdomainRepository.php +++ b/app/Server/SubdomainRepository/DatabaseSubdomainRepository.php @@ -64,7 +64,7 @@ class DatabaseSubdomainRepository implements SubdomainRepository $this->database ->query('SELECT * FROM subdomains WHERE subdomain = :name AND domain = :domain', [ 'name' => $name, - 'domain' => $domain + 'domain' => $domain, ]) ->then(function (Result $result) use ($deferred) { $deferred->resolve($result->rows[0] ?? null);