Skip to content

Commit

Permalink
Merge pull request #10 from wayofdev/feat/save-entity
Browse files Browse the repository at this point in the history
feat: add remove method
  • Loading branch information
lotyp authored May 3, 2024
2 parents 9d3228d + ba5cd7f commit a7cfd02
Show file tree
Hide file tree
Showing 7 changed files with 136 additions and 96 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
"indent-style": "space"
},
"config-plugin": {
"bootstrap": "config/yii-bootstrap.php"
"bootstrap": "src/Bridge/Yii3/yii-bootstrap.php"
},
"laravel": {
"providers": [
Expand Down
190 changes: 96 additions & 94 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
</PossiblyUnusedMethod>
<PossiblyUnusedReturnValue>
<code><![CDATA[EntityManagerInterface]]></code>
<code><![CDATA[EntityManagerInterface]]></code>
</PossiblyUnusedReturnValue>
</file>
<file src="src/Bridge/Laravel/Providers/ActiveRecordProvider.php">
Expand Down
1 change: 0 additions & 1 deletion psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
</plugins>

<projectFiles>
<directory name="config/"/>
<directory name="src/"/>
<directory name="tests/"/>
<file name=".php-cs-fixer.dist.php"/>
Expand Down
14 changes: 14 additions & 0 deletions src/ActiveRecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,4 +160,18 @@ final public function deleteOrFail(bool $cascade = true): StateInterface

return $entityManager->run();
}

/**
* Prepares the current entity for deletion.
*
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
final public function remove(bool $cascade = true): EntityManagerInterface

Check warning on line 170 in src/ActiveRecord.php

View workflow job for this annotation

GitHub Actions / mutation-testing (ubuntu-latest, 8.2, locked)

Escaped Mutant for Mutator "TrueValue": --- Original +++ New @@ @@ * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface */ - public final function remove(bool $cascade = true) : EntityManagerInterface + public final function remove(bool $cascade = false) : EntityManagerInterface { /** @var EntityManager $entityManager */ $entityManager = Facade::getEntityManager();
{
/** @var EntityManager $entityManager */
$entityManager = Facade::getEntityManager();

return $entityManager->delete($this, $cascade);
}
}
File renamed without changes.
Loading

0 comments on commit a7cfd02

Please sign in to comment.