| Conditions | 2 |
| Paths | 2 |
| Total Lines | 34 |
| Code Lines | 25 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 65 | 1 | public static function get_pattern() { |
|
| 66 | 1 | if ( null === self::$pattern ) { |
|
| 67 | $characters = array( |
||
| 68 | 1 | 'A-Z', |
|
| 69 | 'a-z', |
||
| 70 | '0-9', |
||
| 71 | '=', |
||
| 72 | ' ', |
||
| 73 | '%', |
||
| 74 | '*', |
||
| 75 | '+', |
||
| 76 | '-', |
||
| 77 | '.', |
||
| 78 | '/', |
||
| 79 | '&', |
||
| 80 | '@', |
||
| 81 | '"', |
||
| 82 | '\'', |
||
| 83 | ':', |
||
| 84 | ';', |
||
| 85 | '?', |
||
| 86 | '(', |
||
| 87 | ')', |
||
| 88 | '$', |
||
| 89 | ); |
||
| 90 | |||
| 91 | /* |
||
| 92 | * We use a # as a regex delimiter instead of a / so we don't have to escape the slash. |
||
| 93 | * @link http://stackoverflow.com/q/12239424 |
||
| 94 | */ |
||
| 95 | 1 | self::$pattern = '#[^' . implode( $characters ) . ']#'; |
|
| 96 | } |
||
| 97 | |||
| 98 | 1 | return self::$pattern; |
|
| 99 | } |
||
| 111 |