Completed
Push — master ( dc3001...f72a69 )
by Luc
44:07 queued 08:30
created

CreatedByQueryString::generateQuery()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace CultuurNet\UDB3\SavedSearches\Properties;
4
5
class CreatedByQueryString extends QueryString
6
{
7
    /**
8
     * @param string[] $queryParts
9
     */
10
    public function __construct(string ...$queryParts)
11
    {
12
        if (empty($queryParts)) {
13
            throw new \InvalidArgumentException('At least one query part is required.');
14
        }
15
16
        $query = implode(' OR ', $queryParts);
17
        if (count($queryParts) > 1) {
18
            $query = '(' . $query . ')';
19
        }
20
        $query = 'createdby:' . $query;
21
22
        parent::__construct($query);
23
    }
24
}
25