Code Duplication    Length = 5-5 lines in 6 locations

src/DataSource/DoctrineCollectionDataSource.php 1 location

@@ 181-185 (lines=5) @@
178
				continue;
179
			}
180
181
			if ($filter->hasSplitWordsSearch() === FALSE) {
182
				$words = [$value];
183
			} else {
184
				$words = explode(' ', $value);
185
			}
186
187
			foreach ($words as $word) {
188
				$exprs[] = Criteria::expr()->contains($column, $word);

src/DataSource/ArrayDataSource.php 1 location

@@ 164-168 (lines=5) @@
161
					return $row[$column] == $value;
162
				}
163
164
				if ($filter instanceof FilterText && $filter->hasSplitWordsSearch() === FALSE) {
165
					$words = [$value];
166
				} else {
167
					$words = explode(' ', $value);
168
				}
169
170
				$row_value = strtolower(Strings::toAscii($row[$column]));
171

src/DataSource/DibiFluentDataSource.php 1 location

@@ 179-183 (lines=5) @@
176
				continue;
177
			}
178
179
			if ($filter->hasSplitWordsSearch() === FALSE) {
180
				$words = [$value];
181
			} else {
182
				$words = explode(' ', $value);
183
			}
184
185
			foreach ($words as $word) {
186
				$escaped = $this->data_source->getConnection()->getDriver()->escapeLike($word, 0);

src/DataSource/DoctrineDataSource.php 1 location

@@ 242-246 (lines=5) @@
239
				continue;
240
			}
241
242
			if ($filter->hasSplitWordsSearch() === FALSE) {
243
				$words = [$value];
244
			} else {
245
				$words = explode(' ', $value);
246
			}
247
248
			foreach ($words as $word) {
249
				$exprs[] = $this->data_source->expr()->like($c, $this->data_source->expr()->literal("%$word%"));

src/DataSource/NetteDatabaseTableDataSource.php 1 location

@@ 184-188 (lines=5) @@
181
				$like .=  "$column = ? OR ";
182
				$args[] = "$value";
183
			} else {
184
				if ($filter->hasSplitWordsSearch() === FALSE) {
185
					$words = [$value];
186
				} else {
187
					$words = explode(' ', $value);
188
				}
189
				foreach ($words as $word) {
190
					$like .= "$column LIKE ? OR ";
191
					$args[] = "%$word%";

src/DataSource/NextrasDataSource.php 1 location

@@ 195-199 (lines=5) @@
192
				continue;
193
			}
194
195
			if ($filter->hasSplitWordsSearch() === FALSE) {
196
				$words = [$value];
197
			} else {
198
				$words = explode(' ', $value);
199
			}
200
201
			foreach ($words as $word) {
202
				$expr .= "%column LIKE %s OR ";