Test Failed
Push — master ( 535fd6...a48418 )
by Julien
13:35
created

ServiceProvider   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 5
c 1
b 0
f 0
dl 0
loc 22
ccs 0
cts 4
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 7 1
1
<?php
2
/**
3
 * This file is part of the Zemit Framework.
4
 *
5
 * (c) Zemit Team <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE.txt
8
 * file that was distributed with this source code.
9
 */
10
11
namespace App\Provider\OpenAi;
12
13
use Orhanerday\OpenAi\OpenAi;
14
use Phalcon\Di\DiInterface;
15
use Zemit\Bootstrap\Config;
16
use Zemit\Provider\AbstractServiceProvider;
17
18
/**
19
 * Zemit\Provider\OpenAi\ServiceProvider
20
 *
21
 * @package Zemit\Provider\OpenAi
22
 */
23
class ServiceProvider extends AbstractServiceProvider
24
{
25
    /**
26
     * The Service name.
27
     * @var string
28
     */
29
    protected $serviceName = 'openai';
30
31
    /**
32
     * {@inheritdoc}
33
     *
34
     * Register the Flash Service with the Twitter Bootstrap classes.
35
     *
36
     * @return void
37
     */
38
    public function register(DiInterface $di): void
39
    {
40
        $di->setShared($this->getName(), function() use ($di) {
0 ignored issues
show
Coding Style introduced by
Expected 1 space after FUNCTION keyword; 0 found
Loading history...
41
            /** @var Config $config */
42
            $config = $di->get('config');
43
44
            return new OpenAi($config->path('openai.secretKey'));
45
        });
46
    }
47
}
48