diff --git a/models/GenericTable.php b/models/GenericTable.php index 8ce49f0..a06b8ef 100644 --- a/models/GenericTable.php +++ b/models/GenericTable.php @@ -37,7 +37,7 @@ class GenericTable extends PageIndex $this->tableIsSortable = !empty($options['base_url']); // How much stuff do we have? - $this->recordCount = call_user_func_array($options['get_count'], !empty($options['get_count_params']) ? $options['get_count_params'] : []); + $this->recordCount = $options['get_count'](...(!empty($options['get_count_params']) ? $options['get_count_params'] : [])); // Should we create a page index? $this->items_per_page = !empty($options['items_per_page']) ? $options['items_per_page'] : 30; @@ -60,7 +60,7 @@ class GenericTable extends PageIndex $parameters = array_merge($parameters, $options['get_data_params']); // Okay, let's fetch the data! - $data = call_user_func_array($options['get_data'], $parameters); + $data = $options['get_data'](...$parameters); // Clean up a bit. $rows = $data['rows']; @@ -150,7 +150,7 @@ class GenericTable extends PageIndex $parameters = [$column['parse']['data']['pattern']]; foreach ($column['parse']['data']['arguments'] as $identifier) $parameters[] = $row[$identifier]; - $value = call_user_func_array('sprintf', $parameters); + $value = sprintf(...$parameters); break; // timestamps: let's make them readable!