Completed
Push — 7.0_master_link_manager_merge ( e446e3 )
by André
77:34 queued 60:56
created

Pattern::__construct()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 4
nc 2
nop 1
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
5
 * @license For full copyright and license information view LICENSE file distributed with this source code.
6
 */
7
namespace eZ\Publish\API\Repository\Values\URL\Query\Criterion;
8
9
/**
10
 * Matches URLs which contains the pattern.
11
 */
12
class Pattern extends Matcher
13
{
14
    /**
15
     * String which needs to part of URL e.g. ez.no.
16
     *
17
     * @var string
18
     */
19
    public $pattern;
20
21
    /**
22
     * Pattern constructor.
23
     *
24
     * @param string $pattern
25
     */
26
    public function __construct($pattern)
27
    {
28
        if ($pattern === null || $pattern === '') {
29
            throw new \InvalidArgumentException('URL pattern should not be empty!');
30
        }
31
32
        $this->pattern = $pattern;
33
    }
34
}
35