Skip to content

Commit

Permalink
Fix: preg_match(): Argument pimcore#2 ($subject) must be of type stri…
Browse files Browse the repository at this point in the history
…ng, bool given
  • Loading branch information
blankse committed Jul 19, 2023
1 parent 703a485 commit b74f8de
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions models/DataObject/ClassDefinition/Data.php
Expand Up @@ -917,12 +917,12 @@ public function getFilterCode(): string

$dataParamDoc = 'mixed $data';
$reflectionMethod = new \ReflectionMethod($this, 'addListingFilter');
if (preg_match('/@param\s+([^\s]+)\s+\$data(.*)/', $reflectionMethod->getDocComment(), $dataParam)) {
if ($reflectionMethod->getDocComment() && preg_match('/@param\s+([^\s]+)\s+\$data(.*)/', $reflectionMethod->getDocComment(), $dataParam)) {
$dataParamDoc = $dataParam[1].' $data '.$dataParam[2];
}

$operatorParamDoc = 'string $operator SQL comparison operator, e.g. =, <, >= etc. You can use "?" as placeholder, e.g. "IN (?)"';
if (preg_match('/@param\s+([^\s]+)\s+\$operator(.*)/', $reflectionMethod->getDocComment(), $dataParam)) {
if ($reflectionMethod->getDocComment() && preg_match('/@param\s+([^\s]+)\s+\$operator(.*)/', $reflectionMethod->getDocComment(), $dataParam)) {
$operatorParamDoc = $dataParam[1].' $operator '.$dataParam[2];
}

Expand Down

0 comments on commit b74f8de

Please sign in to comment.