Passed
Push — develop ( d0561f...3c99fb )
by Enea
03:29
created

PermissionRepository   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 3 1
A contract() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * @author enea dhack <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Enea\Authorization\Repositories;
13
14
use Enea\Authorization\Contracts\PermissionContract;
15
16
class PermissionRepository extends Repository
17
{
18 2
    public function create(string $name, ?string $description = null): PermissionContract
19
    {
20 2
        return $this->register([Struct::create($name, $description)])->first();
21
    }
22
23 3
    protected function contract(): string
24
    {
25 3
        return PermissionContract::class;
26
    }
27
}
28