Skip to content

feat: add AR::make() method #18

feat: add AR::make() method

feat: add AR::make() method #18

Triggered via pull request July 4, 2024 15:33
Status Success
Total duration 44s
Artifacts

testing.yml

on: pull_request
Matrix: arch-testing
Matrix: code-coverage
Matrix: mutation-testing
Fit to window
Zoom out
Zoom in

Annotations

10 warnings
mutation-testing (ubuntu-latest, 8.2, locked): 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();
mutation-testing (ubuntu-latest, 8.2, locked): 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.
mutation-testing (ubuntu-latest, 8.2, locked): 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();
mutation-testing (ubuntu-latest, 8.2, locked): 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); }
mutation-testing (ubuntu-latest, 8.2, locked): 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();
mutation-testing (ubuntu-latest, 8.2, locked): 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
mutation-testing (ubuntu-latest, 8.2, locked): 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();
mutation-testing (ubuntu-latest, 8.2, locked): 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); } }
mutation-testing (ubuntu-latest, 8.2, locked): 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 {
mutation-testing (ubuntu-latest, 8.2, locked): 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);