Completed
Push — master ( 93bd80...c62968 )
by Nekrasov
01:18
created

Helpers::startsWith()   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
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 2
1
<?php
2
3
namespace Arrilot\BitrixModels;
4
5
class Helpers
6
{
7
    /**
8
     * Does the $haystack starts with $needle
9
     *
10
     * @param $haystack
11
     * @param $needle
12
     * @return bool
13
     */
14
    public static function startsWith($haystack, $needle)
15
    {
16
        return strncmp($haystack, $needle, strlen($needle)) === 0;
17
    }
18
}
19