feat: add AR::make() method #18
Annotations
10 warnings
src/ActiveRecord.php#L92
Escaped Mutant for Mutator "TrueValue":
--- Original
+++ New
@@ @@
*
* @throws \Throwable
*/
- public final function save(bool $cascade = true) : StateInterface
+ public final function save(bool $cascade = false) : StateInterface
{
/** @var EntityManager $entityManager */
$entityManager = Facade::getEntityManager();
|
src/ActiveRecord.php#L98
Escaped Mutant for Mutator "FalseValue":
--- Original
+++ New
@@ @@
/** @var EntityManager $entityManager */
$entityManager = Facade::getEntityManager();
$entityManager->persist($this, $cascade);
- return $entityManager->run(throwException: false);
+ return $entityManager->run(throwException: true);
}
/**
* Persists the current entity and throws an exception if an error occurs.
|
src/ActiveRecord.php#L106
Escaped Mutant for Mutator "TrueValue":
--- Original
+++ New
@@ @@
*
* @throws \Throwable
*/
- public final function saveOrFail(bool $cascade = true) : StateInterface
+ public final function saveOrFail(bool $cascade = false) : StateInterface
{
/** @var EntityManager $entityManager */
$entityManager = Facade::getEntityManager();
|
src/ActiveRecord.php#L115
Escaped Mutant for Mutator "TrueValue":
--- Original
+++ New
@@ @@
$entityManager->persist($this, $cascade);
return $entityManager->run();
}
- public final function persist(bool $cascade = true) : EntityManagerInterface
+ public final function persist(bool $cascade = false) : EntityManagerInterface
{
return Facade::getEntityManager()->persist($this, $cascade);
}
|
src/ActiveRecord.php#L123
Escaped Mutant for Mutator "TrueValue":
--- Original
+++ New
@@ @@
/**
* @throws \Throwable
*/
- public final function delete(bool $cascade = true) : StateInterface
+ public final function delete(bool $cascade = false) : StateInterface
{
/** @var EntityManager $entityManager */
$entityManager = Facade::getEntityManager();
|
src/ActiveRecord.php#L129
Escaped Mutant for Mutator "FalseValue":
--- Original
+++ New
@@ @@
/** @var EntityManager $entityManager */
$entityManager = Facade::getEntityManager();
$entityManager->delete($this, $cascade);
- return $entityManager->run(throwException: false);
+ return $entityManager->run(throwException: true);
}
/**
* @throws \Throwable
|
src/ActiveRecord.php#L147
Escaped Mutant for Mutator "TrueValue":
--- Original
+++ New
@@ @@
/**
* Prepares the current entity for deletion.
*/
- public final function remove(bool $cascade = true) : EntityManagerInterface
+ public final function remove(bool $cascade = false) : EntityManagerInterface
{
/** @var EntityManager $entityManager */
$entityManager = Facade::getEntityManager();
|
src/Bridge/Spiral/Bootloader/ActiveRecordBootloader.php#L21
Escaped Mutant for Mutator "PublicVisibility":
--- Original
+++ New
@@ @@
{
return [CycleOrmBootloader::class];
}
- public function init(ContainerInterface $container) : void
+ protected function init(ContainerInterface $container) : void
{
Facade::setContainer($container);
}
}
|
src/Facade.php#L40
Escaped Mutant for Mutator "AssignCoalesce":
--- Original
+++ New
@@ @@
*/
public static function getOrm() : ORMInterface
{
- return self::$orm ??= self::getFromContainer(ORMInterface::class);
+ return self::$orm = self::getFromContainer(ORMInterface::class);
}
public static function getEntityManager() : EntityManagerInterface
{
|
src/Facade.php#L70
Escaped Mutant for Mutator "Concat":
--- Original
+++ New
@@ @@
private static function getFromContainer(string $class) : object
{
// Check if container is set
- self::$container === null and throw new ConfigurationException(\sprintf('Container has not been set. Please set the container first using %s method.', self::class . '::setContainer()'));
+ self::$container === null and throw new ConfigurationException(\sprintf('Container has not been set. Please set the container first using %s method.', '::setContainer()' . self::class));
// Pull service from container
try {
return self::$container->get($class);
|
This job succeeded
Loading