20 lines
492 B
PHP
20 lines
492 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
declare(strict_types=1);
|
||
|
|
|
||
|
|
namespace Blax\WebRtc\Tests\Fixtures;
|
||
|
|
|
||
|
|
use Blax\WebRtc\Contracts\RoomAuthorizer;
|
||
|
|
|
||
|
|
/** Test authorizer that allows every join, returning fixed presence info. */
|
||
|
|
final class AllowAuthorizer implements RoomAuthorizer
|
||
|
|
{
|
||
|
|
/** @param array<string,mixed> $info */
|
||
|
|
public function __construct(private array $info = ['ok' => true]) {}
|
||
|
|
|
||
|
|
public function authorize(string $peerId, string $roomId, array $auth): ?array
|
||
|
|
{
|
||
|
|
return $this->info;
|
||
|
|
}
|
||
|
|
}
|