Code Duplication    Length = 11-11 lines in 2 locations

eZ/Publish/Core/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldValue/Handler.php 1 location

@@ 108-118 (lines=11) @@
105
                break;
106
107
            case Criterion\Operator::LIKE:
108
                if (strpos($criterion->value, '%') !== false) {
109
                    // @deprecated In 6.13.x/7.3.x and higher, to be removed in 8.0
110
                    @trigger_error(
111
                        "Usage of '%' in Operator::LIKE criteria with Legacy Search Engine was never intended, " .
112
                        "and is deprecated for removal in 8.0. Please use '*' like in FullText, works across engines",
113
                        E_USER_DEPRECATED
114
                    );
115
                    $value = $this->lowerCase($criterion->value);
116
                } else {
117
                    $value = str_replace('*', '%', $this->prepareLikeString($criterion->value));
118
                }
119
120
                $filter = $query->expr->like(
121
                    $column,

eZ/Publish/Core/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldValue/Handler/Collection.php 1 location

@@ 62-72 (lines=11) @@
59
60
        switch ($criterion->operator) {
61
            case Criterion\Operator::LIKE:
62
                if (strpos($criterion->value, '%') !== false) {
63
                    // @deprecated In 6.13.x/7.3.x and higher, to be removed in 8.0
64
                    @trigger_error(
65
                        "Usage of '%' in Operator::LIKE criteria with Legacy Search Engine was never intended, " .
66
                        "and is deprecated for removal in 8.0. Please use '*' like in FullText, works across engines",
67
                        E_USER_DEPRECATED
68
                    );
69
                    $value = $this->lowerCase($criterion->value);
70
                } else {
71
                    // Allow usage of * as wildcards in ::LIKE
72
                    $value = str_replace('*', '%', $this->prepareLikeString($criterion->value));
73
                }
74
                $singleValueExpr = 'like';
75
                // No break here, rest is handled by shared code with ::CONTAINS below