laravel-websockets/src/Contracts/AppManager.php

49 lines
968 B
PHP
Raw Normal View History

2018-12-01 12:57:02 +00:00
<?php
2020-09-10 19:59:26 +00:00
namespace BeyondCode\LaravelWebSockets\Contracts;
use BeyondCode\LaravelWebSockets\Apps\App;
use React\Promise\PromiseInterface;
2018-12-01 12:57:02 +00:00
2020-08-13 11:51:18 +00:00
interface AppManager
2018-12-01 12:57:02 +00:00
{
2020-08-18 17:21:44 +00:00
/**
2020-08-18 17:21:22 +00:00
* Get all apps.
*
* @return PromiseInterface
2020-08-18 17:21:22 +00:00
*/
public function all(): PromiseInterface;
2018-12-01 12:57:02 +00:00
2020-08-18 17:21:22 +00:00
/**
* Get app by id.
*
2020-09-04 13:23:24 +00:00
* @param string|int $appId
* @return PromiseInterface
2020-08-18 17:21:22 +00:00
*/
public function findById($appId): PromiseInterface;
2018-12-01 12:57:02 +00:00
2020-08-18 17:21:22 +00:00
/**
* Get app by app key.
*
2020-09-04 01:10:50 +00:00
* @param string $appKey
* @return PromiseInterface
2020-08-18 17:21:22 +00:00
*/
public function findByKey($appKey): PromiseInterface;
2018-12-04 09:15:37 +00:00
2020-08-18 17:21:22 +00:00
/**
* Get app by secret.
*
2020-09-04 01:10:50 +00:00
* @param string $appSecret
* @return PromiseInterface
2020-08-18 17:21:22 +00:00
*/
public function findBySecret($appSecret): PromiseInterface;
/**
* Create a new app.
*
2024-02-07 17:30:54 +00:00
* @param $appData
* @return PromiseInterface
*/
public function createApp($appData): PromiseInterface;
2018-12-04 21:22:33 +00:00
}