Skip to content

Commit

Permalink
Updated crud library (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
akadlec authored Aug 4, 2024
1 parent 8a68d77 commit d7fdb08
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 10 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"contributte/event-dispatcher": "^0.9",
"cweagans/composer-patches": "^1.7",
"fastybird/datetime-factory": "^0.6",
"ipub/doctrine-crud": "^4.0",
"ipub/doctrine-crud": "^5.0",
"ipub/doctrine-orm-query": "^0.1",
"ipub/slim-router": "^0.2.0",
"latte/latte" : "^3.0",
Expand Down
11 changes: 9 additions & 2 deletions src/Models/Policies/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ public function __construct(
{
}

/**
* @throws DoctrineCrudExceptions\EntityCreation
* @throws DoctrineCrudExceptions\InvalidArgument
* @throws DoctrineCrudExceptions\InvalidState
*/
public function create(Utils\ArrayHash $values): Entities\Policies\Policy
{
$entity = $this->getEntityCrud()->getEntityCreator()->create($values);
Expand All @@ -56,7 +61,8 @@ public function create(Utils\ArrayHash $values): Entities\Policies\Policy
}

/**
* @throws DoctrineCrudExceptions\InvalidArgumentException
* @throws DoctrineCrudExceptions\InvalidArgument
* @throws DoctrineCrudExceptions\InvalidState
*/
public function update(
Entities\Policies\Policy $entity,
Expand All @@ -70,7 +76,8 @@ public function update(
}

/**
* @throws DoctrineCrudExceptions\InvalidArgumentException
* @throws DoctrineCrudExceptions\InvalidArgument
* @throws DoctrineCrudExceptions\InvalidState
*/
public function delete(Entities\Policies\Policy $entity): bool
{
Expand Down
11 changes: 9 additions & 2 deletions src/Models/Tokens/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ public function __construct(
{
}

/**
* @throws DoctrineCrudExceptions\EntityCreation
* @throws DoctrineCrudExceptions\InvalidArgument
* @throws DoctrineCrudExceptions\InvalidState
*/
public function create(Utils\ArrayHash $values): Entities\Tokens\Token
{
$entity = $this->getEntityCrud()->getEntityCreator()->create($values);
Expand All @@ -56,7 +61,8 @@ public function create(Utils\ArrayHash $values): Entities\Tokens\Token
}

/**
* @throws DoctrineCrudExceptions\InvalidArgumentException
* @throws DoctrineCrudExceptions\InvalidArgument
* @throws DoctrineCrudExceptions\InvalidState
*/
public function update(
Entities\Tokens\Token $entity,
Expand All @@ -70,7 +76,8 @@ public function update(
}

/**
* @throws DoctrineCrudExceptions\InvalidArgumentException
* @throws DoctrineCrudExceptions\InvalidArgument
* @throws DoctrineCrudExceptions\InvalidState
*/
public function delete(Entities\Tokens\Token $entity): bool
{
Expand Down
4 changes: 3 additions & 1 deletion tests/cases/unit/Casbin/DatabaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ public function setUp(): void
/**
* @throws Casbin\Exceptions\CasbinException
* @throws DI\MissingServiceException
* @throws DoctrineCrudExceptions\InvalidArgumentException
* @throws DoctrineCrudExceptions\EntityCreation
* @throws DoctrineCrudExceptions\InvalidArgument
* @throws DoctrineCrudExceptions\InvalidState
* @throws DoctrineOrmQueryExceptions\InvalidStateException
* @throws DoctrineOrmQueryExceptions\QueryException
* @throws Exceptions\InvalidState
Expand Down
8 changes: 6 additions & 2 deletions tests/cases/unit/Models/PoliciesRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ public function setUp(): void

/**
* @throws DI\MissingServiceException
* @throws DoctrineCrudExceptions\InvalidArgumentException
* @throws DoctrineCrudExceptions\EntityCreation
* @throws DoctrineCrudExceptions\InvalidArgument
* @throws DoctrineCrudExceptions\InvalidState
* @throws DoctrineOrmQueryExceptions\InvalidStateException
* @throws DoctrineOrmQueryExceptions\QueryException
* @throws DoctrineCrudExceptions\InvalidArgumentException
* @throws ORM\Tools\ToolsException
*/
public function testPolicyEntity(): void
Expand Down Expand Up @@ -88,6 +89,9 @@ public function testPolicyEntity(): void

/**
* @throws DI\MissingServiceException
* @throws DoctrineCrudExceptions\EntityCreation
* @throws DoctrineCrudExceptions\InvalidArgument
* @throws DoctrineCrudExceptions\InvalidState
* @throws Exceptions\InvalidState
* @throws ORM\Tools\ToolsException
*/
Expand Down
5 changes: 3 additions & 2 deletions tests/cases/unit/Models/TokensRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ final class TokensRepositoryTest extends BaseTestCase

/**
* @throws DI\MissingServiceException
* @throws DoctrineCrudExceptions\InvalidArgumentException
* @throws DoctrineCrudExceptions\EntityCreation
* @throws DoctrineCrudExceptions\InvalidArgument
* @throws DoctrineCrudExceptions\InvalidState
* @throws DoctrineOrmQueryExceptions\InvalidStateException
* @throws DoctrineOrmQueryExceptions\QueryException
* @throws DoctrineCrudExceptions\InvalidArgumentException
* @throws ORM\Tools\ToolsException
*/
public function testTokenEntity(): void
Expand Down

0 comments on commit d7fdb08

Please sign in to comment.