Skip to content

Commit 9e3dba3

Browse files
committed
Fix preg_match calls
1 parent 3689b3d commit 9e3dba3

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

bundle/Command/BaseMultiprocessCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ protected function getNumberOfCPUCores(): int
418418
} elseif (($process = @popen('sysctl -a', 'rb')) !== false) {
419419
// *nix (Linux, BSD and Mac)
420420
$output = (string) stream_get_contents($process);
421-
if (preg_match('/hw.ncpu: (\d+)/', $output, $matches) !== false) {
421+
if (preg_match('/hw.ncpu: (\d+)/', $output, $matches) === 1) {
422422
$cores = (int) $matches[1];
423423
}
424424
pclose($process);

bundle/OpenGraph/Handler/SiteImage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function getMetaTags(string $tagName, array $params = []): array
5454

5555
$request = $this->requestStack->getCurrentRequest();
5656

57-
if ($request instanceof Request && preg_match('/^https?:\/\//', $siteImage) === false) {
57+
if ($request instanceof Request && preg_match('/^https?:\/\//', $siteImage) !== 1) {
5858
$siteImage = $request->getUriForPath('/' . ltrim($siteImage, '/'));
5959
}
6060

bundle/Templating/Twig/Extension/SiteRuntime.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public function groupFields(Content $content, string $prefix): array
107107
$groupedFields = [];
108108

109109
foreach ($content->fields as $field) {
110-
if (preg_match($regex, $field->fieldDefIdentifier, $matches) !== false) {
110+
if (preg_match($regex, $field->fieldDefIdentifier, $matches) === 1) {
111111
$groupedFields[$matches[self::GROUP_FIELDS_GROUP]][$matches[self::GROUP_FIELDS_FIELD]] = $field;
112112
}
113113
}

0 commit comments

Comments
 (0)