Completed
Push — master ( 1b12be...a9625e )
by Karsten
02:00
created

IsContaining::match()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 3
nc 2
nop 2
crap 2
1
<?php
2
/**
3
 * Created by gerk on 30.11.17 05:44
4
 */
5
6
namespace PeekAndPoke\Component\Psi\Psi\Str;
7
8
/**
9
 *
10
 *
11
 * @author Karsten J. Gerber <[email protected]>
12
 */
13
class IsContaining extends AbstractStringMatch
14
{
15 48
    public function match($needle, $haystack)
16
    {
17 48
        $len = strlen($needle);
18
19 48
        return $len > 0 && strpos($haystack, $needle) !== false;
20
    }
21
}
22