Completed
Push — master ( 5eca3e...19ac8a )
by Jean-Christophe
03:24
created

JString::contains()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
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 3
rs 10
cc 1
eloc 2
nc 1
nop 2
1
<?php
2
namespace Ajax\service;
3
class JString {
4
5
	public static function contains($hay,$needle){
6
		return strpos($hay, $needle) !== false;
7
	}
8
	public static function startswith($hay, $needle) {
9
		return substr($hay, 0, strlen($needle)) === $needle;
10
	}
11
12
	public static function endswith($hay, $needle) {
13
		return substr($hay, -strlen($needle)) === $needle;
14
	}
15
16
	public static function isNull($s){
17
		return (!isset($s) || NULL===$s || ""===$s);
18
	}
19
	public static function isNotNull($s){
20
		return (isset($s) && NULL!==$s && ""!==$s);
21
	}
22
}