Skip to content

struggle-for-php/angry-regex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

struggle-for-php/angry-regex

PHPStan Rule to detect Unfavorable Regex.

and add more checking than PHPStan's Regex check.

Based on Tokumaru's statement

Example

$ ../vendor/bin/phpstan analyse --level=1 src/
Note: Using configuration file /tmp/angry-regex/demo/phpstan.neon.
 2/2 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 ------ -------------------------------------------------------------
  Line   Demo.php
 ------ -------------------------------------------------------------
  17     Regex pattern is invalid: Unfavorable `^` or `$` /^[0-9]+$/
 ------ -------------------------------------------------------------


 [ERROR] Found 1 error

Installation

composer require --dev struggle-for-php/angry-regex

Configuration

In your phpstan.neon configuration, add following section:

includes:
	- vendor/struggle-for-php/angry-regex/rules.neon

Also see.

 - Validator\Ip should not allow newlines in any case. - zendframework/zendframework#6104

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy