![]()
Nicolas Hart
Développeur Web chez TER'Informatique
@nclsHart



public function add($a, $b)
{
-    return $a + $b;
+    return $a - $b;
}

Inversion de condition :
- if ($a === $b) {
+ if ($a !== $b) {
Modification de valeur de retour :
- return $this;
+ return null;
Etc
Utilisation d'Infection

23 mutations were generated:
      19 mutants were killed
       0 mutants were not covered by tests
       4 covered mutants were not detected
       0 errors were encountered
       0 time outs were encountered
Metrics:
         Mutation Score Indicator (MSI): 82%
         Mutation Code Coverage: 100%
         Covered Code MSI: 82%
Time: 2s. Memory: 12.00MB
[M] MethodCallRemoval
--- Original
+++ New
@@ @@
 if ($this->fileExists($path)) {
     $entity = \Swift_Image::fromPath($path);
     $message->setChildren(array_merge($message->getChildren(), [$entity]));
-    $image->setAttribute('src', 'cid:' . $entity->getId());
+                    
 }
[M] ProtectedVisibility
--- Original
+++ New
@@ @@
-    protected function getPathFromSrc(string $src) : string
+    private function getPathFromSrc(string $src) : string
     {
         if ($this->isUrl($src)) {
             return $src;
19 mutations were generated:
      19 mutants were killed
       0 mutants were not covered by tests
       0 covered mutants were not detected
       0 errors were encountered
       0 time outs were encountered
Metrics:
         Mutation Score Indicator (MSI): 100%
         Mutation Code Coverage: 100%
         Covered Code MSI: 100%
Time: 2s. Memory: 12.00MB