| @@ 260-274 (lines=15) @@ | ||
| 257 | * | |
| 258 | * @return bool Whether or not $str contains $needle | |
| 259 | */ | |
| 260 | public function containsAll($needles, $caseSensitive = true) | |
| 261 |   { | |
| 262 | /** @noinspection IsEmptyFunctionUsageInspection */ | |
| 263 |     if (empty($needles)) { | |
| 264 | return false; | |
| 265 | } | |
| 266 | ||
| 267 |     foreach ($needles as $needle) { | |
| 268 |       if (!$this->contains($needle, $caseSensitive)) { | |
| 269 | return false; | |
| 270 | } | |
| 271 | } | |
| 272 | ||
| 273 | return true; | |
| 274 | } | |
| 275 | ||
| 276 | /** | |
| 277 | * Returns true if the string contains $needle, false otherwise. By default | |
| @@ 307-321 (lines=15) @@ | ||
| 304 | * | |
| 305 | * @return bool Whether or not $str contains $needle | |
| 306 | */ | |
| 307 | public function containsAny($needles, $caseSensitive = true) | |
| 308 |   { | |
| 309 | /** @noinspection IsEmptyFunctionUsageInspection */ | |
| 310 |     if (empty($needles)) { | |
| 311 | return false; | |
| 312 | } | |
| 313 | ||
| 314 |     foreach ($needles as $needle) { | |
| 315 |       if ($this->contains($needle, $caseSensitive)) { | |
| 316 | return true; | |
| 317 | } | |
| 318 | } | |
| 319 | ||
| 320 | return false; | |
| 321 | } | |
| 322 | ||
| 323 | /** | |
| 324 | * Returns the length of the string, implementing the countable interface. | |