Skip to content

Commit

Permalink
ENH Add generic types (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli authored Jan 18, 2024
1 parent a5b2363 commit 77aba75
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
3 changes: 1 addition & 2 deletions src/EditableSpamProtectionField.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public function setFormField(FormField $field)
/**
* Gets the list of all candidate spam detectable fields on this field's form
*
* @return DataList
* @return DataList<EditableFormField>
*/
protected function getCandidateFields()
{
Expand Down Expand Up @@ -151,7 +151,6 @@ public function onBeforeWrite()
*/
public function getCMSFields()
{
/** @var FieldList $fields */
$fields = parent::getCMSFields();

// Get protector
Expand Down
4 changes: 2 additions & 2 deletions src/Extension/CommentSpamProtection.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

namespace SilverStripe\SpamProtection\Extension;

use SilverStripe\Comments\Controllers\CommentingController;
use SilverStripe\Core\Extension;

/**
* Apply the spam protection to the comments module if it is installed.
*
* @package spamprotection
* @extends Extension<CommentingController>
*/

class CommentSpamProtection extends Extension
{
public function alterCommentForm(&$form)
Expand Down
6 changes: 3 additions & 3 deletions src/Extension/FormSpamProtectionExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
use SilverStripe\Core\Config\Configurable;
use SilverStripe\Core\Extension;
use SilverStripe\Core\Injector\Injector;
use SilverStripe\Forms\Form;

/**
* An extension to the {@link Form} class which provides the method
* {@link enableSpamProtection()} helper.
*
* @package spamprotection
* @extends Extension<Form>
*/

class FormSpamProtectionExtension extends Extension
{
use Configurable;
Expand Down Expand Up @@ -86,7 +86,7 @@ public static function get_protector($options = null)
*
* @param array $options
* @throws LogicException when get_protector method returns NULL.
* @return Object
* @return Form
*/
public function enableSpamProtection($options = [])
{
Expand Down

0 comments on commit 77aba75

Please sign in to comment.