mirror of
https://codeberg.org/demostf/api.git
synced 2026-06-03 18:04:08 +02:00
extract chat handling
This commit is contained in:
parent
66d177e23a
commit
9c963fd3af
7 changed files with 149 additions and 29 deletions
|
|
@ -1,17 +1,18 @@
|
|||
<?php namespace Demostf\API\Controllers;
|
||||
|
||||
use Demostf\API\Providers\ChatProvider;
|
||||
use Demostf\API\Providers\DemoProvider;
|
||||
use Demostf\API\Providers\MatchProvider;
|
||||
|
||||
class DemoController extends BaseController {
|
||||
|
||||
/**
|
||||
* @var \Providers\DemoProvider
|
||||
*/
|
||||
/** @var DemoProvider */
|
||||
private $demoProvider;
|
||||
|
||||
public function __construct(DemoProvider $demoProvider) {
|
||||
/** @var ChatProvider */
|
||||
private $chatProvider;
|
||||
|
||||
public function __construct(DemoProvider $demoProvider, ChatProvider $chatProvider) {
|
||||
$this->demoProvider = $demoProvider;
|
||||
$this->chatProvider = $chatProvider;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -68,6 +69,6 @@ class DemoController extends BaseController {
|
|||
}
|
||||
|
||||
public function chat($demoId) {
|
||||
\Flight::json($this->demoProvider->getChat($demoId));
|
||||
\Flight::json($this->chatProvider->getChat($demoId));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue