Support: Remove some commented code and make code a little more consistent with the code style

This commit is contained in:
Maxim Leshchenko 2022-05-20 15:16:39 +01:00
parent 12210d0fb0
commit 0818e507a8
No known key found for this signature in database
GPG key ID: BB9C44A8733FBEEE
2 changed files with 3 additions and 31 deletions

View file

@ -1,8 +1,5 @@
<?php declare(strict_types=1);
namespace openvk\Web\Models\Repositories;
# use openvk\Web\Models\Entities\Ticket;
# use openvk\Web\Models\Entities\User;
# use openvk\Web\Models\Repositories\Users;
use openvk\Web\Models\Entities\TicketComment;
use Chandler\Database\DatabaseConnection;
@ -21,32 +18,6 @@ class TicketComments
{
foreach($this->comments->where(['ticket_id' => $ticket_id, 'deleted' => 0]) as $comment) yield new TicketComment($comment);
}
# private function toTicket(?ActiveRow $ar): ?Ticket
# {
# return is_null($ar) ? NULL : new Ticket($ar);
# }
# function getTicketsByuId(int $user_id): \Traversable
# {
# foreach($this->tickets->where(['user_id' => $user_id, 'deleted' => 0]) as $ticket) yield new Ticket($ticket);
# }
# function getRequestById(int $req_id): ?Ticket
# {
# $requests = $this->tickets->where(['id' => $req_id])->fetch();
# if(!is_null($requests))
# return new Req($requests);
# else
# return null;
# }
# function get(int $id): ?Ticket
# {
# return $this->toTicket($this->tickets->get($id));
# }
function get(int $id): ?TicketComment
{

View file

@ -79,12 +79,13 @@ final class SupportPresenter extends OpenVKPresenter
$act = $this->queryParam("act") ?? "open";
switch($act) {
default:
# NOTICE falling through
case "open":
$state = 0;
break;
break;
case "answered":
$state = 1;
break;
break;
case "closed":
$state = 2;
}