Completed
Push — v2.0.x ( 7a58b6 )
by Florent
24:58
created

StringUtil::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 1
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 1
rs 10
cc 1
eloc 1
nc 1
nop 0
1
<?php
2
3
/*
4
 * The MIT License (MIT)
5
 *
6
 * Copyright (c) 2014-2015 Spomky-Labs
7
 *
8
 * This software may be modified and distributed under the terms
9
 * of the MIT license.  See the LICENSE file for details.
10
 */
11
12
namespace Jose\Util;
13
14
/**
15
 * Class String
16
 */
17
final class StringUtil
18
{
19
    private function __construct() {}
20
21
    public static function strlen($string)
22
    {
23
        return function_exists('mb_strlen') ? mb_strlen($string, '8bit') : strlen($string);
24
    }
25
26
    public static function substr($string, $start, $length = null)
27
    {
28
        return function_exists('mb_substr') ? mb_substr($string, $start, $length, '8bit') : substr($string, $start, $length);
29
    }
30
}
31