function is_table_empty in Coder 8.2
Object operator indentation is fine like this.
File
- coder_sniffer/
Drupal/ Test/ good/ good.php, line 1453 - This file contains all the valid notations for the drupal coding standard.
Code
function is_table_empty($table_name, $database) {
return !$database
->schema()
->tableExists($table_name) || !$database
->select($table_name)
->countQuery()
->range(0, 1)
->execute()
->fetchField();
}