CaptureInteractiveFind::basePath()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
4
namespace LaravelLoqate\APIs;
5
6
use LaravelLoqate\Responses\CaptureInteractiveResponse;
7
8
/**
9
 * Uses a text search to find addresses and places.
10
 * @see https://www.loqate.com/resources/support/apis/Capture/Interactive/Find/1.1/
11
 * Class CaptureInteractiveFind
12
 * @package LaravelLoqate\APIs
13
 */
14
class CaptureInteractiveFind extends AbstractAPI
15
{
16
17
    /**
18
     * @inheritDoc
19
     */
20 2
    public function basePath(): string
21
    {
22 2
        return 'Capture/Interactive/Find/v1.1';
23
    }
24
25
    /**
26
     * @inheritDoc
27
     */
28 2
    protected function responseClass(): string
29
    {
30 2
        return CaptureInteractiveResponse::class;
31
    }
32
33
    /**
34
     * The search text to find. Ideally a postcode or the start of the address.
35
     *
36
     * @param string $text
37
     *
38
     * @return $this
39
     */
40 1
    public function setText(string $text): self
41
    {
42 1
        return $this->setRequestField('Text', $text);
43
    }
44
45
    /**
46
     * Whether the API is being called from a middleware implementation
47
     * (and therefore the calling IP address should not be used for biasing)
48
     *
49
     * @param bool $isMiddleware
50
     *
51
     * @return $this
52
     */
53 1
    public function setIsMiddleware(bool $isMiddleware = true): self
54
    {
55 1
        return $this->setRequestField('IsMiddleware', $isMiddleware);
56
    }
57
58
    /**
59
     * A container for the search. This should only be another Id previously returned from this service when the Type of the result was not 'Address'.
60
     *
61
     * @param string $text
62
     *
63
     * @return $this
64
     */
65 1
    public function setContainer(string $text): self
66
    {
67 1
        return $this->setRequestField('Container', $text);
68
    }
69
}
70