functions.php 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. use Symfony\Component\Locale\Stub\StubIntl;
  11. /**
  12. * Stub implementation for the intl_is_failure function of the intl extension
  13. *
  14. * @author Bernhard Schussek <bernhard.schussek@symfony.com>
  15. * @param integer $errorCode The error code returned by intl_get_error_code()
  16. * @return Boolean Whether the error code indicates an error
  17. * @see Symfony\Component\Locale\Stub\StubIntl::isFailure
  18. */
  19. function intl_is_failure($errorCode)
  20. {
  21. return StubIntl::isFailure($errorCode);
  22. }
  23. /**
  24. * Stub implementation for the intl_get_error_code function of the intl extension
  25. *
  26. * @author Bernhard Schussek <bernhard.schussek@symfony.com>
  27. * @return Boolean The error code of the last intl function call or
  28. * StubIntl::U_ZERO_ERROR if no error occurred
  29. * @see Symfony\Component\Locale\Stub\StubIntl::getErrorCode
  30. */
  31. function intl_get_error_code()
  32. {
  33. return StubIntl::getErrorCode();
  34. }
  35. /**
  36. * Stub implementation for the intl_get_error_code function of the intl extension
  37. *
  38. * @author Bernhard Schussek <bernhard.schussek@symfony.com>
  39. * @return Boolean The error message of the last intl function call or
  40. * "U_ZERO_ERROR" if no error occurred
  41. * @see Symfony\Component\Locale\Stub\StubIntl::getErrorMessage
  42. */
  43. function intl_get_error_message()
  44. {
  45. return StubIntl::getErrorMessage();
  46. }
  47. /**
  48. * Stub implementation for the intl_error_name function of the intl extension
  49. *
  50. * @return String will be the same as the name of the error code constant
  51. *
  52. * @see Symfony\Component\Locale\Stub\StubIntl::getErrorName
  53. */
  54. function intl_error_name($errorCode)
  55. {
  56. return StubIntl::getErrorName($errorCode);
  57. }