1: <?php
2:
3: namespace ProgrammingAreHard\Arbiter\Model;
4:
5: interface PermissionsTransformerInterface extends PermissionsFactoryInterface
6: {
7: /**
8: * Convert permissions to a bitmask.
9: *
10: * @param PermissionsInterface $permissions
11: * @return int
12: * @throws \InvalidArgumentException
13: */
14: public function permissionsToMask(PermissionsInterface $permissions);
15:
16: /**
17: * Convert the permissions to an array of bitmasks.
18: *
19: * @param PermissionsInterface $permissions
20: * @return int[]
21: * @throws \InvalidArgumentException
22: */
23: public function permissionsToMasks(PermissionsInterface $permissions);
24:
25: /**
26: * Convert the bitmask to permissions.
27: *
28: * @param int $mask
29: * @return PermissionsInterface
30: */
31: public function maskToPermissions($mask);
32: }