You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+49-35Lines changed: 49 additions & 35 deletions
Original file line number
Diff line number
Diff line change
@@ -25,11 +25,12 @@ AdvStr::redactSsn('My social security number is 222-22-2222'); // My social secu
25
25
-[Usage](#usage)
26
26
-[Available Methods](#available-methods)
27
27
-[advPassword](#advpassword)
28
-
-[readTime](#readtime)
29
28
-[charWrap](#charwrap)
30
-
-[splitName](#splitname)
31
-
-[redactSsn](#redactssn)
29
+
-[emailDomain](#emaildomain)
30
+
-[readTime](#readtime)
32
31
-[redactCreditCard](#redactcreditcard)
32
+
-[redactSsn](#redactssn)
33
+
-[splitName](#splitname)
33
34
-[Testing](#testing)
34
35
-[Changelog](#changelog)
35
36
-[Contributing](#contributing)
@@ -104,58 +105,77 @@ public static function advPassword(
104
105
#### Returns:
105
106
- string: Generated password
106
107
107
-
### [readTime](#readtime)
108
+
### [charWrap](#charwrap)
108
109
109
-
Calculates the read time of a string.
110
+
Wraps a string at a given number of characters regardless of words.
110
111
111
112
```php
112
-
public static function readTime(
113
+
public static function charWrap(
113
114
$string,
114
-
$wpm = 200
115
+
$length = 80
115
116
)
116
117
```
117
118
118
119
#### Parameters:
119
-
-`$string` (string): The text to calculate read time for
120
-
-`$wpm` (int): Words per minute (default: 200)
120
+
-`$string` (string): The string to wrap
121
+
-`$length` (int): The number of characters to wrap at (default: 80)
121
122
122
123
#### Returns:
123
-
-int: Estimated read time in seconds
124
+
-string: The wrapped string
124
125
125
-
### [charWrap](#charwrap)
126
+
### [emailDomain](#emailDomain)
126
127
127
128
Wraps a string at a given number of characters regardless of words.
128
129
129
130
```php
130
-
public static function charWrap(
131
-
$string,
132
-
$length = 80
131
+
public static function EmailDomain(
132
+
$string
133
133
)
134
134
```
135
135
136
136
#### Parameters:
137
-
-`$string` (string): The string to wrap
138
-
-`$length` (int): The number of characters to wrap at (default: 80)
137
+
-`$string` (string): The string to extract the email domain from.
139
138
140
139
#### Returns:
141
-
- string: The wrapped string
140
+
- string: The email domain from the string
142
141
143
-
### [splitName](#splitname)
142
+
### [readTime](#readtime)
144
143
145
-
Splits a full name into first name, middle name (if present), and last name, removing any prefixes and suffixes. This method can handle both "Firstname Lastname" and "Lastname, Firstname" formats.
144
+
Calculates the read time of a string.
146
145
147
146
```php
148
-
public static function splitName(
149
-
$name
147
+
public static function readTime(
148
+
$string,
149
+
$wpm = 200
150
150
)
151
151
```
152
152
153
153
#### Parameters:
154
-
-`$name` (string): The full name to split
154
+
-`$string` (string): The text to calculate read time for
155
+
-`$wpm` (int): Words per minute (default: 200)
155
156
156
157
#### Returns:
157
-
- array: An associative array containing 'first', 'middle' (if present), and 'last' name
158
+
- int: Estimated read time in seconds
159
+
160
+
### [redactCreditCard](#redactcreditcard)
161
+
Note: This method is currently not implemented (TODO).
162
+
Redacts credit card numbers in a string.
163
+
164
+
```php
165
+
public static function redactCreditCard(
166
+
$string,
167
+
$redacted = '********',
168
+
$exclude = []
169
+
)
170
+
```
171
+
172
+
#### Parameters:
173
+
-`$string` (string): The string containing credit card numbers to redact
174
+
-`$redacted` (string): The string to replace credit card numbers with (default: '********')
175
+
-`$exclude` (array): An array of credit card types to exclude from redaction
158
176
177
+
#### Returns:
178
+
- string: The string with credit card numbers redacted
159
179
### [redactSsn](#redactssn)
160
180
161
181
Redacts Social Security Numbers (SSN) in a string.
@@ -178,27 +198,21 @@ public static function redactSsn(
178
198
#### Returns:
179
199
- string: The string with SSNs redacted
180
200
181
-
### [redactCreditCard](#redactcreditcard)
201
+
### [splitName](#splitname)
182
202
183
-
Redacts credit card numbers in a string.
203
+
Splits a full name into first name, middle name (if present), and last name, removing any prefixes and suffixes. This method can handle both "Firstname Lastname" and "Lastname, Firstname" formats.
184
204
185
205
```php
186
-
public static function redactCreditCard(
187
-
$string,
188
-
$redacted = '********',
189
-
$exclude = []
206
+
public static function splitName(
207
+
$name
190
208
)
191
209
```
192
210
193
211
#### Parameters:
194
-
-`$string` (string): The string containing credit card numbers to redact
195
-
-`$redacted` (string): The string to replace credit card numbers with (default: '********')
196
-
-`$exclude` (array): An array of credit card types to exclude from redaction
212
+
-`$name` (string): The full name to split
197
213
198
214
#### Returns:
199
-
- string: The string with credit card numbers redacted
200
-
201
-
Note: This method is currently not implemented (TODO).
215
+
- array: An associative array containing 'first', 'middle' (if present), and 'last' name
0 commit comments