-
Notifications
You must be signed in to change notification settings - Fork 0
/
Text.php
81 lines (76 loc) · 2.82 KB
/
Text.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?php declare(strict_types = 1);
/*
* This file is part of the Vairogs package.
*
* (c) Dāvis Zālītis (k0d3r1s) <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Vairogs\Component\Functions;
final class Text
{
use Text\_Br2nl;
use Text\_CamelCase;
use Text\_CleanText;
use Text\_Compare;
use Text\_Contains;
use Text\_ContainsAny;
use Text\_CountryName;
use Text\_CyrillicToLatin;
use Text\_HtmlEntityDecode;
use Text\_IsHex;
use Text\_KeepNumeric;
use Text\_LastPart;
use Text\_LatinToCyrillic;
use Text\_LimitChars;
use Text\_LimitWords;
use Text\_LongestSubstrLength;
use Text\_Nl2br;
use Text\_NormalizedValue;
use Text\_OneSpace;
use Text\_PascalCase;
use Text\_Pluralize;
use Text\_RandomString;
use Text\_ReverseUTF8;
use Text\_Sanitize;
use Text\_SanitizeFloat;
use Text\_ScalarToString;
use Text\_Sha;
use Text\_Shuffle;
use Text\_Singularize;
use Text\_SnakeCaseFromCamelCase;
use Text\_SnakeCaseFromSentence;
use Text\_StripSpace;
use Text\_ToString;
use Text\_TruncateSafe;
use Text\_UniqueId;
public const array MAP_CYRILLIC = [
'е', 'ё', 'ж', 'х', 'ц', 'ч', 'ш', 'щ', 'ю', 'я',
'Е', 'Ё', 'Ж', 'Х', 'Ц', 'Ч', 'Ш', 'Щ', 'Ю', 'Я',
'а', 'б', 'в', 'г', 'д', 'з', 'и', 'й', 'к', 'л',
'м', 'н', 'о', 'п', 'р', 'с', 'т', 'у', 'ф', 'ъ',
'ы', 'ь', 'э', 'А', 'Б', 'В', 'Г', 'Д', 'З', 'И',
'Й', 'К', 'Л', 'М', 'Н', 'О', 'П', 'Р', 'С', 'Т',
'У', 'Ф', 'Ъ', 'Ы', 'Ь', 'Э',
];
public const array MAP_LATIN = [
'ye', 'ye', 'zh', 'kh', 'ts', 'ch', 'sh', 'shch', 'yu', 'ya',
'Ye', 'Ye', 'Zh', 'Kh', 'Ts', 'Ch', 'Sh', 'Shch', 'Yu', 'Ya',
'a', 'b', 'v', 'g', 'd', 'z', 'i', 'y', 'k', 'l',
'm', 'n', 'o', 'p', 'r', 's', 't', 'u', 'f', 'ʺ',
'y', '–', 'e', 'A', 'B', 'V', 'G', 'D', 'Z', 'I',
'Y', 'K', 'L', 'M', 'N', 'O', 'P', 'R', 'S', 'T',
'U', 'F', 'ʺ', 'Y', '–', 'E',
];
public const string BASIC = self::EN_LOWERCASE . self::EN_UPPERCASE . self::DIGITS;
public const string DIGITS = '0123456789';
public const string EN_LOWERCASE = 'abcdefghijklmnopqrstuvwxyz';
public const string EN_UPPERCASE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
public const string EXTENDED = self::BASIC . self::SYMBOLS;
public const string LV_LOWERCASE = 'aābcčdeēfgģhiījkķlļmnņoprsštuūvzž';
public const string LV_UPPERCASE = 'AāBCČDEĒFGĢHIĪJKĶLĻMNŅOPRSŠTUŪVZŽ';
public const string SYMBOLS = '!@#$%^&*()_-=+;:.,?';
public const string UTF32LE = 'UTF-32LE';
public const string UTF8 = 'UTF-8';
}