UnsupportedMethodRepositoryTrait   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A callUnsupportedMethod() 0 4 1
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