Code Duplication    Length = 8-9 lines in 2 locations

src/BenGorFile/File/Infrastructure/Domain/Model/InMemoryFilesystem.php 2 locations

@@ 70-77 (lines=8) @@
67
    /**
68
     * {@inheritdoc}
69
     */
70
    public function overwrite(FileName $aName, $aContent)
71
    {
72
        foreach ($this->files as $key => $file) {
73
            if ($file['filename'] === $aName->filename()) {
74
                $this->files[$key]['content'] = $aContent;
75
            }
76
        }
77
    }
78
79
    /**
80
     * {@inheritdoc}
@@ 107-115 (lines=9) @@
104
    /**
105
     * {@inheritdoc}
106
     */
107
    public function write(FileName $aName, $aContent)
108
    {
109
        foreach ($this->files as $key => $file) {
110
            if ($file['filename'] === $aName->filename()) {
111
                return;
112
            }
113
        }
114
        $this->files[] = ['filename' => $aName->filename(), 'content' => $aContent];
115
    }
116
}
117