Code Duplication    Length = 17-17 lines in 2 locations

src/Offer/Security/Sapi3SearchQueryFactory.php 1 location

@@ 11-27 (lines=17) @@
8
/**
9
 * Implementation of the search query factory for SAPI3.
10
 */
11
class Sapi3SearchQueryFactory extends SearchQueryFactoryBase
12
{
13
    /**
14
     * @param StringLiteral $constraint
15
     * @param StringLiteral $offerId
16
     * @return string
17
     */
18
    protected function createQueryString(
19
        StringLiteral $constraint,
20
        StringLiteral $offerId
21
    ) {
22
        $constraintStr = '(' . strtolower($constraint->toNative()) . ')';
23
        $offerIdStr = $offerId->toNative();
24
25
        return '(' . $constraintStr . ' AND id:' . $offerIdStr . ')';
26
    }
27
}
28

src/Offer/Security/SearchQueryFactory.php 1 location

@@ 10-26 (lines=17) @@
7
/**
8
 * Implementation of the search query factory for SAPI2.
9
 */
10
class SearchQueryFactory extends SearchQueryFactoryBase
11
{
12
    /**
13
     * @param StringLiteral $constraint
14
     * @param StringLiteral $offerId
15
     * @return string
16
     */
17
    protected function createQueryString(
18
        StringLiteral $constraint,
19
        StringLiteral $offerId
20
    ) {
21
        $constraintStr = '(' . strtolower($constraint->toNative()) . ')';
22
        $offerIdStr = $offerId->toNative();
23
24
        return '(' . $constraintStr . ' AND cdbid:' . $offerIdStr . ')';
25
    }
26
}
27