1 | <?php |
||
5 | class Url |
||
6 | { |
||
7 | |||
8 | private $protocol = '(?:(?:[a-z]+:)?\/\/)'; |
||
9 | private $auth = '(?:\\S+(?::\\S*)?@)?'; |
||
10 | private $ip = '^(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:[.](?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}'; |
||
|
|||
11 | private $tld = "(?<TLD>\.\w+?)(?:$|\/)"; |
||
12 | private $tldAlt = '(?:[a-z\\\\u00a1-\\\\uffff]{2,})'; |
||
13 | private $host = '(?:(?:[a-z\\\\u00a1-\\\\uffff0-9][-_]*)*[a-z\\\\u00a1-\\\\uffff0-9]+)'; |
||
14 | private $domain = '(?:\\.(?:[a-z\\\\u00a1-\\\\uffff0-9]-*)*[a-z\\\\u00a1-\\\\uffff0-9]+)*'; |
||
15 | private $port = '(?::\\\\d{2,5})?'; |
||
16 | private $path = '(?:[^\s\b\n|]*[^.,;:\?\!\@\^\$ -]*)?'; |
||
17 | |||
18 | private $standardUrlRegEx = ''; |
||
19 | private $stringService; |
||
20 | |||
21 | public function __construct($options = []) |
||
26 | |||
27 | private function setUrlRegex() |
||
33 | |||
34 | function remove($str) |
||
38 | } |
Short variable names may make your code harder to understand. Variable names should be self-descriptive. This check looks for variable names who are shorter than a configured minimum.