original_string: public static function toList(array $list, $and = null, $separator = ', ')
      {
          if ($and === null) {
              $and = __d('cake', 'and');
          }
          if (count($list) > 1) {
              return implode($separator, array_slice($list, null, -1)) . ' ' . $and . ' ' . array_pop($list);
          }
  
          return array_pop($list);
      }
code: public static function toList(array $list, $and = null, $separator = ', ')
      {
          if ($and === null) {
              $and = __d('cake', 'and');
          }
          if (count($list) > 1) {
              return implode($separator, array_slice($list, null, -1)) . ' ' . $and . ' ' . array_pop($list);
          }
  
          return array_pop($list);
      }
code_tokens: public static function toList ( array $ list , $ and = null , $ separator = ', ' ) { if ( $ and === null ) { $ and = __d ( 'cake' , 'and' ) ; } if ( count ( $ list ) > 1 ) { return implode ( $ separator , array_slice ( $ list , null , - 1 ) ) . ' ' . $ and . ' ' . array_pop ( $ list ) ; } return array_pop ( $ list ) ; }
docstring: Creates a comma separated list where the last two items are joined with 'and', forming natural language.
  
  @param array $list The list to be joined.
  @param string|null $and The word used to join the last and second last items together with. Defaults to 'and'.
  @param string $separator The separator used to join all the other items together. Defaults to ', '.
  @return string The glued together string.
  @link https://book.cakephp.org/3.0/en/core-libraries/text.html#converting-an-array-to-sentence-form
docstring_tokens: Creates a comma separated list where the last two items are joined with and forming natural language .