MaskBuilderInterface.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\Security\Acl\Permission;
  11. /**
  12. * This is the interface that must be implemented by mask builders.
  13. */
  14. interface MaskBuilderInterface
  15. {
  16. /**
  17. * Set the mask of this permission.
  18. *
  19. * @param int $mask
  20. *
  21. * @return MaskBuilderInterface
  22. *
  23. * @throws \InvalidArgumentException if $mask is not an integer
  24. */
  25. public function set($mask);
  26. /**
  27. * Returns the mask of this permission.
  28. *
  29. * @return int
  30. */
  31. public function get();
  32. /**
  33. * Adds a mask to the permission.
  34. *
  35. * @param mixed $mask
  36. *
  37. * @return MaskBuilderInterface
  38. *
  39. * @throws \InvalidArgumentException
  40. */
  41. public function add($mask);
  42. /**
  43. * Removes a mask from the permission.
  44. *
  45. * @param mixed $mask
  46. *
  47. * @return MaskBuilderInterface
  48. *
  49. * @throws \InvalidArgumentException
  50. */
  51. public function remove($mask);
  52. /**
  53. * Resets the PermissionBuilder.
  54. *
  55. * @return MaskBuilderInterface
  56. */
  57. public function reset();
  58. /**
  59. * Returns the mask for the passed code.
  60. *
  61. * @param mixed $code
  62. *
  63. * @return int
  64. *
  65. * @throws \InvalidArgumentException
  66. */
  67. public function resolveMask($code);
  68. }