Skip to content

Commit

Permalink
Added separate function trimHeader
Browse files Browse the repository at this point in the history
  • Loading branch information
Kedrigern committed Sep 2, 2014
1 parent 3a5fe94 commit fdc49f2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/RecordTable.php
Expand Up @@ -183,10 +183,17 @@ public function useFirstRowAsHeader($trim = false) {
unset($this->table[0]);
$this->table = array_values($this->table); // normalize indexes
if($trim) {
array_walk_recursive($this->header, function(&$val) { $val = trim($val); });
$this->trimHeader();
}
}

/**
* Trim header
*/
public function trimHeader() {
array_walk_recursive($this->header, function(&$val) { $val = trim($val); });
}

/**
* @param string $name
* @param callable|null $compare
Expand Down

0 comments on commit fdc49f2

Please sign in to comment.