Passed
Push — develop ( f99f9b...4e8497 )
by Enea
02:07
created

RoleRepository::create()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 2
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
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\RoleContract;
15
16
class RoleRepository extends Repository
17
{
18 2
    public function create(string $name, ?string $description = null): RoleContract
19
    {
20 2
        return $this->register([Struct::create($name, $description)])->first();
21
    }
22
23 3
    protected function contract(): string
24
    {
25 3
        return RoleContract::class;
26
    }
27
}
28