WIP: Symfony 6 project remake #2

Draft
skobkin wants to merge 103 commits from symfony6_remake into master
3 changed files with 18 additions and 26 deletions
Showing only changes of commit c151acd30b - Show all commits

View file

@ -1,25 +0,0 @@
<?php
namespace src\PointToolsBundle\Exception\Factory;
use src\PointToolsBundle\DTO\Api\User as UserDTO;
class InvalidUserDataException extends \Exception
{
/**
* @var UserDTO
*/
private $user;
public function __construct($message = "", UserDTO $user, $code = 0, \Exception $previous = null)
{
$this->user = $user;
parent::__construct($message, $code, $previous);
}
public function getUser(): UserDTO
{
return $this->user;
}
}

View file

@ -0,0 +1,17 @@
<?php
declare(strict_types=1);
namespace App\Exception\Factory;
use App\DTO\Api\User as UserDTO;
class InvalidUserDataException extends \Exception
{
public function __construct(
public readonly UserDTO $user,
$code = 0,
\Exception $previous = null
) {
parent::__construct('Invalid user data', $code, $previous);
}
}

View file

@ -25,7 +25,7 @@ class UserFactory extends AbstractFactory
// @todo LOG // @todo LOG
if (!$userData->isValid()) { if (!$userData->isValid()) {
throw new InvalidUserDataException('Invalid user data', $userData); throw new InvalidUserDataException($userData);
} }
/** @var User $user */ /** @var User $user */