Completed
Pull Request — master (#1)
by Arthur
02:19
created

Query   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 30
wmc 3
lcom 0
cbo 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 2
A getQuery() 0 4 1
1
<?php
2
3
namespace Arthem\GoogleApi\Domain\Place\VO;
4
5
use Arthem\GoogleApi\Domain\Place\Exception\InvalidQueryException;
6
7
class Query
8
{
9
    /**
10
     * The text query.
11
     * eg: "pizza in New York"
12
     *
13
     * @var string
14
     */
15
    private $query;
16
17
    /**
18
     * @param string $query
19
     */
20
    public function __construct($query)
21
    {
22
        if (!is_string($query)) {
23
            throw new InvalidQueryException(sprintf('query must be a string, got %s', gettype($query)));
24
        }
25
26
        $this->query = $query;
27
    }
28
29
    /**
30
     * @return string
31
     */
32
    public function getQuery()
33
    {
34
        return $this->query;
35
    }
36
}
37