mirror of
https://github.com/silverstripe/silverstripe-spamprotection.git
synced 2024-10-22 14:05:59 +02:00
ENH Add generic types (#108)
This commit is contained in:
parent
a5b2363e35
commit
77aba75ffa
@ -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
|
||||||
|
@ -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)
|
||||||
|
@ -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 = [])
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user