original_string: protected function coerceList($item, $delim = ',')
      {
          if (isset($item) && $item[0] === Type::T_LIST) {
              return $item;
          }
  
          if (isset($item) && $item[0] === Type::T_MAP) {
              $keys = $item[1];
              $values = $item[2];
              $list = [];
  
              for ($i = 0, $s = count($keys); $i < $s; $i++) {
                  $key = $keys[$i];
                  $value = $values[$i];
  
                  $list[] = [
                      Type::T_LIST,
                      '',
                      [[Type::T_KEYWORD, $this->compileStringContent($this->coerceString($key))], $value]
                  ];
              }
  
              return [Type::T_LIST, ',', $list];
          }
  
          return [Type::T_LIST, $delim, ! isset($item) ? []: [$item]];
      }
code: protected function coerceList($item, $delim = ',')
      {
          if (isset($item) && $item[0] === Type::T_LIST) {
              return $item;
          }
  
          if (isset($item) && $item[0] === Type::T_MAP) {
              $keys = $item[1];
              $values = $item[2];
              $list = [];
  
              for ($i = 0, $s = count($keys); $i < $s; $i++) {
                  $key = $keys[$i];
                  $value = $values[$i];
  
                  $list[] = [
                      Type::T_LIST,
                      '',
                      [[Type::T_KEYWORD, $this->compileStringContent($this->coerceString($key))], $value]
                  ];
              }
  
              return [Type::T_LIST, ',', $list];
          }
  
          return [Type::T_LIST, $delim, ! isset($item) ? []: [$item]];
      }
code_tokens: protected function coerceList ( $ item , $ delim = ',' ) { if ( isset ( $ item ) && $ item [ 0 ] === Type :: T_LIST ) { return $ item ; } if ( isset ( $ item ) && $ item [ 0 ] === Type :: T_MAP ) { $ keys = $ item [ 1 ] ; $ values = $ item [ 2 ] ; $ list = [ ] ; for ( $ i = 0 , $ s = count ( $ keys ) ; $ i < $ s ; $ i ++ ) { $ key = $ keys [ $ i ] ; $ value = $ values [ $ i ] ; $ list [ ] = [ Type :: T_LIST , '' , [ [ Type :: T_KEYWORD , $ this -> compileStringContent ( $ this -> coerceString ( $ key ) ) ] , $ value ] ] ; } return [ Type :: T_LIST , ',' , $ list ] ; } return [ Type :: T_LIST , $ delim , ! isset ( $ item ) ? [ ] : [ $ item ] ] ; }
docstring: Coerce something to list
  
  @param array  $item
  @param string $delim
  
  @return array
docstring_tokens: Coerce something to list