Role.php 746 B

123456789101112131415161718192021222324252627282930313233343536373839
  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\Core\Role;
  11. /**
  12. * Role is a simple implementation of a RoleInterface where the role is a
  13. * string.
  14. *
  15. * @author Fabien Potencier <fabien@symfony.com>
  16. */
  17. class Role implements RoleInterface
  18. {
  19. private $role;
  20. /**
  21. * @param string $role The role name
  22. */
  23. public function __construct($role)
  24. {
  25. $this->role = (string) $role;
  26. }
  27. /**
  28. * {@inheritdoc}
  29. */
  30. public function getRole()
  31. {
  32. return $this->role;
  33. }
  34. }