Skip to content

Commit

Permalink
fix bug with late static binding and closures in PHP 5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
danomatic committed Apr 10, 2017
1 parent 1e3e30f commit b6b705a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
language: php

php:
- 5.3
- 5.4
- 5.5
- 5.6
Expand Down
5 changes: 3 additions & 2 deletions src/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,9 @@ static function getColumnNames() {
static function getColumns() {
$class = get_called_class();
if (!isset(self::$_qualifiedColumns[$class])) {
self::$_qualifiedColumns[$class] = array_map(function($column_name) {
return static::getTableName() . '.' . $column_name;
$table = static::getTableName();
self::$_qualifiedColumns[$class] = array_map(function($column_name) use ($table) {
return $table . '.' . $column_name;
}, array_keys(static::$_columns));
}

Expand Down

0 comments on commit b6b705a

Please sign in to comment.