Code Duplication    Length = 5-5 lines in 5 locations

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

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

src/DataSource/DoctrineCollectionDataSource.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
				$exprs[] = Criteria::expr()->contains($column, $word);

src/DataSource/NetteDatabaseTableDataSource.php 1 location

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

src/DataSource/DoctrineDataSource.php 1 location

@@ 255-259 (lines=5) @@
252
				continue;
253
			}
254
255
			if ($filter->hasSplitWordsSearch() === FALSE) {
256
				$words = [$value];
257
			} else {
258
				$words = explode(' ', $value);
259
			}
260
261
			foreach ($words as $word) {
262
				$exprs[] = $this->data_source->expr()->like($c, $this->data_source->expr()->literal("%$word%"));