ShaHashServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 12
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A provides() 0 2 1
A register() 0 4 1
1
<?php
2
3
4
namespace App\Providers;
5
6
7
use App\Libraries\ShaHash\SHAHasher as SHAHasher;
8
use Illuminate\Hashing\HashServiceProvider;
9
10
class ShaHashServiceProvider extends HashServiceProvider
11
{
12
13
    public function register()
14
    {
15
        $this->app->singleton('hash',function (){
0 ignored issues
show
Bug introduced by
The method singleton() does not exist on Tests\Laravel\App. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

15
        $this->app->/** @scrutinizer ignore-call */ 
16
                    singleton('hash',function (){

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
16
            return new SHAHasher($this->app);
0 ignored issues
show
Bug introduced by
$this->app of type Tests\Laravel\App is incompatible with the type Illuminate\Contracts\Foundation\Application expected by parameter $app of App\Libraries\ShaHash\SHAHasher::__construct(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

16
            return new SHAHasher(/** @scrutinizer ignore-type */ $this->app);
Loading history...
17
        });
18
    }
19
20
    public function provides() {
21
        return array('hash');
22
    }
23
24
25
}
26