Fix linting issues and fix doc

This commit is contained in:
Christopher Joe 2017-10-05 15:28:58 +13:00
parent 6424f4dea0
commit e07658ef50

View File

@ -1,8 +1,6 @@
<?php
namespace SilverStripe\Forms\GridField;
use SilverStripe\Forms\GridField\GridField;
use SilverStripe\Forms\GridField\GridField_ColumnProvider;
use SilverStripe\ORM\DataObject;
use SilverStripe\Versioned\Versioned;
use SilverStripe\Core\Convert;
@ -17,7 +15,8 @@ class GridFieldVersionedState implements GridField_ColumnProvider
*/
protected $versionedLabelFields = ['Title'];
public function __construct($versionedLabelFields = null) {
public function __construct($versionedLabelFields = null)
{
if ($versionedLabelFields) {
$this->versionedLabelFields = $versionedLabelFields;
}
@ -48,9 +47,8 @@ class GridFieldVersionedState implements GridField_ColumnProvider
if (count($matchedVersionedFields) > 0) {
$this->column = array_values($matchedVersionedFields)[0];
}
} elseif ($columns) {
// Use first column
else if ($columns) {
$this->column = $columns[0];
}
}
@ -142,11 +140,11 @@ class GridFieldVersionedState implements GridField_ColumnProvider
* )
* ```
*
* @param bool $cached Whether to serve the fields from cache; false
* regenerate them
* @param DataObject $record - the record to check status for
* @return array
*/
protected function getStatusFlags($record) {
protected function getStatusFlags($record)
{
$flags = array();
if ($record->isOnLiveOnly()) {