ApiAuth   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 3
c 1
b 0
f 0
dl 0
loc 19
ccs 6
cts 6
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getKey() 0 3 1
A getAuthParams() 0 3 1
A __construct() 0 4 1
1
<?php
2
3
namespace kalanis\google_maps\Remote\Headers;
4
5
6
use kalanis\google_maps\ClientConfig;
7
8
9
/**
10
 * Google Maps PHP Client - API auth params
11
 */
12
class ApiAuth
13
{
14 56
    public function __construct(
15
        protected readonly ClientConfig $config,
16
    )
17
    {
18 56
    }
19
20 3
    public function getKey(): string
21
    {
22 3
        return $this->config->getApiKey();
23
    }
24
25
    /**
26
     * @return array<string, string>
27
     */
28 37
    public function getAuthParams(): array
29
    {
30 37
        return ['key' => $this->config->getApiKey()];
31
    }
32
}
33