aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/symfony/intl/Symfony/Component/Intl/Resources/stubs/functions.php
blob: 7a2d4b6729a9b694571669242a14eb81f469ad2b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

use Symfony\Component\Intl\Globals\IntlGlobals;

if (!function_exists('intl_is_failure')) {

    /**
     * Stub implementation for the {@link intl_is_failure()} function of the intl
     * extension.
     *
     * @author Bernhard Schussek <bschussek@gmail.com>
     *
     * @param integer $errorCode  The error code returned by intl_get_error_code().
     *
     * @return Boolean Whether the error code indicates an error.
     *
     * @see \Symfony\Component\Intl\Globals\StubIntlGlobals::isFailure
     */
    function intl_is_failure($errorCode)
    {
        return IntlGlobals::isFailure($errorCode);
    }

    /**
     * Stub implementation for the {@link intl_get_error_code()} function of the
     * intl extension.
     *
     * @author Bernhard Schussek <bschussek@gmail.com>
     *
     * @return Boolean The error code of the last intl function call or
     *                 IntlGlobals::U_ZERO_ERROR if no error occurred.
     *
     * @see \Symfony\Component\Intl\Globals\StubIntlGlobals::getErrorCode
     */
    function intl_get_error_code()
    {
        return IntlGlobals::getErrorCode();
    }

    /**
     * Stub implementation for the {@link intl_get_error_code()} function of the
     * intl extension.
     *
     * @author Bernhard Schussek <bschussek@gmail.com>
     *
     * @return Boolean The error message of the last intl function call or
     *                 "U_ZERO_ERROR" if no error occurred.
     *
     * @see \Symfony\Component\Intl\Globals\StubIntlGlobals::getErrorMessage
     */
    function intl_get_error_message()
    {
        return IntlGlobals::getErrorMessage();
    }

    /**
     * Stub implementation for the {@link intl_error_name()} function of the intl
     * extension.
     *
     * @param integer $errorCode The error code.
     *
     * @return string The name of the error code constant.
     *
     * @see \Symfony\Component\Intl\Globals\StubIntlGlobals::getErrorName
     */
    function intl_error_name($errorCode)
    {
        return IntlGlobals::getErrorName($errorCode);
    }

}