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

AuthenticationProvider::get()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 19
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 19
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 8
nc 1
nop 0
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