| Conditions | 10 | 
| Paths | 44 | 
| Total Lines | 43 | 
| Code Lines | 25 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Changes | 0 | ||
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php  | 
            ||
| 45 | public function build(LikeConditionInterface $expression, array &$params = []): string  | 
            ||
| 46 |     { | 
            ||
| 47 | $operator = strtoupper($expression->getOperator());  | 
            ||
| 48 | $column = $expression->getColumn();  | 
            ||
| 49 | $values = $expression->getValue();  | 
            ||
| 50 | $escape = $expression->getEscapingReplacements();  | 
            ||
| 51 | |||
| 52 |         if ($escape === []) { | 
            ||
| 53 | $escape = $this->escapingReplacements;  | 
            ||
| 54 | }  | 
            ||
| 55 | |||
| 56 | [$andor, $not, $operator] = $this->parseOperator($operator);  | 
            ||
| 57 | |||
| 58 |         if (!is_array($values)) { | 
            ||
| 59 | $values = [$values];  | 
            ||
| 60 | }  | 
            ||
| 61 | |||
| 62 |         if (empty($values)) { | 
            ||
| 63 | return $not ? '' : '0=1';  | 
            ||
| 64 | }  | 
            ||
| 65 | |||
| 66 |         if ($column instanceof ExpressionInterface) { | 
            ||
| 67 | $column = $this->queryBuilder->buildExpression($column, $params);  | 
            ||
| 68 |         } elseif (!str_contains($column, '(')) { | 
            ||
| 69 | $column = $this->queryBuilder->quoter()->quoteColumnName($column);  | 
            ||
| 70 | }  | 
            ||
| 71 | |||
| 72 | $parts = [];  | 
            ||
| 73 | |||
| 74 | /** @psalm-var string[] $values */  | 
            ||
| 75 |         foreach ($values as $value) { | 
            ||
| 76 |             if ($value instanceof ExpressionInterface) { | 
            ||
| 77 | $phName = $this->queryBuilder->buildExpression($value, $params);  | 
            ||
| 78 |             } else { | 
            ||
| 79 | $phName = $this->queryBuilder->bindParam(  | 
            ||
| 80 |                     $escape === null ? $value : ('%' . strtr($value, $escape) . '%'), | 
            ||
| 81 | $params  | 
            ||
| 82 | );  | 
            ||
| 83 | }  | 
            ||
| 84 |             $parts[] = "{$column} {$operator} {$phName}{$this->escapeSql}"; | 
            ||
| 85 | }  | 
            ||
| 86 | |||
| 87 | return implode($andor, $parts);  | 
            ||
| 88 | }  | 
            ||
| 108 |