Skip to content

Commit

Permalink
Removing Exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
philipsorst committed Jun 23, 2019
1 parent 42e7d58 commit c6beb27
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 28 deletions.
12 changes: 0 additions & 12 deletions src/Exception/NoResultFoundException.php

This file was deleted.

12 changes: 0 additions & 12 deletions src/Exception/TooManyResultsException.php

This file was deleted.

3 changes: 2 additions & 1 deletion src/Service/EntityService.php
Expand Up @@ -2,6 +2,7 @@

namespace Dontdrinkandroot\Service;

use Doctrine\ORM\NoResultException;
use Dontdrinkandroot\Entity\EntityInterface;
use Dontdrinkandroot\Exception\NoResultFoundException;
use Dontdrinkandroot\Repository\EntityRepositoryInterface;
Expand Down Expand Up @@ -47,7 +48,7 @@ public function fetchById($id)
{
$entity = $this->findById($id);
if (null === $entity) {
throw new NoResultFoundException('No entity with id: ' . $id);
throw new NoResultException('No entity with id: ' . $id);
}

return $entity;
Expand Down
3 changes: 2 additions & 1 deletion src/Service/EntityServiceInterface.php
Expand Up @@ -2,6 +2,7 @@

namespace Dontdrinkandroot\Service;

use Doctrine\ORM\NoResultException;
use Doctrine\ORM\Tools\Pagination\Paginator;
use Dontdrinkandroot\Entity\EntityInterface;
use Dontdrinkandroot\Exception\NoResultFoundException;
Expand Down Expand Up @@ -37,7 +38,7 @@ public function findById($id);
*
* @return mixed
*
* @throws NoResultFoundException
* @throws NoResultException
*/
public function fetchById($id);

Expand Down
3 changes: 2 additions & 1 deletion src/Service/UuidEntityService.php
Expand Up @@ -2,6 +2,7 @@

namespace Dontdrinkandroot\Service;

use Doctrine\ORM\NoResultException;
use Dontdrinkandroot\Exception\NoResultFoundException;
use Dontdrinkandroot\Repository\UuidEntityRepositoryInterface;

Expand All @@ -19,7 +20,7 @@ public function fetchByUuid($uuid)
{
$entity = $this->findByUuid($uuid);
if (null === $entity) {
throw new NoResultFoundException('No entity with uuid: ' . $uuid);
throw new NoResultException('No entity with uuid: ' . $uuid);
}

return $entity;
Expand Down
3 changes: 2 additions & 1 deletion src/Service/UuidEntityServiceInterface.php
Expand Up @@ -2,6 +2,7 @@

namespace Dontdrinkandroot\Service;

use Doctrine\ORM\NoResultException;
use Dontdrinkandroot\Entity\UuidEntityInterface;
use Dontdrinkandroot\Exception\NoResultFoundException;

Expand All @@ -22,7 +23,7 @@ public function findByUuid($uuid);
*
* @return UuidEntityInterface
*
* @throws NoResultFoundException
* @throws NoResultException
*/
public function fetchByUuid($uuid);
}

0 comments on commit c6beb27

Please sign in to comment.