Code Duplication    Length = 8-8 lines in 2 locations

src/Handler/RotatingFileHandler.php 1 location

@@ 42-49 (lines=8) @@
39
        $this->rotationStartedAt = new DateTimeImmutable('now');
40
    }
41
42
    public function add(string $name, string $level, $message, array $context = []): void
43
    {
44
        // Format the message
45
        $data = $this->formatter->interpolate($name, $level, $message, $context);
46
47
        // Push it to file
48
        \file_put_contents($this->getRotatedFilename(), $data.PHP_EOL, FILE_APPEND);
49
    }
50
51
    /**
52
     * Return the file name appending the $this->rotationStartedAt.

src/Handler/FileHandler.php 1 location

@@ 26-33 (lines=8) @@
23
        $this->filename = $filename;
24
    }
25
26
    public function add(string $name, string $level, $message, array $context = []): void
27
    {
28
        // Format the message
29
        $data = $this->formatter->interpolate($name, $level, $message, $context);
30
31
        // Push it to file
32
        \file_put_contents($this->filename, $data.PHP_EOL, FILE_APPEND);
33
    }
34
}
35