GoogleRecaptchaProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 25
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 3 1
A provides() 0 3 1
A registerAgent() 0 7 1
1
<?php
2
3
namespace ByTIC\GoogleRecaptcha;
4
5
use ByTIC\NewRelic\Utility\NewRelic;
0 ignored issues
show
Bug introduced by
The type ByTIC\NewRelic\Utility\NewRelic 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...
6
use Nip\Container\ServiceProviders\Providers\AbstractServiceProvider;
7
use Nip\Container\ServiceProviders\Providers\BootableServiceProviderInterface;
8
use Nip\Http\Kernel\Kernel;
0 ignored issues
show
Bug introduced by
The type Nip\Http\Kernel\Kernel 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...
9
use Nip\Http\Kernel\KernelInterface;
0 ignored issues
show
Bug introduced by
The type Nip\Http\Kernel\KernelInterface 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...
10
11
/**
12
 * Class GoogleRecaptchaProvider
13
 * @package ByTIC\NewRelic
14
 */
15
class GoogleRecaptchaProvider extends AbstractServiceProvider
16
{
17
    /**
18
     * Returns a boolean if checking whether this provider provides a specific
19
     * service or returns an array of provided services if no argument passed.
20
     *
21
     * @return array
22
     */
23
    public function provides()
24
    {
25
        return ['recaptcha'];
26
    }
27
28
    public function register()
29
    {
30
        $this->registerAgent();
31
    }
32
33
    protected function registerAgent()
34
    {
35
        $this->getContainer()->share(
36
            'recaptcha',
37
            function () {
38
                $agent = NewRelic::getAgent();
39
                return $agent;
40
            }
41
        );
42
    }
43
44
}