2025-01-31 18:20:13 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
2020-06-07 19:04:43 +03:00
|
|
|
namespace openvk\ServiceAPI;
|
2025-01-31 18:20:13 +03:00
|
|
|
|
2020-06-07 19:04:43 +03:00
|
|
|
use openvk\Web\Models\Entities\User;
|
|
|
|
use openvk\Web\Util\DateTime;
|
|
|
|
|
|
|
|
class Service implements Handler
|
|
|
|
{
|
|
|
|
protected $user;
|
2025-01-31 18:20:13 +03:00
|
|
|
|
|
|
|
public function __construct(?User $user)
|
2020-06-07 19:04:43 +03:00
|
|
|
{
|
|
|
|
$this->user = $user;
|
|
|
|
}
|
2025-01-31 18:20:13 +03:00
|
|
|
|
|
|
|
public function getTime(callable $resolve, callable $reject): void
|
2020-06-07 19:04:43 +03:00
|
|
|
{
|
2025-01-31 18:20:13 +03:00
|
|
|
$resolve(trim((new DateTime())->format("%e %B %G" . tr("time_at_sp") . "%X")));
|
2020-06-07 19:04:43 +03:00
|
|
|
}
|
2025-01-31 18:20:13 +03:00
|
|
|
|
|
|
|
public function getServerVersion(callable $resolve, callable $reject): void
|
2020-06-07 19:04:43 +03:00
|
|
|
{
|
|
|
|
$resolve("OVK " . OPENVK_VERSION);
|
|
|
|
}
|
|
|
|
}
|