GreaterOrEqualsTo.php 791 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /**
  3. * This file is part of Lcobucci\JWT, a simple library to handle JWT and JWS
  4. *
  5. * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
  6. */
  7. namespace Lcobucci\JWT\Claim;
  8. use Lcobucci\JWT\Claim;
  9. use Lcobucci\JWT\ValidationData;
  10. /**
  11. * Validatable claim that checks if value is greater or equals the given data
  12. *
  13. * @deprecated This class will be removed on v4
  14. *
  15. * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
  16. * @since 2.0.0
  17. */
  18. class GreaterOrEqualsTo extends Basic implements Claim, Validatable
  19. {
  20. /**
  21. * {@inheritdoc}
  22. */
  23. public function validate(ValidationData $data)
  24. {
  25. if ($data->has($this->getName())) {
  26. return $this->getValue() >= $data->get($this->getName());
  27. }
  28. return true;
  29. }
  30. }