Completed
Push — master ( 09f25d...1635a7 )
by Abdelrahman
07:27 queued 05:55
created

helpers.php ➔ timezones()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
cc 1
eloc 2
c 1
b 1
f 0
nc 1
nop 0
dl 0
loc 4
rs 10
1
<?php
2
3
/*
4
 * NOTICE OF LICENSE
5
 *
6
 * Part of the Rinvex Support Package.
7
 *
8
 * This source file is subject to The MIT License (MIT)
9
 * that is bundled with this package in the LICENSE file.
10
 *
11
 * Package: Rinvex Support Package
12
 * License: The MIT License (MIT)
13
 * Link:    https://rinvex.com
14
 */
15
16
use Illuminate\Support\Str;
17
18
if (! function_exists('lower_case')) {
19
    /**
20
     * Convert the given string to lower-case.
21
     *
22
     * @param string $value
23
     *
24
     * @return string
25
     */
26
    function lower_case($value)
0 ignored issues
show
Coding Style introduced by
As per coding-style, this function should be in camelCase.

CamelCase (...) is the practice of writing compound words or phrases such that
each word or abbreviation begins with a capital letter.

Learn more about camelCase.

Loading history...
27
    {
28
        return Str::lower($value);
29
    }
30
}
31
32
if (! function_exists('upper_case')) {
33
    /**
34
     * Convert the given string to upper-case.
35
     *
36
     * @param string $value
37
     *
38
     * @return string
39
     */
40
    function upper_case($value)
0 ignored issues
show
Coding Style introduced by
As per coding-style, this function should be in camelCase.

CamelCase (...) is the practice of writing compound words or phrases such that
each word or abbreviation begins with a capital letter.

Learn more about camelCase.

Loading history...
41
    {
42
        return Str::upper($value);
43
    }
44
}
45
46
if (! function_exists('mimetypes')) {
47
    /**
48
     * Get valid mime types.
49
     *
50
     * @see https://github.com/symfony/http-foundation/blob/3.0/File/MimeType/MimeTypeExtensionGuesser.php
51
     * @see http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
52
     *
53
     * @return array
54
     */
55
    function mimetypes()
56
    {
57
        return json_decode(file_get_contents(__DIR__.'/../../resources/fixtures/mimetypes.json'), true);
58
    }
59
}
60
61
if (! function_exists('timezones')) {
62
    /**
63
     * Get valid timezones.
64
     * This list is based upon the timezone database version 2016.1.
65
     *
66
     * @see http://php.net/manual/en/timezones.php
67
     *
68
     * @return array
69
     */
70
    function timezones()
71
    {
72
        return json_decode(file_get_contents(__DIR__.'/../../resources/fixtures/timezones.json'), true);
73
    }
74
}
75