Test Failed
Push — master ( 2f15b8...6e5f5c )
by Julien
04:42
created

ServiceProvider   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 8 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 Zemit\Provider\Oauth2Client;
12
13
use League\OAuth2\Client\Provider\Google;
0 ignored issues
show
Bug introduced by
The type League\OAuth2\Client\Provider\Google was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
14
use Phalcon\Di\DiInterface;
15
16
use Zemit\Provider\AbstractServiceProvider;
17
18
/**
19
 * Class ServiceProvider
20
 *
21
 * @link https://github.com/tegaphilip/padlock
22
 * @link https://oauth2.thephpleague.com/framework-integrations/
23
 *
24
 * @author Julien Turbide <[email protected]>
25
 * @copyright Zemit Team <[email protected]>
26
 *
27
 * @since 1.0
28
 * @version 1.0
29
 *
30
 * @package Zemit\Provider\Oauth2Client
31
 */
32
class ServiceProvider extends AbstractServiceProvider
33
{
34
    protected $serviceName = 'oauth2Client';
35
    
36
    /**
37
     * {@inheritdoc}
38
     *
39
     * @param DiInterface $di
40
     */
41
    public function register(DiInterface $di): void
42
    {
43
        $config = $di->get('config');
44
        $session = $di->get('session');
45
        $di->setShared($this->getName(), function() use ($config, $session) {
0 ignored issues
show
Unused Code introduced by
The import $session is not used and could be removed.

This check looks for imports that have been defined, but are not used in the scope.

Loading history...
Coding Style introduced by
Expected 1 space after FUNCTION keyword; 0 found
Loading history...
46
            $oauthClient = new \League\OAuth2\Client\Provider\GenericProvider($config->oauth2->client->toArray());
0 ignored issues
show
Bug introduced by
The type League\OAuth2\Client\Provider\GenericProvider was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
47
            
48
            return $oauthClient;
49
        });
50
    }
51
}
52