Add missing class imports from docblocks and fix incorrect docblocks

This commit is contained in:
Robbie Averill 2018-04-06 10:21:26 +12:00
parent ba8ad43f41
commit c123951768
9 changed files with 31 additions and 15 deletions

View File

@ -4,8 +4,10 @@ namespace SilverStripe\Blog\Admin;
use SilverStripe\Blog\Forms\GridField\GridFieldAddByDBField; use SilverStripe\Blog\Forms\GridField\GridFieldAddByDBField;
use SilverStripe\Blog\Model\CategorisationObject; use SilverStripe\Blog\Model\CategorisationObject;
use SilverStripe\Forms\GridField\GridFieldAddNewButton;
use SilverStripe\Forms\GridField\GridFieldConfig_RecordEditor; use SilverStripe\Forms\GridField\GridFieldConfig_RecordEditor;
use SilverStripe\Forms\GridField\GridFieldDataColumns; use SilverStripe\Forms\GridField\GridFieldDataColumns;
use SilverStripe\ORM\SS_List;
class GridFieldCategorisationConfig extends GridFieldConfig_RecordEditor class GridFieldCategorisationConfig extends GridFieldConfig_RecordEditor
{ {
@ -20,7 +22,7 @@ class GridFieldCategorisationConfig extends GridFieldConfig_RecordEditor
{ {
parent::__construct($itemsPerPage); parent::__construct($itemsPerPage);
$this->removeComponentsByType('SilverStripe\\Forms\\GridField\\GridFieldAddNewButton'); $this->removeComponentsByType(GridFieldAddNewButton::class);
$this->addComponent( $this->addComponent(
GridFieldAddByDBField::create('buttons-before-left') GridFieldAddByDBField::create('buttons-before-left')
@ -33,7 +35,7 @@ class GridFieldCategorisationConfig extends GridFieldConfig_RecordEditor
/** /**
* @var GridFieldDataColumns $columns * @var GridFieldDataColumns $columns
*/ */
$columns = $this->getComponentByType('SilverStripe\\Forms\\GridField\\GridFieldDataColumns'); $columns = $this->getComponentByType(GridFieldDataColumns::class);
$columns->setFieldFormatting( $columns->setFieldFormatting(
[ [
@ -54,7 +56,7 @@ class GridFieldCategorisationConfig extends GridFieldConfig_RecordEditor
/** /**
* @var GridFieldDataColumns $columns * @var GridFieldDataColumns $columns
*/ */
$columns = $this->getComponentByType('SilverStripe\\Forms\\GridField\\GridFieldDataColumns'); $columns = $this->getComponentByType(GridFieldDataColumns::class);
$columns->setDisplayFields( $columns->setDisplayFields(
[ [

View File

@ -3,6 +3,7 @@
namespace SilverStripe\Blog\Forms\GridField; namespace SilverStripe\Blog\Forms\GridField;
use SilverStripe\Control\Controller; use SilverStripe\Control\Controller;
use SilverStripe\Control\HTTPResponse;
use SilverStripe\Core\Convert; use SilverStripe\Core\Convert;
use SilverStripe\Core\Injector\Injectable; use SilverStripe\Core\Injector\Injectable;
use SilverStripe\Forms\GridField\GridField; use SilverStripe\Forms\GridField\GridField;
@ -11,6 +12,8 @@ use SilverStripe\Forms\GridField\GridField_FormAction;
use SilverStripe\Forms\GridField\GridField_HTMLProvider; use SilverStripe\Forms\GridField\GridField_HTMLProvider;
use SilverStripe\Forms\TextField; use SilverStripe\Forms\TextField;
use SilverStripe\ORM\ArrayList; use SilverStripe\ORM\ArrayList;
use SilverStripe\ORM\DataList;
use SilverStripe\ORM\DataObject;
use SilverStripe\Security\Security; use SilverStripe\Security\Security;
use SilverStripe\View\ArrayData; use SilverStripe\View\ArrayData;
use SilverStripe\View\Requirements; use SilverStripe\View\Requirements;
@ -69,7 +72,7 @@ class GridFieldAddByDBField implements GridField_ActionProvider, GridField_HTMLP
* @param $arguments mixed * @param $arguments mixed
* @param $data array * @param $data array
* *
* @return null|SS_HTTPResponse * @return null|HTTPResponse
* *
* @throws UnexpectedValueException * @throws UnexpectedValueException
*/ */
@ -154,7 +157,7 @@ class GridFieldAddByDBField implements GridField_ActionProvider, GridField_HTMLP
* *
* @param $gridField GridField * @param $gridField GridField
* *
* @return string * @return string[]
*/ */
public function getHTMLFragments($gridField) public function getHTMLFragments($gridField)
{ {
@ -170,7 +173,7 @@ class GridFieldAddByDBField implements GridField_ActionProvider, GridField_HTMLP
$obj = singleton($dataClass); $obj = singleton($dataClass);
if (!$obj->canCreate()) { if (!$obj->canCreate()) {
return ''; return [];
} }
$dbField = $this->getDataObjectField(); $dbField = $this->getDataObjectField();

View File

@ -8,12 +8,16 @@ use SilverStripe\Blog\Forms\GridField\GridFieldConfigBlogPost;
use SilverStripe\CMS\Controllers\RootURLController; use SilverStripe\CMS\Controllers\RootURLController;
use SilverStripe\Control\Controller; use SilverStripe\Control\Controller;
use SilverStripe\Core\Convert; use SilverStripe\Core\Convert;
use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\GridField\GridField; use SilverStripe\Forms\GridField\GridField;
use SilverStripe\Forms\GridField\GridFieldConfig;
use SilverStripe\Forms\ListboxField; use SilverStripe\Forms\ListboxField;
use SilverStripe\Forms\LiteralField; use SilverStripe\Forms\LiteralField;
use SilverStripe\Forms\NumericField; use SilverStripe\Forms\NumericField;
use SilverStripe\ORM\DataList;
use SilverStripe\ORM\DataObject; use SilverStripe\ORM\DataObject;
use SilverStripe\ORM\DB; use SilverStripe\ORM\DB;
use SilverStripe\ORM\SS_List;
use SilverStripe\ORM\UnsavedRelationList; use SilverStripe\ORM\UnsavedRelationList;
use SilverStripe\Security\Group; use SilverStripe\Security\Group;
use SilverStripe\Security\Member; use SilverStripe\Security\Member;
@ -443,12 +447,12 @@ class Blog extends Page implements PermissionProvider
$list = Member::get(); $list = Member::get();
$this->extend('updateCandidateUsers', $list); $this->extend('updateCandidateUsers', $list);
return $list; return $list;
} else { }
return Permission::get_members_by_permission( return Permission::get_members_by_permission(
$this->config()->get('grant_user_permission') $this->config()->get('grant_user_permission')
); );
} }
}
/** /**
* Determine if this user can edit the editors list. * Determine if this user can edit the editors list.

View File

@ -108,7 +108,7 @@ class BlogFilter extends Lumberjack
$tab = Tab::create('ChildPages', $this->getLumberjackTitle(), $gridField); $tab = Tab::create('ChildPages', $this->getLumberjackTitle(), $gridField);
$fields->insertBefore($tab, 'Main'); $fields->insertBefore('Main', $tab);
} }
} }
} }

View File

@ -8,6 +8,8 @@ use SilverStripe\Forms\Tab;
use SilverStripe\Forms\TabSet; use SilverStripe\Forms\TabSet;
use SilverStripe\Forms\TextField; use SilverStripe\Forms\TextField;
use SilverStripe\ORM\DataList; use SilverStripe\ORM\DataList;
use SilverStripe\ORM\ValidationResult;
use SilverStripe\Security\Member;
use SilverStripe\Security\Permission; use SilverStripe\Security\Permission;
use SilverStripe\View\Parsers\URLSegmentFilter; use SilverStripe\View\Parsers\URLSegmentFilter;

View File

@ -8,12 +8,15 @@ use SilverStripe\Assets\Image;
use SilverStripe\Control\Controller; use SilverStripe\Control\Controller;
use SilverStripe\Core\Config\Config; use SilverStripe\Core\Config\Config;
use SilverStripe\Forms\DatetimeField; use SilverStripe\Forms\DatetimeField;
use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\HTMLEditor\HTMLEditorField; use SilverStripe\Forms\HTMLEditor\HTMLEditorField;
use SilverStripe\Forms\ListboxField; use SilverStripe\Forms\ListboxField;
use SilverStripe\Forms\TextField; use SilverStripe\Forms\TextField;
use SilverStripe\Forms\ToggleCompositeField; use SilverStripe\Forms\ToggleCompositeField;
use SilverStripe\ORM\ArrayList; use SilverStripe\ORM\ArrayList;
use SilverStripe\ORM\FieldType\DBDatetime; use SilverStripe\ORM\FieldType\DBDatetime;
use SilverStripe\ORM\FieldType\DBHTMLText;
use SilverStripe\ORM\SS_List;
use SilverStripe\ORM\UnsavedRelationList; use SilverStripe\ORM\UnsavedRelationList;
use SilverStripe\Security\Group; use SilverStripe\Security\Group;
use SilverStripe\Security\Member; use SilverStripe\Security\Member;
@ -605,7 +608,7 @@ class BlogPost extends Page
*/ */
public function Excerpt($wordsToDisplay = 30) public function Excerpt($wordsToDisplay = 30)
{ {
/** @var HTMLText $content */ /** @var DBHTMLText $content */
$content = $this->dbObject('Content'); $content = $this->dbObject('Content');
return $content->Summary($wordsToDisplay); return $content->Summary($wordsToDisplay);

View File

@ -23,7 +23,8 @@ class BlogPostFilter extends DataExtension
/** /**
* Augment queries so that we don't fetch unpublished articles. * Augment queries so that we don't fetch unpublished articles.
* *
* @param SQLQuery $query * @param SQLSelect $query
* @param DataQuery $query
*/ */
public function augmentSQL(SQLSelect $query, DataQuery $dataQuery = null) public function augmentSQL(SQLSelect $query, DataQuery $dataQuery = null)
{ {

View File

@ -5,11 +5,13 @@ namespace SilverStripe\Blog\Widgets;
use SilverStripe\Blog\Model\Blog; use SilverStripe\Blog\Model\Blog;
use SilverStripe\Control\Controller; use SilverStripe\Control\Controller;
use SilverStripe\Forms\DropdownField; use SilverStripe\Forms\DropdownField;
use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\NumericField; use SilverStripe\Forms\NumericField;
use SilverStripe\ORM\ArrayList; use SilverStripe\ORM\ArrayList;
use SilverStripe\ORM\DB; use SilverStripe\ORM\DB;
use SilverStripe\ORM\FieldType\DBDate; use SilverStripe\ORM\FieldType\DBDate;
use SilverStripe\ORM\FieldType\DBDatetime; use SilverStripe\ORM\FieldType\DBDatetime;
use SilverStripe\ORM\FieldType\DBEnum;
use SilverStripe\ORM\Queries\SQLSelect; use SilverStripe\ORM\Queries\SQLSelect;
use SilverStripe\Versioned\Versioned; use SilverStripe\Versioned\Versioned;
use SilverStripe\View\ArrayData; use SilverStripe\View\ArrayData;
@ -76,7 +78,7 @@ class BlogArchiveWidget extends Widget
{ {
$this->beforeUpdateCMSFields(function ($fields) { $this->beforeUpdateCMSFields(function ($fields) {
/** /**
* @var Enum $archiveType * @var DBEnum $archiveType
*/ */
$archiveType = $this->dbObject('ArchiveType'); $archiveType = $this->dbObject('ArchiveType');

View File

@ -5,7 +5,6 @@ namespace SilverStripe\Blog\Tests;
use SilverStripe\Blog\Model\Blog; use SilverStripe\Blog\Model\Blog;
use SilverStripe\Dev\SapphireTest; use SilverStripe\Dev\SapphireTest;
use SilverStripe\ORM\FieldType\DBDatetime; use SilverStripe\ORM\FieldType\DBDatetime;
use SilverStripe\Security\Member;
use SilverStripe\Security\Security; use SilverStripe\Security\Security;
/** /**