Issue Task Closed

#104536Add PhpStand max failure to baseline

Anja Leichsenring 08/02/24, 08:27 updated 10/15/24, 09:08

Description

 ------ ------------------------------------------------------------------- 
  Line   core/Classes/DataHandling/SlugHelper.php                           
 ------ ------------------------------------------------------------------- 
  128    Regex pattern is invalid: Compilation failed: quantifier does not  
         follow a repeatable item at offset 5 in pattern: /.*{2,}/          
         :identification_card:  regexp.pattern                                                 
 ------ ------------------------------------------------------------------- 

We could not find the reason for that mangled regex and think it is a bug in phpstan. In order got return a nice green status to our nightly CI, the error is added to the baseline and reviewed later on, when a reason is found.

Reviews 2

History 49

  1. Markus Klein commented <span data-processor="relativetime" data-value="2024-08-02T08:41:19+00:00" > 08/02/24, 08:41 </span>

    I found no occurrence of ‘.*’ as a pattern.
    Also it does not make sense, the line:

    $value = (string)preg_replace('/' . preg_quote($fallbackCharacter) . '{2,}/', $fallbackCharacter, $value);

    will never produce the regex /.*{2,}/.

  2. Andreas Wolf commented <span data-processor="relativetime" data-value="2024-08-02T09:35:35+00:00" > 08/02/24, 09:35 </span>

    The issue was already fixed in PhpStan: https://github.com/phpstan/phpstan-src/commit/164691dfb89d73b34d46bf07fc6771e6f507d946

    So it will likely be good in the next release. I would thus add a “conflict” for PhpStan 1.11.9 or change the constraint to “^1.11.8 !1.11.9”.

  3. Anja Leichsenring commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2024-08-02T14:25:08+00:00" > 08/02/24, 14:25 </span>

    Applied in changeset commit:2fc9f438595a8532bc8c3e6be0bbee3f9bb1ac11.