Code Duplication    Length = 5-5 lines in 6 locations

src/DataSource/DoctrineDataSource.php 1 location

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

src/DataSource/ArrayDataSource.php 1 location

@@ 170-174 (lines=5) @@
167
					return $row[$column] == $value;
168
				}
169
170
				if ($filter instanceof FilterText && $filter->hasSplitWordsSearch() === FALSE) {
171
					$words = [$value];
172
				} else {
173
					$words = explode(' ', $value);
174
				}
175
176
				$row_value = strtolower(Strings::toAscii($row[$column]));
177

src/DataSource/DibiFluentDataSource.php 1 location

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

src/DataSource/DoctrineCollectionDataSource.php 1 location

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

src/DataSource/NetteDatabaseTableDataSource.php 1 location

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

src/DataSource/NextrasDataSource.php 1 location

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