Ported DailyEvents and TopUserDTO.

This commit is contained in:
Alexey Skobkin 2023-03-28 22:45:11 +03:00
parent fd8161c9e1
commit b7e2cbc630
No known key found for this signature in database
GPG key ID: 5D5CEF6F221278E7
4 changed files with 31 additions and 70 deletions

View file

@ -1,35 +0,0 @@
<?php
namespace src\PointToolsBundle\DTO;
/**
* Events count by day
*/
class DailyEvents
{
/**
* @var \DateTime
*/
private $date;
/**
* @var int
*/
private $eventsCount;
public function __construct(string $date, int $eventsCount)
{
$this->date = new \DateTime($date);
$this->eventsCount = $eventsCount;
}
public function getDate(): \DateTime
{
return $this->date;
}
public function getEventsCount(): int
{
return $this->eventsCount;
}
}

View file

@ -1,35 +0,0 @@
<?php
namespace src\PointToolsBundle\DTO;
/**
* Data Transfer Object for top users list
*/
class TopUserDTO
{
/**
* @var string
*/
private $login;
/**
* @var int
*/
private $subscribersCount;
public function __construct(string $login, int $subscribersCount)
{
$this->login = $login;
$this->subscribersCount = $subscribersCount;
}
public function getLogin(): string
{
return $this->login;
}
public function getSubscribersCount(): int
{
return $this->subscribersCount;
}
}

View file

@ -0,0 +1,17 @@
<?php
declare(strict_types=1);
namespace App\DTO;
/** Events count by day */
class DailyEventsDTO
{
public readonly \DateTime $date;
public function __construct(
string $date,
public readonly int $eventsCount,
) {
$this->date = new \DateTime($date);
}
}

14
src/DTO/TopUserDTO.php Normal file
View file

@ -0,0 +1,14 @@
<?php
declare(strict_types=1);
namespace App\DTO;
/** Data Transfer Object for top users list */
class TopUserDTO
{
public function __construct(
public readonly string $login,
public readonly int $subscribersCount,
) {
}
}