Esempio n. 1
0
 public function testJoin()
 {
     $input = array('ąćęł', 'foo', 'bar', 123);
     $expected = 'ąćęłfoobar123';
     $this->assertEquals($expected, Arr::join($input));
     $expected = 'ąćęł+foo+bar+123';
     $this->assertEquals($expected, Arr::join($input, '+'));
 }
Esempio n. 2
0
 public function fields($data = null)
 {
     return $data !== null ? Arr::only($data, $this->fields) : $this->fields;
 }
Esempio n. 3
0
 /**
  * Pass each value in an array trough a callback function. It passes both
  * the value and the key to the callback, as opposed to array_map().
  * @param callback $callback
  * @return Arr
  */
 public function map($callback, $values_only = false)
 {
     return new self(Arr::map($this->data, $callback, $values_only));
 }