mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
Add missing class imports from docblocks and fix incorrect docblocks
This commit is contained in:
parent
ba8ad43f41
commit
c123951768
@ -4,8 +4,10 @@ namespace SilverStripe\Blog\Admin;
|
||||
|
||||
use SilverStripe\Blog\Forms\GridField\GridFieldAddByDBField;
|
||||
use SilverStripe\Blog\Model\CategorisationObject;
|
||||
use SilverStripe\Forms\GridField\GridFieldAddNewButton;
|
||||
use SilverStripe\Forms\GridField\GridFieldConfig_RecordEditor;
|
||||
use SilverStripe\Forms\GridField\GridFieldDataColumns;
|
||||
use SilverStripe\ORM\SS_List;
|
||||
|
||||
class GridFieldCategorisationConfig extends GridFieldConfig_RecordEditor
|
||||
{
|
||||
@ -20,7 +22,7 @@ class GridFieldCategorisationConfig extends GridFieldConfig_RecordEditor
|
||||
{
|
||||
parent::__construct($itemsPerPage);
|
||||
|
||||
$this->removeComponentsByType('SilverStripe\\Forms\\GridField\\GridFieldAddNewButton');
|
||||
$this->removeComponentsByType(GridFieldAddNewButton::class);
|
||||
|
||||
$this->addComponent(
|
||||
GridFieldAddByDBField::create('buttons-before-left')
|
||||
@ -33,7 +35,7 @@ class GridFieldCategorisationConfig extends GridFieldConfig_RecordEditor
|
||||
/**
|
||||
* @var GridFieldDataColumns $columns
|
||||
*/
|
||||
$columns = $this->getComponentByType('SilverStripe\\Forms\\GridField\\GridFieldDataColumns');
|
||||
$columns = $this->getComponentByType(GridFieldDataColumns::class);
|
||||
|
||||
$columns->setFieldFormatting(
|
||||
[
|
||||
@ -54,7 +56,7 @@ class GridFieldCategorisationConfig extends GridFieldConfig_RecordEditor
|
||||
/**
|
||||
* @var GridFieldDataColumns $columns
|
||||
*/
|
||||
$columns = $this->getComponentByType('SilverStripe\\Forms\\GridField\\GridFieldDataColumns');
|
||||
$columns = $this->getComponentByType(GridFieldDataColumns::class);
|
||||
|
||||
$columns->setDisplayFields(
|
||||
[
|
||||
|
@ -3,6 +3,7 @@
|
||||
namespace SilverStripe\Blog\Forms\GridField;
|
||||
|
||||
use SilverStripe\Control\Controller;
|
||||
use SilverStripe\Control\HTTPResponse;
|
||||
use SilverStripe\Core\Convert;
|
||||
use SilverStripe\Core\Injector\Injectable;
|
||||
use SilverStripe\Forms\GridField\GridField;
|
||||
@ -11,6 +12,8 @@ use SilverStripe\Forms\GridField\GridField_FormAction;
|
||||
use SilverStripe\Forms\GridField\GridField_HTMLProvider;
|
||||
use SilverStripe\Forms\TextField;
|
||||
use SilverStripe\ORM\ArrayList;
|
||||
use SilverStripe\ORM\DataList;
|
||||
use SilverStripe\ORM\DataObject;
|
||||
use SilverStripe\Security\Security;
|
||||
use SilverStripe\View\ArrayData;
|
||||
use SilverStripe\View\Requirements;
|
||||
@ -69,7 +72,7 @@ class GridFieldAddByDBField implements GridField_ActionProvider, GridField_HTMLP
|
||||
* @param $arguments mixed
|
||||
* @param $data array
|
||||
*
|
||||
* @return null|SS_HTTPResponse
|
||||
* @return null|HTTPResponse
|
||||
*
|
||||
* @throws UnexpectedValueException
|
||||
*/
|
||||
@ -154,7 +157,7 @@ class GridFieldAddByDBField implements GridField_ActionProvider, GridField_HTMLP
|
||||
*
|
||||
* @param $gridField GridField
|
||||
*
|
||||
* @return string
|
||||
* @return string[]
|
||||
*/
|
||||
public function getHTMLFragments($gridField)
|
||||
{
|
||||
@ -170,7 +173,7 @@ class GridFieldAddByDBField implements GridField_ActionProvider, GridField_HTMLP
|
||||
$obj = singleton($dataClass);
|
||||
|
||||
if (!$obj->canCreate()) {
|
||||
return '';
|
||||
return [];
|
||||
}
|
||||
|
||||
$dbField = $this->getDataObjectField();
|
||||
|
@ -8,12 +8,16 @@ use SilverStripe\Blog\Forms\GridField\GridFieldConfigBlogPost;
|
||||
use SilverStripe\CMS\Controllers\RootURLController;
|
||||
use SilverStripe\Control\Controller;
|
||||
use SilverStripe\Core\Convert;
|
||||
use SilverStripe\Forms\FieldList;
|
||||
use SilverStripe\Forms\GridField\GridField;
|
||||
use SilverStripe\Forms\GridField\GridFieldConfig;
|
||||
use SilverStripe\Forms\ListboxField;
|
||||
use SilverStripe\Forms\LiteralField;
|
||||
use SilverStripe\Forms\NumericField;
|
||||
use SilverStripe\ORM\DataList;
|
||||
use SilverStripe\ORM\DataObject;
|
||||
use SilverStripe\ORM\DB;
|
||||
use SilverStripe\ORM\SS_List;
|
||||
use SilverStripe\ORM\UnsavedRelationList;
|
||||
use SilverStripe\Security\Group;
|
||||
use SilverStripe\Security\Member;
|
||||
@ -443,12 +447,12 @@ class Blog extends Page implements PermissionProvider
|
||||
$list = Member::get();
|
||||
$this->extend('updateCandidateUsers', $list);
|
||||
return $list;
|
||||
} else {
|
||||
}
|
||||
|
||||
return Permission::get_members_by_permission(
|
||||
$this->config()->get('grant_user_permission')
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if this user can edit the editors list.
|
||||
|
@ -108,7 +108,7 @@ class BlogFilter extends Lumberjack
|
||||
|
||||
$tab = Tab::create('ChildPages', $this->getLumberjackTitle(), $gridField);
|
||||
|
||||
$fields->insertBefore($tab, 'Main');
|
||||
$fields->insertBefore('Main', $tab);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -8,6 +8,8 @@ use SilverStripe\Forms\Tab;
|
||||
use SilverStripe\Forms\TabSet;
|
||||
use SilverStripe\Forms\TextField;
|
||||
use SilverStripe\ORM\DataList;
|
||||
use SilverStripe\ORM\ValidationResult;
|
||||
use SilverStripe\Security\Member;
|
||||
use SilverStripe\Security\Permission;
|
||||
use SilverStripe\View\Parsers\URLSegmentFilter;
|
||||
|
||||
|
@ -8,12 +8,15 @@ use SilverStripe\Assets\Image;
|
||||
use SilverStripe\Control\Controller;
|
||||
use SilverStripe\Core\Config\Config;
|
||||
use SilverStripe\Forms\DatetimeField;
|
||||
use SilverStripe\Forms\FieldList;
|
||||
use SilverStripe\Forms\HTMLEditor\HTMLEditorField;
|
||||
use SilverStripe\Forms\ListboxField;
|
||||
use SilverStripe\Forms\TextField;
|
||||
use SilverStripe\Forms\ToggleCompositeField;
|
||||
use SilverStripe\ORM\ArrayList;
|
||||
use SilverStripe\ORM\FieldType\DBDatetime;
|
||||
use SilverStripe\ORM\FieldType\DBHTMLText;
|
||||
use SilverStripe\ORM\SS_List;
|
||||
use SilverStripe\ORM\UnsavedRelationList;
|
||||
use SilverStripe\Security\Group;
|
||||
use SilverStripe\Security\Member;
|
||||
@ -605,7 +608,7 @@ class BlogPost extends Page
|
||||
*/
|
||||
public function Excerpt($wordsToDisplay = 30)
|
||||
{
|
||||
/** @var HTMLText $content */
|
||||
/** @var DBHTMLText $content */
|
||||
$content = $this->dbObject('Content');
|
||||
|
||||
return $content->Summary($wordsToDisplay);
|
||||
|
@ -23,7 +23,8 @@ class BlogPostFilter extends DataExtension
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
|
@ -5,11 +5,13 @@ namespace SilverStripe\Blog\Widgets;
|
||||
use SilverStripe\Blog\Model\Blog;
|
||||
use SilverStripe\Control\Controller;
|
||||
use SilverStripe\Forms\DropdownField;
|
||||
use SilverStripe\Forms\FieldList;
|
||||
use SilverStripe\Forms\NumericField;
|
||||
use SilverStripe\ORM\ArrayList;
|
||||
use SilverStripe\ORM\DB;
|
||||
use SilverStripe\ORM\FieldType\DBDate;
|
||||
use SilverStripe\ORM\FieldType\DBDatetime;
|
||||
use SilverStripe\ORM\FieldType\DBEnum;
|
||||
use SilverStripe\ORM\Queries\SQLSelect;
|
||||
use SilverStripe\Versioned\Versioned;
|
||||
use SilverStripe\View\ArrayData;
|
||||
@ -76,7 +78,7 @@ class BlogArchiveWidget extends Widget
|
||||
{
|
||||
$this->beforeUpdateCMSFields(function ($fields) {
|
||||
/**
|
||||
* @var Enum $archiveType
|
||||
* @var DBEnum $archiveType
|
||||
*/
|
||||
$archiveType = $this->dbObject('ArchiveType');
|
||||
|
||||
|
@ -5,7 +5,6 @@ namespace SilverStripe\Blog\Tests;
|
||||
use SilverStripe\Blog\Model\Blog;
|
||||
use SilverStripe\Dev\SapphireTest;
|
||||
use SilverStripe\ORM\FieldType\DBDatetime;
|
||||
use SilverStripe\Security\Member;
|
||||
use SilverStripe\Security\Security;
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user