Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
honeypot-3293203
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
honeypot-3293203
Commits
fff653ce
Commit
fff653ce
authored
7 years ago
by
Jeff Geerling
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2856356
by geerlingguy: Fix remaining coding standards issues.
parent
d2d7f23f
No related branches found
Branches containing commit
Tags
8.x-1.24
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
honeypot.module
+2
-2
2 additions, 2 deletions
honeypot.module
src/Controller/HoneypotSettingsController.php
+3
-1
3 additions, 1 deletion
src/Controller/HoneypotSettingsController.php
src/Tests/HoneypotFormCacheTest.php
+1
-1
1 addition, 1 deletion
src/Tests/HoneypotFormCacheTest.php
with
6 additions
and
4 deletions
honeypot.module
+
2
−
2
View file @
fff653ce
...
...
@@ -98,7 +98,7 @@ function honeypot_get_protected_forms() {
* Array of options to be added to form. Currently accepts 'honeypot' and
* 'time_restriction'.
*/
function
honeypot_add_form_protection
(
&
$form
,
FormStateInterface
$form_state
,
array
$options
=
array
()
)
{
function
honeypot_add_form_protection
(
&
$form
,
FormStateInterface
$form_state
,
array
$options
=
[]
)
{
$account
=
\Drupal
::
currentUser
();
// Allow other modules to alter the protections applied to this form.
...
...
@@ -237,7 +237,7 @@ function _honeypot_log($form_id, $type) {
* @param array $form_values
* Array of form values (optional).
*/
function
honeypot_get_time_limit
(
array
$form_values
=
array
()
)
{
function
honeypot_get_time_limit
(
array
$form_values
=
[]
)
{
$account
=
\Drupal
::
currentUser
();
$honeypot_time_limit
=
\Drupal
::
config
(
'honeypot.settings'
)
->
get
(
'time_limit'
);
...
...
This diff is collapsed.
Click to expand it.
src/Controller/HoneypotSettingsController.php
+
3
−
1
View file @
fff653ce
...
...
@@ -58,6 +58,8 @@ class HoneypotSettingsController extends ConfigFormBase {
* The entity type manager.
* @param \Drupal\Core\Entity\EntityTypeBundleInfoInterface $entity_type_bundle_info
* The entity type bundle info service.
* @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
* The cache backend interface.
*/
public
function
__construct
(
ConfigFactoryInterface
$config_factory
,
ModuleHandlerInterface
$module_handler
,
EntityTypeManagerInterface
$entity_type_manager
,
EntityTypeBundleInfoInterface
$entity_type_bundle_info
,
CacheBackendInterface
$cache_backend
)
{
parent
::
__construct
(
$config_factory
);
...
...
@@ -203,7 +205,7 @@ class HoneypotSettingsController extends ConfigFormBase {
foreach
(
$bundles
as
$bundle_key
=>
$bundle
)
{
$stub
=
$this
->
entityTypeManager
->
getStorage
(
'contact_message'
)
->
create
([
'contact_form'
=>
$bundle_key
'contact_form'
=>
$bundle_key
,
]);
$formController
->
setEntity
(
$stub
);
$form_id
=
$formController
->
getFormId
();
...
...
This diff is collapsed.
Click to expand it.
src/Tests/HoneypotFormCacheTest.php
+
1
−
1
View file @
fff653ce
...
...
@@ -22,7 +22,7 @@ class HoneypotFormCacheTest extends WebTestBase {
*
* @var array
*/
public
static
$modules
=
array
(
'honeypot'
,
'node'
,
'comment'
,
'contact'
)
;
public
static
$modules
=
[
'honeypot'
,
'node'
,
'comment'
,
'contact'
]
;
protected
$node
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment