Skip to content

Commit

Permalink
regexp: \z replaced with D modifier
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Jul 11, 2019
1 parent 5891443 commit 14164e1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Utils/Finder.php
Expand Up @@ -164,7 +164,7 @@ private static function buildPattern(array $masks): ?string
$pattern[] = $prefix . strtr(preg_quote($mask, '#'), $pattern[] = $prefix . strtr(preg_quote($mask, '#'),
['\*\*' => '.*', '\*' => '[^/]*', '\?' => '[^/]', '\[\!' => '[^', '\[' => '[', '\]' => ']', '\-' => '-']); ['\*\*' => '.*', '\*' => '[^/]*', '\?' => '[^/]', '\[\!' => '[^', '\[' => '[', '\]' => ']', '\-' => '-']);
} }
return $pattern ? '#/(' . implode('|', $pattern) . ')\z#i' : null; return $pattern ? '#/(' . implode('|', $pattern) . ')$#Di' : null;
} }




Expand Down Expand Up @@ -299,7 +299,7 @@ public function limitDepth(int $depth): self
public function size(string $operator, int $size = null): self public function size(string $operator, int $size = null): self
{ {
if (func_num_args() === 1) { // in $operator is predicate if (func_num_args() === 1) { // in $operator is predicate
if (!preg_match('#^(?:([=<>!]=?|<>)\s*)?((?:\d*\.)?\d+)\s*(K|M|G|)B?\z#i', $operator, $matches)) { if (!preg_match('#^(?:([=<>!]=?|<>)\s*)?((?:\d*\.)?\d+)\s*(K|M|G|)B?$#Di', $operator, $matches)) {
throw new Nette\InvalidArgumentException('Invalid size predicate format.'); throw new Nette\InvalidArgumentException('Invalid size predicate format.');
} }
[, $operator, $size, $unit] = $matches; [, $operator, $size, $unit] = $matches;
Expand All @@ -322,7 +322,7 @@ public function size(string $operator, int $size = null): self
public function date(string $operator, $date = null): self public function date(string $operator, $date = null): self
{ {
if (func_num_args() === 1) { // in $operator is predicate if (func_num_args() === 1) { // in $operator is predicate
if (!preg_match('#^(?:([=<>!]=?|<>)\s*)?(.+)\z#i', $operator, $matches)) { if (!preg_match('#^(?:([=<>!]=?|<>)\s*)?(.+)$#Di', $operator, $matches)) {
throw new Nette\InvalidArgumentException('Invalid date predicate format.'); throw new Nette\InvalidArgumentException('Invalid date predicate format.');
} }
[, $operator, $date] = $matches; [, $operator, $date] = $matches;
Expand Down

0 comments on commit 14164e1

Please sign in to comment.