Esempio n. 1
0
 function test_build()
 {
     $data = array('foo' => 'bar');
     $actual = Arr::build($data, function ($key, $value) {
         return array($key, $value);
     });
     $this->assertEquals($data, $actual);
     $actual = wpdevsclub_array_build($data, function ($key, $value) {
         return array($key, $value);
     });
     $this->assertEquals($data, $actual);
 }
Esempio n. 2
0
 /**
  * Build a new array using a callback.
  *
  * @param  array     $array
  * @param  \Closure  $callback
  * @return array
  */
 function wpdevsclub_array_build($array, Closure $callback)
 {
     return Arr::build($array, $callback);
 }