Passed
Push — master ( 5adbd6...5901ba )
by Timo
20:55
created

DefaultUrlDecoder::decode()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 2
crap 1
1
<?php
2
namespace ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\Facets;
3
4
/*
5
 * This file is part of the TYPO3 CMS project.
6
 *
7
 * It is free software; you can redistribute it and/or modify it under
8
 * the terms of the GNU General Public License, either version 2
9
 * of the License, or any later version.
10
 *
11
 * For the full copyright and license information, please read the
12
 * LICENSE.txt file that was distributed with this source code.
13
 *
14
 * The TYPO3 project - inspiring people to share!
15
*/
16
17
class DefaultUrlDecoder implements FacetUrlDecoderInterface {
18
19
    /**
20
     * Parses the query filter from GET parameters in the URL and translates it
21
     * to a Lucene filter value.
22
     *
23
     * @param string $value the filter query from plugin
24
     * @param array $configuration Facet configuration
25
     * @return string Value to be used in a Lucene filter
26
     */
27 6
    public function decode($value, array $configuration = [])
28
    {
29 6
        return '"' . addslashes($value) . '"';
30
    }
31
}