Skip to content

Commit dbfacc0

Browse files
committed
refactor: break long lines
1 parent c36ce02 commit dbfacc0

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

system/Database/BaseBuilder.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2612,7 +2612,10 @@ protected function resetWrite()
26122612
*/
26132613
protected function hasOperator(string $str): bool
26142614
{
2615-
return (bool) preg_match('/(<|>|!|=|\sIS NULL|\sIS NOT NULL|\sEXISTS|\sBETWEEN|\sLIKE|\sIN\s*\(|\s)/i', trim($str));
2615+
return (bool) preg_match(
2616+
'/(<|>|!|=|\sIS NULL|\sIS NOT NULL|\sEXISTS|\sBETWEEN|\sLIKE|\sIN\s*\(|\s)/i',
2617+
trim($str)
2618+
);
26162619
}
26172620

26182621
/**
@@ -2623,7 +2626,9 @@ protected function hasOperator(string $str): bool
26232626
protected function getOperator(string $str, bool $list = false)
26242627
{
26252628
if (empty($this->pregOperators)) {
2626-
$_les = ($this->db->likeEscapeStr !== '') ? '\s+' . preg_quote(trim(sprintf($this->db->likeEscapeStr, $this->db->likeEscapeChar)), '/') : '';
2629+
$_les = ($this->db->likeEscapeStr !== '')
2630+
? '\s+' . preg_quote(trim(sprintf($this->db->likeEscapeStr, $this->db->likeEscapeChar)), '/')
2631+
: '';
26272632
$this->pregOperators = [
26282633
'\s*(?:<|>|!)?=\s*', // =, <=, >=, !=
26292634
'\s*<>?\s*', // <, <>
@@ -2640,7 +2645,11 @@ protected function getOperator(string $str, bool $list = false)
26402645
];
26412646
}
26422647

2643-
return preg_match_all('/' . implode('|', $this->pregOperators) . '/i', $str, $match) ? ($list ? $match[0] : $match[0][0]) : false;
2648+
return preg_match_all(
2649+
'/' . implode('|', $this->pregOperators) . '/i',
2650+
$str,
2651+
$match
2652+
) ? ($list ? $match[0] : $match[0][0]) : false;
26442653
}
26452654

26462655
/**

0 commit comments

Comments
 (0)