Skip to content

Commit

Permalink
Document that EntityManager::flush() can throw Doctrine\DBAL\Exceptio…
Browse files Browse the repository at this point in the history
…n\UniqueConstraintViolationException
  • Loading branch information
VasekPurchart authored and ondrejmirtes committed Apr 5, 2022
1 parent f933284 commit 802cc56
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
2 changes: 2 additions & 0 deletions extension.neon
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ parameters:
- Doctrine\ORM\Query
stubFiles:
- stubs/Criteria.stub
- stubs/DBAL/Exception/UniqueConstraintViolationException.stub
- stubs/DocumentManager.stub
- stubs/DocumentRepository.stub
- stubs/EntityManager.stub
Expand All @@ -38,6 +39,7 @@ parameters:
- stubs/ORM/AbstractQuery.stub
- stubs/ORM/Mapping/ClassMetadata.stub
- stubs/ORM/Mapping/ClassMetadataInfo.stub
- stubs/ORM/ORMException.stub
- stubs/ORM/Query.stub
- stubs/Persistence/Mapping/ClassMetadata.stub
- stubs/ServiceDocumentRepository.stub
Expand Down
8 changes: 8 additions & 0 deletions stubs/DBAL/Exception/UniqueConstraintViolationException.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace Doctrine\DBAL\Exception;

class UniqueConstraintViolationException extends \Exception
{

}
9 changes: 9 additions & 0 deletions stubs/EntityManager.stub
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,13 @@ class EntityManager implements EntityManagerInterface
*/
public function copy($entity, $deep = false);

/**
* @param object|object[]|null $entity
* @return void
*
* @throws ORMException
* @throws \Doctrine\DBAL\Exception\UniqueConstraintViolationException
*/
public function flush($entity = null);

}
8 changes: 8 additions & 0 deletions stubs/ORM/ORMException.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace Doctrine\ORM;

class ORMException extends \Exception
{

}

0 comments on commit 802cc56

Please sign in to comment.