Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH Add generic types #108

Merged
merged 1 commit into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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