prepend() public static method

public static prepend ( $prefix )
Beispiel #1
0
 public function getFieldsAsString()
 {
     $fields = array_keys($this->_attributes);
     $escapedFields = Arrays::map($fields, Functions::compose(Functions::append("'"), Functions::prepend("'")));
     for ($index = self::FIELDS_COUNT_IN_LINE; $index < sizeof($escapedFields); $index += self::FIELDS_COUNT_IN_LINE) {
         $escapedFields[$index] = "\n\t\t\t" . $escapedFields[$index];
     }
     return implode(', ', $escapedFields);
 }
Beispiel #2
0
 /**
  * @test
  */
 public function shouldPrependPrefixToArgument()
 {
     //given
     $string = "snow";
     //when
     $prefixed = Functions::call(Functions::prepend('white '), $string);
     //then
     $this->assertEquals('white snow', $prefixed);
 }
 public function appendPrefixToNumbers($numbers, $prefix)
 {
     return Arrays::map($numbers, Functions::prepend($prefix));
 }