Ported Exception\Factory\Blog\*.

This commit is contained in:
Alexey Skobkin 2023-04-01 19:30:48 +03:00
parent c151acd30b
commit c7256f5a50
No known key found for this signature in database
GPG key ID: 5D5CEF6F221278E7
6 changed files with 35 additions and 44 deletions

View file

@ -1,8 +0,0 @@
<?php
namespace src\PointToolsBundle\Exception\Factory\Blog;
class FactoryException extends \Exception
{
}

View file

@ -1,10 +0,0 @@
<?php
namespace src\PointToolsBundle\Exception\Factory\Blog;
use src\PointToolsBundle\Exception\Factory\Blog\FactoryException;
class InvalidDataException extends FactoryException
{
}

View file

@ -1,26 +0,0 @@
<?php
namespace src\PointToolsBundle\Exception\Factory\Blog;
use src\PointToolsBundle\DTO\Api\Post;
use src\PointToolsBundle\Exception\Factory\Blog\InvalidDataException;
class InvalidPostDataException extends InvalidDataException
{
/**
* @var Post
*/
private $post;
public function __construct($message = '', Post $post, $code = 0, \Exception $previous = null)
{
$this->post = $post;
parent::__construct($message, $code, $previous);
}
public function getPost(): Post
{
return $this->post;
}
}

View file

@ -0,0 +1,9 @@
<?php
declare(strict_types=1);
namespace App\Exception\Factory\Blog;
class FactoryException extends \Exception
{
}

View file

@ -0,0 +1,9 @@
<?php
declare(strict_types=1);
namespace App\Exception\Factory\Blog;
class InvalidDataException extends FactoryException
{
}

View file

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