Passed
Branch feature/2.1-geodispersion-dev (1d61a8)
by Jonathan
61:21
created

NullPlaceMapperConfig   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 36
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A jsonDeserialize() 0 3 1
A get() 0 3 1
A has() 0 3 1
A jsonSerialize() 0 3 1
1
<?php
2
/**
3
 * webtrees-lib: MyArtJaub library for webtrees
4
 *
5
 * @package MyArtJaub\Webtrees
6
 * @subpackage GeoDispersion
7
 * @author Jonathan Jaubart <[email protected]>
8
 * @copyright Copyright (c) 2021, Jonathan Jaubart
9
 * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3
10
 */
11
12
declare(strict_types=1);
13
14
namespace MyArtJaub\Webtrees\Common\GeoDispersion\Config;
15
16
use MyArtJaub\Webtrees\Contracts\GeoDispersion\PlaceMapperConfigInterface;
17
use JsonSerializable;
18
19
/**
20
 * Null Place Mapper configuration.
21
 * It does not contain any data, and can be used when no configuration is required.
22
 */
23
class NullPlaceMapperConfig implements PlaceMapperConfigInterface
24
{
25
    /**
26
     * {@inheritDoc}
27
     * @see \MyArtJaub\Webtrees\Contracts\GeoDispersion\PlaceMapperConfigInterface::get()
28
     */
29
    public function get(string $key, $default = null)
30
    {
31
        return $default;
32
    }
33
34
    /**
35
     * {@inheritDoc}
36
     * @see \MyArtJaub\Webtrees\Contracts\GeoDispersion\PlaceMapperConfigInterface::has()
37
     */
38
    public function has(string $key): bool
39
    {
40
        return false;
41
    }
42
    
43
    /**
44
     * {@inheritDoc}
45
     * @see \MyArtJaub\Webtrees\Contracts\GeoDispersion\PlaceMapperConfigInterface::jsonDeserialize()
46
     */
47
    public function jsonDeserialize($config): self
48
    {
49
        return $this;
50
    }
51
    
52
    /**
53
     * {@inheritDoc}
54
     * @see JsonSerializable::jsonSerialize()
55
     */
56
    public function jsonSerialize()
57
    {
58
        return [];
59
    }
60
61
62
63
}