conversions.php ➔ mixed_to_closure()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * @copyright Zicht Online <http://zicht.nl>
4
 */
5
6
namespace Zicht\Itertools\conversions;
7
8
use Zicht\Itertools\util\Conversions;
9
10
/**
11
 * @param array|string|\Iterator $iterable
12
 * @return \Iterator
13
 * @deprecated Use \Zicht\Itertools\util\Conversions::mixedToIterator, will be removed in version 3.0
14
 */
15
function mixed_to_iterator($iterable)
16
{
17
    return Conversions::mixedToIterator($iterable);
18
}
19
20
/**
21
 * @param null|array|\Closure $closure
22
 * @return \Closure
23
 * @deprecated Use \Zicht\Itertools\util\Conversions::mixedToClosure, will be removed in version 3.0
24
 */
25
function mixed_to_closure($closure)
26
{
27
    return Conversions::mixedToClosure($closure);
0 ignored issues
show
Bug introduced by
It seems like $closure defined by parameter $closure on line 25 can also be of type array; however, Zicht\Itertools\util\Conversions::mixedToClosure() does only seem to accept null|object<Closure>, maybe add an additional type check?

This check looks at variables that have been passed in as parameters and are passed out again to other methods.

If the outgoing method call has stricter type requirements than the method itself, an issue is raised.

An additional type check may prevent trouble.

Loading history...
28
}
29
30
/**
31
 * @param null|string|\Closure $strategy
32
 * @return \Closure
33
 * @deprecated Use \Zicht\Itertools\util\Conversions::mixedToClosure, will be removed in version 3.0
34
 */
35
function mixed_to_value_getter($strategy)
36
{
37
    return Conversions::mixedToValueGetter($strategy);
38
}
39
40
/**
41
 * @param array|string|\Iterator $iterable
42
 * @return \Iterator
43
 * @deprecated Use \Zicht\Itertools\util\Conversions::mixedToIterator, will be removed in version 3.0
44
 */
45
function mixedToIterator($iterable) // phpcs:ignore Zicht.NamingConventions.Functions.GlobalNaming
46
{
47
    return Conversions::mixedToIterator($iterable);
48
}
49
50
/**
51
 * @param null|\Closure $closure
52
 * @return \Closure
53
 * @deprecated Use \Zicht\Itertools\util\Conversions::mixedToClosure, will be removed in version 3.0
54
 */
55
function mixedToClosure($closure) // phpcs:ignore Zicht.NamingConventions.Functions.GlobalNaming
56
{
57
    return Conversions::mixedToClosure($closure);
58
}
59
60
/**
61
 * @param null|string|\Closure $strategy
62
 * @return \Closure
63
 * @deprecated Use \Zicht\Itertools\util\Conversions::mixedToClosure, will be removed in version 3.0
64
 */
65
function mixedToValueGetter($strategy) // phpcs:ignore Zicht.NamingConventions.Functions.GlobalNaming
66
{
67
    return Conversions::mixedToValueGetter($strategy);
68
}
69