Ported Exception\Factory\Blog\*.
This commit is contained in:
parent
c151acd30b
commit
c7256f5a50
|
@ -1,8 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace src\PointToolsBundle\Exception\Factory\Blog;
|
|
||||||
|
|
||||||
class FactoryException extends \Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,10 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace src\PointToolsBundle\Exception\Factory\Blog;
|
|
||||||
|
|
||||||
use src\PointToolsBundle\Exception\Factory\Blog\FactoryException;
|
|
||||||
|
|
||||||
class InvalidDataException extends FactoryException
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
|
@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
9
src/Exception/Factory/Blog/FactoryException.php
Normal file
9
src/Exception/Factory/Blog/FactoryException.php
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<?php
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Exception\Factory\Blog;
|
||||||
|
|
||||||
|
class FactoryException extends \Exception
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
9
src/Exception/Factory/Blog/InvalidDataException.php
Normal file
9
src/Exception/Factory/Blog/InvalidDataException.php
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<?php
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Exception\Factory\Blog;
|
||||||
|
|
||||||
|
class InvalidDataException extends FactoryException
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
17
src/Exception/Factory/Blog/InvalidPostDataException.php
Normal file
17
src/Exception/Factory/Blog/InvalidPostDataException.php
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue