nitpicks
This commit is contained in:
parent
74e78f4a19
commit
ad2e5560e3
|
|
@ -51,8 +51,4 @@ class Client
|
||||||
|
|
||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -5,9 +5,10 @@ namespace BeyondCode\LaravelWebSockets\ClientProviders;
|
||||||
|
|
||||||
interface ClientProvider
|
interface ClientProvider
|
||||||
{
|
{
|
||||||
|
/** @return array[BeyondCode\LaravelWebSockets\ClientProviders\Client] */
|
||||||
|
public function all(): array;
|
||||||
|
|
||||||
public function findByAppId(int $appId): ?Client;
|
public function findByAppId(int $appId): ?Client;
|
||||||
|
|
||||||
public function findByAppKey(string $appKey): ?Client;
|
public function findByAppKey(string $appKey): ?Client;
|
||||||
|
|
||||||
public function all(): array;
|
|
||||||
}
|
}
|
||||||
|
|
@ -6,6 +6,15 @@ use Illuminate\Support\Collection;
|
||||||
|
|
||||||
class ConfigClientProvider implements ClientProvider
|
class ConfigClientProvider implements ClientProvider
|
||||||
{
|
{
|
||||||
|
/** @return array[BeyondCode\LaravelWebSockets\ClientProviders\Client] */
|
||||||
|
public function all(): array
|
||||||
|
{
|
||||||
|
return $this->allClients()
|
||||||
|
->map(function ($client) {
|
||||||
|
return $this->instanciate($client);
|
||||||
|
})
|
||||||
|
->toArray();
|
||||||
|
}
|
||||||
public function findByAppId(int $appId): ?Client
|
public function findByAppId(int $appId): ?Client
|
||||||
{
|
{
|
||||||
$clientAttributes = $this
|
$clientAttributes = $this
|
||||||
|
|
@ -24,14 +33,7 @@ class ConfigClientProvider implements ClientProvider
|
||||||
return $this->instanciate($clientAttributes);
|
return $this->instanciate($clientAttributes);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function all(): array
|
|
||||||
{
|
|
||||||
return $this->allClients()
|
|
||||||
->map(function ($client) {
|
|
||||||
return $this->instanciate($client);
|
|
||||||
})
|
|
||||||
->toArray();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function allClients(): Collection
|
protected function allClients(): Collection
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue