WIP: Symfony 6 project remake #2

Draft
skobkin wants to merge 103 commits from symfony6_remake into master
4 changed files with 44 additions and 102 deletions
Showing only changes of commit 64855c5076 - Show all commits

View file

@ -1,65 +0,0 @@
<?php
namespace src\PointToolsBundle\Event;
use src\PointToolsBundle\Entity\User;
use Symfony\Component\EventDispatcher\Event;
/**
* Dispatched when user subscribers list was changed
*/
class UserSubscribersUpdatedEvent extends Event
{
const NAME = 'app.user.subscribers_updated';
/**
* @var User
*/
private $user;
/**
* @var User[]
*/
private $subscribed;
/**
* @var User[]
*/
private $unsubscribed;
/**
* @param User $user
* @param User[] $subscribed
* @param User[] $unsubscribed
*/
public function __construct(User $user, array $subscribed, array $unsubscribed)
{
$this->user = $user;
$this->subscribed = $subscribed;
$this->unsubscribed = $unsubscribed;
}
/**
* @return User
*/
public function getUser(): User
{
return $this->user;
}
/**
* @return User[]
*/
public function getSubscribedUsers(): array
{
return $this->subscribed;
}
/**
* @return User[]
*/
public function getUnsubscribedUsers(): array
{
return $this->unsubscribed;
}
}

View file

@ -1,37 +0,0 @@
<?php
namespace src\PointToolsBundle\Event;
use src\PointToolsBundle\Entity\UserRenameEvent;
use Symfony\Component\EventDispatcher\Event;
/**
* Dispatched when one or more users were renamed
*/
class UsersRenamedEvent extends Event
{
const NAME = 'app.users.renamed';
/**
* @var UserRenameEvent[]
*/
private $renames;
/**
* UsersRenamedEvent constructor.
*
* @param UserRenameEvent[] $renames
*/
public function __construct(array $renames)
{
$this->renames = $renames;
}
/**
* @return UserRenameEvent[]
*/
public function getRenames(): array
{
return $this->renames;
}
}

View file

@ -0,0 +1,25 @@
<?php
declare(strict_types=1);
namespace App\Event;
use App\Entity\User;
use Symfony\Contracts\EventDispatcher\Event;
/** Dispatched when user subscribers list was changed */
class UserSubscribersUpdatedEvent extends Event
{
const NAME = 'app.user.subscribers_updated';
/**
* @param User $user
* @param User[] $subscribed
* @param User[] $unsubscribed
*/
public function __construct(
public readonly User $user,
public readonly array $subscribed,
public readonly array $unsubscribed
) {
}
}

View file

@ -0,0 +1,19 @@
<?php
declare(strict_types=1);
namespace App\Event;
use App\Entity\UserRenameEvent;
use Symfony\Contracts\EventDispatcher\Event;
/** Dispatched when one or more users were renamed */
class UsersRenamedEvent extends Event
{
const NAME = 'app.users.renamed';
/** @param UserRenameEvent[] $renames */
public function __construct(
public readonly array $renames
) {
}
}