2024-09-13 13:50:50 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Socialbox\Enums;
|
|
|
|
|
|
|
|
use Socialbox\Classes\StandardMethods\CreateSession;
|
2024-12-10 13:30:08 -05:00
|
|
|
use Socialbox\Classes\StandardMethods\Identify;
|
2024-10-31 19:13:05 -04:00
|
|
|
use Socialbox\Classes\StandardMethods\VerificationAnswerImageCaptcha;
|
|
|
|
use Socialbox\Classes\StandardMethods\VerificationGetImageCaptcha;
|
2024-10-30 15:27:46 -04:00
|
|
|
use Socialbox\Classes\StandardMethods\GetMe;
|
2024-09-13 13:50:50 -04:00
|
|
|
use Socialbox\Classes\StandardMethods\Ping;
|
2024-10-30 15:27:46 -04:00
|
|
|
use Socialbox\Classes\StandardMethods\Register;
|
2024-09-24 15:02:02 -04:00
|
|
|
use Socialbox\Exceptions\StandardException;
|
2024-09-13 13:50:50 -04:00
|
|
|
use Socialbox\Interfaces\SerializableInterface;
|
|
|
|
use Socialbox\Objects\ClientRequest;
|
2024-12-12 04:33:10 -05:00
|
|
|
use Socialbox\Objects\ClientRequestOld;
|
2024-09-13 13:50:50 -04:00
|
|
|
use Socialbox\Objects\RpcRequest;
|
|
|
|
|
|
|
|
enum StandardMethods : string
|
|
|
|
{
|
|
|
|
case PING = 'ping';
|
|
|
|
|
2024-09-24 15:02:02 -04:00
|
|
|
/**
|
|
|
|
* @param ClientRequest $request
|
|
|
|
* @param RpcRequest $rpcRequest
|
|
|
|
* @return SerializableInterface|null
|
|
|
|
* @throws StandardException
|
|
|
|
*/
|
2024-09-13 13:50:50 -04:00
|
|
|
public function execute(ClientRequest $request, RpcRequest $rpcRequest): ?SerializableInterface
|
|
|
|
{
|
|
|
|
return match ($this)
|
|
|
|
{
|
|
|
|
self::PING => Ping::execute($request, $rpcRequest),
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|