Hello, since PHP 7.4 the curly brace syntax for accessing array elements is deprecated and will be removed in PHP 8+.

Comments

peterkokot created an issue. See original summary.

peterkokot’s picture

StatusFileSize
new1.12 KB
nathandentzau’s picture

  1. +++ b/src/Form/RateSettingsForm.php
    @@ -218,7 +218,7 @@ class RateSettingsForm extends ConfigFormBase implements ContainerInjectionInter
    +          if (in_array(substr($data, 0, 1), ['Y', 'N'])) {
    

    I recommend to enable strict comparison for in_array().

    You can update your condition like this:

    if (in_array(substr($data, 0, 1), ['Y', 'N'], TRUE)) {

  2. +++ b/src/RateBotDetector.php
    @@ -163,7 +163,7 @@ class RateBotDetector {
    +          if (substr($data, 0, 1) == 'Y') {
    

    I recommend using strict comparison here as well: ===

hotwebmatter’s picture

StatusFileSize
new1.13 KB

Re-rolled the patch from #2 with the fixes recommended in #3.

nathandentzau’s picture

Looks good!

nathandentzau’s picture

Status: Needs review » Reviewed & tested by the community

krzysztof domański’s picture

Status: Reviewed & tested by the community » Fixed

Thanks all! Committed.

krzysztof domański’s picture

Test failures are unrelated. There is a problem in HEAD. It is related to SQLite and PostgreSQL.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

ericdsd’s picture

- Edited - wrong issue