1<?php
2
3/*
4 * This file is part of the Symfony package.
5 *
6 * (c) Fabien Potencier <fabien@symfony.com>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12use Symfony\Component\Intl\Globals\IntlGlobals;
13
14if (!function_exists('intl_is_failure')) {
15    /**
16     * Stub implementation for the {@link intl_is_failure()} function of the intl
17     * extension.
18     *
19     * @author Bernhard Schussek <bschussek@gmail.com>
20     *
21     * @param int $errorCode The error code returned by intl_get_error_code().
22     *
23     * @return bool Whether the error code indicates an error.
24     *
25     * @see IntlGlobals::isFailure()
26     */
27    function intl_is_failure($errorCode)
28    {
29        return IntlGlobals::isFailure($errorCode);
30    }
31
32    /**
33     * Stub implementation for the {@link intl_get_error_code()} function of the
34     * intl extension.
35     *
36     * @author Bernhard Schussek <bschussek@gmail.com>
37     *
38     * @return bool The error code of the last intl function call or
39     *              IntlGlobals::U_ZERO_ERROR if no error occurred.
40     *
41     * @see IntlGlobals::getErrorCode()
42     */
43    function intl_get_error_code()
44    {
45        return IntlGlobals::getErrorCode();
46    }
47
48    /**
49     * Stub implementation for the {@link intl_get_error_code()} function of the
50     * intl extension.
51     *
52     * @author Bernhard Schussek <bschussek@gmail.com>
53     *
54     * @return bool The error message of the last intl function call or
55     *              "U_ZERO_ERROR" if no error occurred.
56     *
57     * @see IntlGlobals::getErrorMessage()
58     */
59    function intl_get_error_message()
60    {
61        return IntlGlobals::getErrorMessage();
62    }
63
64    /**
65     * Stub implementation for the {@link intl_error_name()} function of the intl
66     * extension.
67     *
68     * @param int $errorCode The error code.
69     *
70     * @return string The name of the error code constant.
71     *
72     * @see IntlGlobals::getErrorName()
73     */
74    function intl_error_name($errorCode)
75    {
76        return IntlGlobals::getErrorName($errorCode);
77    }
78}
79