Passed
Push — master ( 5f3c03...861b1d )
by Hashem
03:37 queued 10s
created

fa_to_en_nums()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
if (!function_exists('random_password')) {
4
    /**
5
     * Generate random password.
6
     *
7
     * @param int $length
8
     * @param string $availableSets
9
     * @return string
10
     */
11
    function random_password(int $length = 9, string $availableSets = 'luds')
12
    {
13
        return app('helper')->randomPassword($length, $availableSets);
0 ignored issues
show
Bug introduced by
The function app was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

13
        return /** @scrutinizer ignore-call */ app('helper')->randomPassword($length, $availableSets);
Loading history...
14
    }
15
}
16
17
if (!function_exists('persian_slug')) {
18
    /**
19
     * Generate persian slug.
20
     *
21
     * @param string $string
22
     * @param string $separator
23
     * @return false|mixed|string|string[]|null
24
     */
25
    function persian_slug(string $string, string $separator = '-')
26
    {
27
        return app('helper')->persianSlug($string, $separator);
0 ignored issues
show
Bug introduced by
The function app was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

27
        return /** @scrutinizer ignore-call */ app('helper')->persianSlug($string, $separator);
Loading history...
28
    }
29
}
30
31
if (!function_exists('fa_to_en_nums')) {
32
    /**
33
     * Convert all Persian(Farsi) numbers to English.
34
     *
35
     * @param string $number
36
     * @return mixed
37
     */
38
    function fa_to_en_nums(string $number)
39
    {
40
        return app('helper')->faToEnNums($number);
0 ignored issues
show
Bug introduced by
The function app was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

40
        return /** @scrutinizer ignore-call */ app('helper')->faToEnNums($number);
Loading history...
41
    }
42
}
43
44
if (!function_exists('remove_comma')) {
45
    /**
46
     * Remove comma's from value.
47
     *
48
     * @param string $value
49
     *
50
     * @return string
51
     */
52
    function remove_comma(string $value) : string
53
    {
54
        return app('helper')->removeComma($value);
0 ignored issues
show
Bug introduced by
The function app was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

54
        return /** @scrutinizer ignore-call */ app('helper')->removeComma($value);
Loading history...
55
    }
56
}
57
58
if (!function_exists('to_gregorian')) {
59
    /**
60
     * Convert jalali date to gregorian date.
61
     *
62
     * @param string $jDate
63
     *
64
     * @return null|string
65
     */
66
    function to_gregorian(string $jDate)
67
    {
68
        return app('helper')->toGregorian($jDate);
0 ignored issues
show
Bug introduced by
The function app was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

68
        return /** @scrutinizer ignore-call */ app('helper')->toGregorian($jDate);
Loading history...
69
    }
70
}
71