Skip to content

Commit

Permalink
added static string method and test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey Petrov committed Dec 15, 2015
1 parent 7f39a31 commit b289531
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion src/SleepingOwl/Admin/Columns/Column.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* Class Column
*
* @method static \SleepingOwl\Admin\Columns\Column\Image image($name, $label = null)
* @method static \SleepingOwl\Admin\Columns\Column\ColumnString string($name, $label = null)
* @method static \SleepingOwl\Admin\Columns\Column\Date date($name, $label = null)
* @method static \SleepingOwl\Admin\Columns\Column\Lists lists($name, $label = null)
* @method static \SleepingOwl\Admin\Columns\Column\Count count($name, $label = null)
Expand Down Expand Up @@ -49,6 +48,16 @@ public static function __callStatic($method, $params)
return $column;
}

/**
* PHP7 support # Cannot use 'String' as class name as it is reserved
*
* @param $params
*/
public static function string($params)
{
self::__callStatic('ColumnString', $params);
}

/**
* @param $name
* @param string $handler
Expand Down
2 changes: 1 addition & 1 deletion tests/ModelItemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public function it_accepts_column_creating_callback()
/** @test */
public function it_stores_columns()
{
$column = Mockery::mock('\SleepingOwl\Admin\Columns\Column\String');
$column = Mockery::mock('\SleepingOwl\Admin\Columns\Column\ColumnString');

$modelItem = new ModelItem('\Foo\Bar\Model');
$modelItem->addColumn($column);
Expand Down

0 comments on commit b289531

Please sign in to comment.