DeprecatedMethodsTrait   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 1
eloc 2
c 2
b 0
f 1
dl 0
loc 15
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A singleton() 0 3 1
1
<?php
2
3
namespace Nip\Container\Legacy\Container\Traits;
4
5
/**
6
 * Trait DeprecatedMethodsTrait
7
 * @package Nip\Container\Legacy\Container\Traits
8
 */
9
trait DeprecatedMethodsTrait
10
{
11
12
    /**
13
     * Register a shared binding in the container.
14
     *
15
     * @param string|array $abstract
16
     * @param \Closure|string|null $concrete
17
     *
18
     * @return void
19
     * @deprecated Use new Share method instead
20
     */
21
    public function singleton($abstract, $concrete = null)
22
    {
23
        return $this->share($abstract, $concrete);
0 ignored issues
show
Bug introduced by
It seems like share() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

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

23
        return $this->/** @scrutinizer ignore-call */ share($abstract, $concrete);
Loading history...
24
    }
25
}
26