Completed
Push — develop ( d6d5e2...840c69 )
by
unknown
03:35
created

AuthenticationProvider   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 28
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A get() 0 19 1
1
<?php
2
3
/**
4
 * Class AuthenticationProvider
5
 */
6
7
namespace HDNET\OnpageIntegration\Provider;
8
9
use HDNET\OnpageIntegration\Domain\Repository\ConfigurationRepository;
10
use TYPO3\CMS\Extbase\Object\ObjectManager;
11
12
/**
13
 * Class AuthenticationProvider
14
 */
15
class AuthenticationProvider extends AbstractProvider
16
{
17
18
    /**
19
     * Build the authentication index for an api call
20
     *
21
     * @return array
22
     */
23
    public function get()
24
    {
25
        $objectManager = new ObjectManager();
26
        $configurationRepository = $objectManager->get(ConfigurationRepository::class);
27
28
        /** @var \HDNET\OnpageIntegration\Domain\Model\Configuration $configuration */
29
        $configuration = $configurationRepository->findByUid(1);
30
31
        $buildAuth = [
32
33
            'api_key'    => $configuration->getApiKey(),
34
            'project' => $configuration->getProjectId(),
35
36
        ];
37
38
39
40
        return $buildAuth;
41
    }
42
}
43