Passed
Push — master ( 532c9e...8cf9c5 )
by Guillermo A.
02:11
created

callUnsupportedMethod()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Guillermoandrae\Repositories;
4
5
use BadMethodCallException;
6
7
trait UnsupportedMethodRepositoryTrait
8
{
9
    /**
10
     * Throws an exception and uses the method name to generate the message.
11
     *
12
     * @param string $method The name of the unsupported method.
13
     */
14
    protected function callUnsupportedMethod(string $method)
15
    {
16
        throw new BadMethodCallException(
17
            sprintf('The %s method of this repository is not supported.', $method)
18
        );
19
    }
20
}
21