HasCallbackMethodsTrait   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 9
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A callbackMethod() 0 3 1
1
<?php
2
3
namespace Leonidas\Framework\Abstracts;
4
5
use Closure;
6
7
trait HasCallbackMethodsTrait
8
{
9
    /**
10
     * Wraps a method in a closure to allow protected methods to be used as
11
     * callbacks to 3rd party code.
12
     */
13
    protected function callbackMethod(string $method): Closure
14
    {
15
        return Closure::fromCallable([$this, $method]);
16
    }
17
}
18