ENH Add generic types (#108)

This commit is contained in:
Guy Sartorelli 2024-01-19 10:44:37 +13:00 committed by GitHub
parent a5b2363e35
commit 77aba75ffa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 7 deletions

View File

@ -98,7 +98,7 @@ class EditableSpamProtectionField extends EditableFormField
/** /**
* Gets the list of all candidate spam detectable fields on this field's form * Gets the list of all candidate spam detectable fields on this field's form
* *
* @return DataList * @return DataList<EditableFormField>
*/ */
protected function getCandidateFields() protected function getCandidateFields()
{ {
@ -151,7 +151,6 @@ class EditableSpamProtectionField extends EditableFormField
*/ */
public function getCMSFields() public function getCMSFields()
{ {
/** @var FieldList $fields */
$fields = parent::getCMSFields(); $fields = parent::getCMSFields();
// Get protector // Get protector

View File

@ -2,14 +2,14 @@
namespace SilverStripe\SpamProtection\Extension; namespace SilverStripe\SpamProtection\Extension;
use SilverStripe\Comments\Controllers\CommentingController;
use SilverStripe\Core\Extension; use SilverStripe\Core\Extension;
/** /**
* Apply the spam protection to the comments module if it is installed. * Apply the spam protection to the comments module if it is installed.
* *
* @package spamprotection * @extends Extension<CommentingController>
*/ */
class CommentSpamProtection extends Extension class CommentSpamProtection extends Extension
{ {
public function alterCommentForm(&$form) public function alterCommentForm(&$form)

View File

@ -6,14 +6,14 @@ use LogicException;
use SilverStripe\Core\Config\Configurable; use SilverStripe\Core\Config\Configurable;
use SilverStripe\Core\Extension; use SilverStripe\Core\Extension;
use SilverStripe\Core\Injector\Injector; use SilverStripe\Core\Injector\Injector;
use SilverStripe\Forms\Form;
/** /**
* An extension to the {@link Form} class which provides the method * An extension to the {@link Form} class which provides the method
* {@link enableSpamProtection()} helper. * {@link enableSpamProtection()} helper.
* *
* @package spamprotection * @extends Extension<Form>
*/ */
class FormSpamProtectionExtension extends Extension class FormSpamProtectionExtension extends Extension
{ {
use Configurable; use Configurable;
@ -86,7 +86,7 @@ class FormSpamProtectionExtension extends Extension
* *
* @param array $options * @param array $options
* @throws LogicException when get_protector method returns NULL. * @throws LogicException when get_protector method returns NULL.
* @return Object * @return Form
*/ */
public function enableSpamProtection($options = []) public function enableSpamProtection($options = [])
{ {