apply more cs rules for php-cs

This commit is contained in:
2023-10-17 13:27:03 +02:00
parent 0b0cbed9db
commit bc2041cbdd
1485 changed files with 8169 additions and 9620 deletions

View File

@@ -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 => '']));
}
}
}