mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-11-11 06:38:26 +00:00
apply more cs rules for php-cs
This commit is contained in:
@@ -11,12 +11,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace Chill\MainBundle\Search\Utils;
|
||||
|
||||
use DateTimeImmutable;
|
||||
|
||||
use function preg_match_all;
|
||||
use function strtr;
|
||||
use function trim;
|
||||
|
||||
class ExtractDateFromPattern
|
||||
{
|
||||
private const DATE_PATTERN = [
|
||||
@@ -32,15 +26,15 @@ class ExtractDateFromPattern
|
||||
|
||||
foreach (self::DATE_PATTERN as [$pattern, $format]) {
|
||||
$matches = [];
|
||||
preg_match_all($pattern, $filteredSubject, $matches);
|
||||
\preg_match_all($pattern, $filteredSubject, $matches);
|
||||
|
||||
foreach ($matches[0] as $match) {
|
||||
$date = DateTimeImmutable::createFromFormat($format, $match);
|
||||
$date = \DateTimeImmutable::createFromFormat($format, $match);
|
||||
|
||||
if (false !== $date) {
|
||||
$dates[] = $date;
|
||||
// filter string: remove what is found
|
||||
$filteredSubject = trim(strtr($filteredSubject, [$match => '']));
|
||||
$filteredSubject = \trim(\strtr($filteredSubject, [$match => '']));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user