Issues (3627)

Services/FullContact_Location.php (1 issue)

1
<?php
2
3
/*
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at.
7
 *
8
 * http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16
17
namespace MauticPlugin\MauticFullContactBundle\Services;
18
19
/**
20
 * This class handles all the Location information.
21
 *
22
 * @author   Keith Casey <[email protected]>
23
 * @license  http://www.apache.org/licenses/LICENSE-2.0 Apache
24
 */
25
class FullContact_Location extends FullContact_Base
26
{
27
    /**
28
     * Supported lookup methods.
29
     *
30
     * @var array
31
     */
32
    protected $_supportedMethods = ['normalizer', 'enrichment'];
33
    protected $_resourceUri      = '';
34
35
    /**
36
     * This takes a name and breaks it into its individual parts.
37
     *
38
     * @param type $name
39
     * @param type $casing -> valid values are uppercase, lowercase, titlecase
0 ignored issues
show
The type MauticPlugin\MauticFullContactBundle\Services\type was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
40
     *
41
     * @return type
42
     */
43
    public function normalizer($place, $includeZeroPopulation = false, $casing = 'titlecase')
44
    {
45
        $includeZeroPopulation = ($includeZeroPopulation) ? 'true' : 'false';
46
47
        $this->_resourceUri = '/address/locationNormalizer.json';
48
        $this->_execute(['place' => $place, 'includeZeroPopulation' => $includeZeroPopulation,
49
            'method'             => 'normalizer', 'casing' => $casing, ]);
50
51
        return $this->response_obj;
52
    }
53
54
    public function enrichment($place, $includeZeroPopulation = false, $casing = 'titlecase')
55
    {
56
        $includeZeroPopulation = ($includeZeroPopulation) ? 'true' : 'false';
57
58
        $this->_resourceUri = '/address/locationEnrichment.json';
59
        $this->_execute(['place' => $place, 'includeZeroPopulation' => $includeZeroPopulation,
60
            'method'             => 'enrichment', 'casing' => $casing, ]);
61
62
        return $this->response_obj;
63
    }
64
}
65