Completed
Pull Request — master (#229)
by Дмитрий
07:07 queued 02:31
created

func.php ➔ mb_orig_strpos()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 1
eloc 2
nc 1
nop 3
dl 0
loc 4
rs 10
1
<?php
2
3
if (!function_exists('mb_orig_substr')) {
4
	function mb_orig_substr(...$args)
5
	{
6
		return substr(...$args);
7
	}
8
9
	function mb_orig_strrpos(...$args)
10
	{
11
		return strrpos(...$args);
12
	}
13
	
14
	/**
15
	 * @param string $haystack
16
	 * @param mixed $needle
17
	 * @param int $offset
18
	 * @return bool|int
19
	 */
20
	function mb_orig_strpos($haystack, $needle, $offset = 0)
21
	{
22
		return strpos($haystack, $needle, $offset);
23
	}
24
25
	/**
26
	 * @param string $input
27
	 * @return int
28
	 */
29
	function mb_orig_strlen($input)
30
	{
31
		return strlen($input);
32
	}
33
}
34
35
if (!function_exists('D')) {
36
	function D() {
37
		\PHPDaemon\Core\Daemon::log(\PHPDaemon\Core\Debug::dump(...func_get_args()));
38
		//\PHPDaemon\Core\Daemon::log(\PHPDaemon\Core\Debug::backtrace());
0 ignored issues
show
Unused Code Comprehensibility introduced by
64% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
39
	}
40
}
41
if (!function_exists('igbinary_serialize')) {
42
	function igbinary_serialize($m) {
43
		return serialize($m);
44
	}
45
46
	function igbinary_unserialize($m) {
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
47
		return unserialize($m);
48
	}
49
}
50
if (!function_exists('setTimeout')) {
51
	function setTimeout($cb, $timeout = null, $id = null, $priority = null) {
52
		return \PHPDaemon\Core\Timer::add($cb, $timeout, $id, $priority);
53
	}
54
}
55
if (!function_exists('clearTimeout')) {
56
	function clearTimeout($id) {
57
		\PHPDaemon\Core\Timer::remove($id);
58
	}
59
}
60