Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
50.00% covered (danger)
50.00%
1 / 2
50.00% covered (danger)
50.00%
1 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
SerializedPermission
50.00% covered (danger)
50.00%
1 / 2
50.00% covered (danger)
50.00%
1 / 2
2.50
0.00% covered (danger)
0.00%
0 / 1
 getPermissionIdentifiers
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getRegularExpression
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3namespace Apie\Core\Permissions;
4
5use Apie\Core\Lists\PermissionList;
6use Apie\Core\ValueObjects\Interfaces\HasRegexValueObjectInterface;
7use Apie\Core\ValueObjects\IsStringWithRegexValueObject;
8
9final class SerializedPermission implements PermissionInterface, HasRegexValueObjectInterface
10{
11    use IsStringWithRegexValueObject;
12
13    public function getPermissionIdentifiers(): PermissionList
14    {
15        return new PermissionList([$this->internal]);
16    }
17
18    public static function getRegularExpression(): string
19    {
20        return '/^[a-z:]+$/';
21    }
22}