| 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); | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 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 |  |  |  | 
            
                        
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.