original_string: public static function showTables($prefix)
      {
          $results = static::select('SHOW FULL TABLES');
  
          $tables = [];
          $views = [];
          $first = '';
          foreach ($results as $result) {
              // get the first element (table name)
              foreach ($result as $value) {
                  $first = $value;
                  break;
              }
  
              // skip all tables that are not the current prefix
              if (!empty($prefix)) {
                  if (!starts_with($first, $prefix)) {
                      continue;
                  }
              }
  
              // separate views from tables
              if ($result->Table_type == 'VIEW') {
                  $views[] = $first;
              } else {
                  $tables[] = $first;
              }
          }
  
          return ['tables' => $tables, 'views' => $views];
      }
code: public static function showTables($prefix)
      {
          $results = static::select('SHOW FULL TABLES');
  
          $tables = [];
          $views = [];
          $first = '';
          foreach ($results as $result) {
              // get the first element (table name)
              foreach ($result as $value) {
                  $first = $value;
                  break;
              }
  
              // skip all tables that are not the current prefix
              if (!empty($prefix)) {
                  if (!starts_with($first, $prefix)) {
                      continue;
                  }
              }
  
              // separate views from tables
              if ($result->Table_type == 'VIEW') {
                  $views[] = $first;
              } else {
                  $tables[] = $first;
              }
          }
  
          return ['tables' => $tables, 'views' => $views];
      }
code_tokens: public static function showTables ( $ prefix ) { $ results = static :: select ( 'SHOW FULL TABLES' ) ; $ tables = [ ] ; $ views = [ ] ; $ first = '' ; foreach ( $ results as $ result ) { // get the first element (table name) foreach ( $ result as $ value ) { $ first = $ value ; break ; } // skip all tables that are not the current prefix if ( ! empty ( $ prefix ) ) { if ( ! starts_with ( $ first , $ prefix ) ) { continue ; } } // separate views from tables if ( $ result -> Table_type == 'VIEW' ) { $ views [ ] = $ first ; } else { $ tables [ ] = $ first ; } } return [ 'tables' => $ tables , 'views' => $ views ] ; }
docstring: Execute a SHOW TABLES query.
  
  @return array with 'tables' and 'views'
docstring_tokens: Execute a SHOW TABLES query .