Code Duplication    Length = 18-18 lines in 2 locations

src/Mathielen/ImportEngine/Importer/ImporterPrecondition.php 2 locations

@@ 104-121 (lines=18) @@
101
        return true;
102
    }
103
104
    private function isSatisfiedFilename($filename, LoggerInterface $logger = null)
105
    {
106
        if (empty($this->filenames)) {
107
            return true;
108
        }
109
110
        foreach ($this->filenames as $pattern) {
111
            if (preg_match("/$pattern/i", $filename)) {
112
                return true;
113
            }
114
        }
115
116
        if ($logger) {
117
            $logger->debug("Storage does not meet Preconditions due to filename restriction. Was $filename, should be one of " . join(',', $this->filenames));
118
        }
119
120
        return false;
121
    }
122
123
    private function isSatisfiedFormat(Format $format, LoggerInterface $logger = null)
124
    {
@@ 123-140 (lines=18) @@
120
        return false;
121
    }
122
123
    private function isSatisfiedFormat(Format $format, LoggerInterface $logger = null)
124
    {
125
        if (empty($this->formats)) {
126
            return true;
127
        }
128
129
        foreach ($this->formats as $formatId) {
130
            if ($formatId == $format->getId()) {
131
                return true;
132
            }
133
        }
134
135
        if ($logger) {
136
            $logger->debug("Storage does not meet Preconditions due to format restriction. Was $format, should be one of " . join(',', $this->formats));
137
        }
138
139
        return false;
140
    }
141
142
    private function isSatisfiedFieldcount($fieldCount, LoggerInterface $logger = null)
143
    {