isBinary()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
use Sfneal\Helpers\Laravel\LaravelHelpers;
4
5
/**
6
 * Return the alphabet in array form.
7
 *
8
 * @return array
9
 */
10
function alphabet(): array
11
{
12
    return LaravelHelpers::alphabet();
13
}
14
15
/**
16
 * Return the index of a letter in the alphabet.
17
 *
18
 * @param  int  $index
19
 * @return string
20
 */
21
function alphabetIndex(int $index): string
22
{
23
    return LaravelHelpers::alphabetIndex($index);
24
}
25
26
/**
27
 * Retrieve a class's short name (without namespace).
28
 *
29
 * @param $class
30
 * @param  bool  $short  Full name or short name
31
 * @param  string|null  $default
32
 * @return string
33
 */
34
function getClassName($class, $short = false, $default = null): string
35
{
36
    return LaravelHelpers::getClassName($class, $short, $default);
37
}
38
39
/**
40
 * Serialize and simple hash a value to create a unique ID.
41
 *
42
 * @param $value
43
 * @return int
44
 */
45
function serializeHash($value): int
46
{
47
    return LaravelHelpers::serializeHash($value);
48
}
49
50
/**
51
 * Retrieve a random float between two values with a specified number of decimals.
52
 *
53
 * @param $min
54
 * @param $max
55
 * @param  int  $decimals
56
 * @return float
57
 */
58
function randomFloat(int $min, int $max, int $decimals = 2): float
59
{
60
    return LaravelHelpers::randomFloat($min, $max, $decimals);
61
}
62
63
/**
64
 * Determine if a string is a Binary String.
65
 *
66
 * @param  string  $string
67
 * @return bool
68
 */
69
function isBinary(string $string): bool
70
{
71
    return LaravelHelpers::isBinary($string);
72
}
73
74
/**
75
 * Determine if a string is serialized.
76
 *
77
 * https://stackoverflow.com/questions/1369936/check-to-see-if-a-string-is-serialized/4994628
78
 *
79
 * @param $data
80
 * @return bool
81
 */
82
function isSerialized($data): bool
83
{
84
    return LaravelHelpers::isSerialized($data);
85
}
86