Passed
Push — v9 ( 473b89...c87345 )
by Georges
02:33
created

Config   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 24
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getCollection() 0 3 1
A setCollection() 0 5 1
1
<?php
2
/**
3
 *
4
 * This file is part of Phpfastcache.
5
 *
6
 * @license MIT License (MIT)
7
 *
8
 * For full copyright and license information, please see the docs/CREDITS.txt and LICENCE files.
9
 *
10
 * @author Georges.L (Geolim4)  <[email protected]>
11
 * @author Contributors  https://github.com/PHPSocialNetwork/phpfastcache/graphs/contributors
12
 */
13
14
declare(strict_types=1);
15
16
namespace Phpfastcache\Drivers\Firestore;
17
18
use Phpfastcache\Config\ConfigurationOption;
19
use Phpfastcache\Core\Pool\ExtendedCacheItemPoolInterface;
20
use Phpfastcache\Exceptions\PhpfastcacheLogicException;
21
22
/**
23
 * @see https://github.com/arangodb/arangodb-php/blob/devel/examples/init.php
24
 * @SuppressWarnings(PHPMD.TooManyFields)
25
 */
26
class Config extends ConfigurationOption
27
{
28
    protected string $collection;
29
30
    protected string $partitionKey = ExtendedCacheItemPoolInterface::DRIVER_KEY_WRAPPER_INDEX;
31
32
    /**
33
     * @return string
34
     */
35
    public function getCollection(): string
36
    {
37
        return $this->collection;
38
    }
39
40
    /**
41
     * @param string $collection
42
     * @return Config
43
     * @throws PhpfastcacheLogicException
44
     */
45
    public function setCollection(string $collection): Config
46
    {
47
        $this->enforceLockedProperty(__FUNCTION__);
48
        $this->collection = $collection;
49
        return $this;
50
    }
51
}
52