Completed
Push — 2.2 ( 2d418d...f846f2 )
by
unknown
01:23
created

UtilsHelper::endsWith()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.9666
c 0
b 0
f 0
cc 2
nc 2
nop 2
1
<?php
2
3
namespace Wabel\Zoho\CRM\Helpers;
4
5
class UtilsHelper
6
{
7
8
    /**
9
     * @param string $haystack
10
     * @param string $needle
11
     * @return bool
12
     */
13
    public static function endsWith($haystack, $needle)
14
    {
15
        $length = strlen($needle);
16
        if ($length === 0) {
17
            return true;
18
        }
19
20
        return (substr($haystack, -$length) === $needle);
21
    }
22
}
23