assertString() public static method

public static assertString ( string $str )
$str string
Example #1
0
 public static function join()
 {
     $args = func_get_args();
     /**
      * Returns a string made by inserting the separator between each element and concatenating all the elements into a
      * single string.
      *
      * @category List
      *
      * @param $separator
      * @param $list
      *
      * @return mixed
      * @throws Exception
      */
     $_join = function ($separator, $list) {
         Exception::assertString($separator);
         Exception::assertList($list);
         return self::reduce(function ($acc, $item) use($separator) {
             return empty($acc) ? $item : $acc . $separator . $item;
         }, '', $list);
     };
     return call_user_func_array(self::curry2($_join), $args);
 }