GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( ba2385...e925e5 )
by Gjero
02:39
created

utils.php ➔ url()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 4
dl 0
loc 4
rs 10
1
<?php
2
3
namespace Pimf;
4
5
/**
6
 * Return the value of the given item.
7
 * If the given item is a Closure the result of the Closure will be returned.
8
 *
9
 * @param mixed $value
10
 *
11
 * @return mixed
12
 */
13
function value($value)
14
{
15
    return (is_callable($value) && !is_string($value)) ? call_user_func($value) : $value;
16
}
17
18
/**
19
 * Checks if a scalar value is FALSE, without content or only full of whitespaces.
20
 * For non-scalar values will evaluate if value is empty().
21
 *
22
 * @param string $value
23
 *
24
 * @return bool
25
 */
26
function is_empty($value)
27
{
28
    return !isset($value) || (is_scalar($value) ? (trim($value) === '') : empty($value));
29
}
30
31
/**
32
 * @param string $route controller/action
33
 * @param array  $params
34
 * @param null   $https
35
 * @param bool   $asset
36
 *
37
 * @return string
38
 */
39
function url($route = '', array $params = array(), $https = null, $asset = false)
40
{
41
    return \Pimf\Url::compute($route, $params, $https, $asset);
42
}
43
44
/**
45
 * Escape HTML entities in a string.
46
 *
47
 * @param string $value
48
 *
49
 * @return string
50
 */
51
function ent($value)
52
{
53
    return htmlentities($value, ENT_QUOTES, 'UTF-8', false);
54
}
55
56
/**
57
 * Relax the system and free up some memory
58
 */
59
function relax()
60
{
61
    clearstatcache();
62
63
    // free up the memory that could be lost
64
    // through possible roots that are already
65
    // recorded in the root buffer.
66
    if (function_exists('gc_collect_cycles')) {
67
        gc_collect_cycles();
68
    }
69
}
70