Why to define test(Closure) function in boostrap

4 years ago

Honza Kuchař
Backer | 1650
+
0
-

Hello!

Why there is defined function test() in boostrap e.g.:

https://github.com/…ootstrap.php#L17

<?php
function test(\Closure $function)
{
    $function();
}

?>

and than used for example here: https://github.com/…n.basic.phpt#L15

Is that just semantical thing or has that some special function? (e.g. something in the middle of non-structured test (just any .phpt file) and TestCase)

4 years ago

enumag
Member | 2128
+
+2
-

I guess it is meant to prevent global scope pollution.

Last edited by enumag (2015-05-10 11:32)