PluginProbe ʕ •ᴥ•ʔ
GiveWP – Donation Plugin and Fundraising Platform / 2.10.0
GiveWP – Donation Plugin and Fundraising Platform v2.10.0
4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 2.31.0 2.31.1 2.32.0 2.33.0 2.33.1 2.33.2 2.33.3 2.33.4 2.33.5 2.4.0 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.4.7 2.5.0 2.5.1 2.5.10 2.5.11 2.5.12 2.5.13 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.7 2.5.8 2.5.9 2.6.0 2.6.1 2.6.2 2.6.3 2.7.0 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.8.0 2.8.1 2.9.0 2.9.1 2.9.2 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.1.0 3.1.1 3.1.2 3.10.0 3.11.0 3.12.0 3.12.1 3.12.2 3.12.3 3.13.0 3.14.0 3.14.1 3.14.2 3.15.0 3.15.1 3.16.0 3.16.1 3.16.2 3.16.3 3.16.4 3.16.5 3.17.0 3.17.1 3.17.2 3.18.0 3.19.0 3.19.1 3.19.2 3.19.3 3.19.4 3.2.0 3.2.1 3.2.2 3.20.0 3.21.0 3.21.1 3.22.0 3.22.1 3.22.2 3.3.0 3.3.1 3.4.0 3.4.1 3.4.2 3.5.0 3.5.1 3.6.0 3.6.1 3.6.2 3.7.0 3.8.0 3.9.0 4.0.0 4.1.0 4.1.1 4.10.0 4.10.1 4.11.0 4.12.0 4.13.0 4.13.1 4.13.2 4.14.0 4.14.1 4.14.2 4.14.3 4.14.4 4.14.5 4.14.6 4.2.0 4.2.1 4.3.0 4.3.1 4.3.2 4.4.0 4.5.0 4.6.1 4.7.0 4.7.1 4.8.0 4.8.1 4.9.0 trunk 1.9.0 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.10.0 2.10.1 2.10.2 2.10.3 2.10.4 2.11.0 2.11.1 2.11.2 2.11.3 2.12.0 2.12.1 2.12.2 2.12.3 2.13.0 2.13.1 2.13.2 2.13.3 2.13.4 2.14.0 2.15.0 2.16.0 2.16.1 2.17.0 2.17.1 2.17.3 2.18.0 2.18.1 2.19.1 2.19.2 2.19.3 2.19.4 2.19.5 2.19.6 2.19.7 2.19.8 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.20.0 2.20.1 2.20.2 2.21.0 2.21.1 2.21.2 2.21.3 2.21.4 2.22.0 2.22.1 2.22.2 2.22.3 2.23.0 2.23.1 2.23.2 2.24.0 2.24.1 2.24.2 2.25.0 2.25.1 2.25.2 2.25.3 2.26.0 2.27.0 2.27.1 2.27.2 2.27.3 2.28.0 2.29.0 2.29.1 2.29.2
give / vendor / fakerphp / faker / src / Faker / Generator.php
give / vendor / fakerphp / faker / src / Faker Last commit date
Calculator 5 years ago Guesser 5 years ago ORM 5 years ago Provider 5 years ago DefaultGenerator.php 5 years ago Documentor.php 5 years ago Factory.php 5 years ago Generator.php 5 years ago UniqueGenerator.php 5 years ago ValidGenerator.php 5 years ago
Generator.php
298 lines
1 <?php
2
3 namespace Faker;
4
5 /**
6 * @property string $name
7 * @method string name(string $gender = null)
8 * @property string $firstName
9 * @method string firstName(string $gender = null)
10 * @property string $firstNameMale
11 * @property string $firstNameFemale
12 * @property string $lastName
13 * @property string $title
14 * @method string title(string $gender = null)
15 * @property string $titleMale
16 * @property string $titleFemale
17 *
18 * @property string $citySuffix
19 * @property string $streetSuffix
20 * @property string $buildingNumber
21 * @property string $city
22 * @property string $streetName
23 * @property string $streetAddress
24 * @property string $secondaryAddress
25 * @property string $postcode
26 * @property string $address
27 * @property string $state
28 * @property string $country
29 * @property float $latitude
30 * @property float $longitude
31 *
32 * @property string $ean13
33 * @property string $ean8
34 * @property string $isbn13
35 * @property string $isbn10
36 *
37 * @property string $phoneNumber
38 * @property string $e164PhoneNumber
39 *
40 * @property string $company
41 * @property string $companySuffix
42 * @property string $jobTitle
43 *
44 * @property string $creditCardType
45 * @property string $creditCardNumber
46 * @method string creditCardNumber($type = null, $formatted = false, $separator = '-')
47 * @property \DateTime $creditCardExpirationDate
48 * @property string $creditCardExpirationDateString
49 * @property array $creditCardDetails
50 * @property string $bankAccountNumber
51 * @method string iban($countryCode = null, $prefix = '', $length = null)
52 * @property string $swiftBicNumber
53 * @property string $vat
54 *
55 * @property string $word
56 * @property string|array $words
57 * @method string|array words($nb = 3, $asText = false)
58 * @method string word()
59 * @property string $sentence
60 * @method string sentence($nbWords = 6, $variableNbWords = true)
61 * @property string|array $sentences
62 * @method string|array sentences($nb = 3, $asText = false)
63 * @property string $paragraph
64 * @method string paragraph($nbSentences = 3, $variableNbSentences = true)
65 * @property string|array $paragraphs
66 * @method string|array paragraphs($nb = 3, $asText = false)
67 * @property string $text
68 * @method string text($maxNbChars = 200)
69 *
70 * @method string realText($maxNbChars = 200, $indexSize = 2)
71 *
72 * @property string $email
73 * @property string $safeEmail
74 * @property string $freeEmail
75 * @property string $companyEmail
76 * @property string $freeEmailDomain
77 * @property string $safeEmailDomain
78 * @property string $userName
79 * @property string $password
80 * @method string password($minLength = 6, $maxLength = 20)
81 * @property string $domainName
82 * @property string $domainWord
83 * @property string $tld
84 * @property string $url
85 * @property string $slug
86 * @method string slug($nbWords = 6, $variableNbWords = true)
87 * @property string $ipv4
88 * @property string $ipv6
89 * @property string $localIpv4
90 * @property string $macAddress
91 *
92 * @property int $unixTime
93 * @property \DateTime $dateTime
94 * @property \DateTime $dateTimeAD
95 * @property string $iso8601
96 * @property \DateTime $dateTimeThisCentury
97 * @property \DateTime $dateTimeThisDecade
98 * @property \DateTime $dateTimeThisYear
99 * @property \DateTime $dateTimeThisMonth
100 * @property string $amPm
101 * @property string $dayOfMonth
102 * @property string $dayOfWeek
103 * @property string $month
104 * @property string $monthName
105 * @property string $year
106 * @property string $century
107 * @property string $timezone
108 * @method string amPm($max = 'now')
109 * @method string date($format = 'Y-m-d', $max = 'now')
110 * @method string dayOfMonth($max = 'now')
111 * @method string dayOfWeek($max = 'now')
112 * @method string iso8601($max = 'now')
113 * @method string month($max = 'now')
114 * @method string monthName($max = 'now')
115 * @method string time($format = 'H:i:s', $max = 'now')
116 * @method int unixTime($max = 'now')
117 * @method string year($max = 'now')
118 * @method \DateTime dateTime($max = 'now', $timezone = null)
119 * @method \DateTime dateTimeAd($max = 'now', $timezone = null)
120 * @method \DateTime dateTimeBetween($startDate = '-30 years', $endDate = 'now', $timezone = null)
121 * @method \DateTime dateTimeInInterval($date = '-30 years', $interval = '+5 days', $timezone = null)
122 * @method \DateTime dateTimeThisCentury($max = 'now', $timezone = null)
123 * @method \DateTime dateTimeThisDecade($max = 'now', $timezone = null)
124 * @method \DateTime dateTimeThisYear($max = 'now', $timezone = null)
125 * @method \DateTime dateTimeThisMonth($max = 'now', $timezone = null)
126 *
127 * @property string $md5
128 * @property string $sha1
129 * @property string $sha256
130 * @property string $locale
131 * @property string $countryCode
132 * @property string $countryISOAlpha3
133 * @property string $languageCode
134 * @property string $currencyCode
135 * @property boolean $boolean
136 * @method boolean boolean($chanceOfGettingTrue = 50)
137 *
138 * @property int $randomDigit
139 * @property int $randomDigitNot
140 * @property int $randomDigitNotNull
141 * @property string $randomLetter
142 * @property string $randomAscii
143 * @method int randomNumber($nbDigits = null, $strict = false)
144 * @method int|string|null randomKey(array $array = array())
145 * @method int numberBetween($min = 0, $max = 2147483647)
146 * @method float randomFloat($nbMaxDecimals = null, $min = 0, $max = null)
147 * @method mixed randomElement(array $array = array('a', 'b', 'c'))
148 * @method array randomElements(array $array = array('a', 'b', 'c'), $count = 1, $allowDuplicates = false)
149 * @method array|string shuffle($arg = '')
150 * @method array shuffleArray(array $array = array())
151 * @method string shuffleString($string = '', $encoding = 'UTF-8')
152 * @method string numerify($string = '###')
153 * @method string lexify($string = '????')
154 * @method string bothify($string = '## ??')
155 * @method string asciify($string = '****')
156 * @method string regexify($regex = '')
157 * @method string toLower($string = '')
158 * @method string toUpper($string = '')
159 * @method Generator optional($weight = 0.5, $default = null)
160 * @method Generator unique($reset = false, $maxRetries = 10000)
161 * @method Generator valid($validator = null, $maxRetries = 10000)
162 * @method mixed passthrough($passthrough)
163 *
164 * @method integer biasedNumberBetween($min = 0, $max = 100, $function = 'sqrt')
165 *
166 * @property string $macProcessor
167 * @property string $linuxProcessor
168 * @property string $userAgent
169 * @property string $chrome
170 * @property string $firefox
171 * @property string $safari
172 * @property string $opera
173 * @property string $internetExplorer
174 * @property string $windowsPlatformToken
175 * @property string $macPlatformToken
176 * @property string $linuxPlatformToken
177 *
178 * @property string $uuid
179 *
180 * @property string $mimeType
181 * @property string $fileExtension
182 * @method string file($sourceDirectory = '/tmp', $targetDirectory = '/tmp', $fullPath = true)
183 *
184 * @method string imageUrl($width = 640, $height = 480, $category = null, $randomize = true, $word = null, $gray = false)
185 * @method string image($dir = null, $width = 640, $height = 480, $category = null, $fullPath = true, $randomize = true, $word = null)
186 *
187 * @property string $hexColor
188 * @property string $safeHexColor
189 * @property string $rgbColor
190 * @property array $rgbColorAsArray
191 * @property string $rgbCssColor
192 * @property string $safeColorName
193 * @property string $colorName
194 *
195 * @method string randomHtml($maxDepth = 4, $maxWidth = 4)
196 *
197 */
198 class Generator
199 {
200 protected $providers = array();
201 protected $formatters = array();
202
203 public function addProvider($provider)
204 {
205 array_unshift($this->providers, $provider);
206 }
207
208 public function getProviders()
209 {
210 return $this->providers;
211 }
212
213 public function seed($seed = null)
214 {
215 if ($seed === null) {
216 mt_srand();
217 } else {
218 if (PHP_VERSION_ID < 70100) {
219 mt_srand((int) $seed);
220 } else {
221 mt_srand((int) $seed, MT_RAND_PHP);
222 }
223 }
224 }
225
226 public function format($formatter, $arguments = array())
227 {
228 return call_user_func_array($this->getFormatter($formatter), $arguments);
229 }
230
231 /**
232 * @param string $formatter
233 *
234 * @return Callable
235 */
236 public function getFormatter($formatter)
237 {
238 if (isset($this->formatters[$formatter])) {
239 return $this->formatters[$formatter];
240 }
241 foreach ($this->providers as $provider) {
242 if (method_exists($provider, $formatter)) {
243 $this->formatters[$formatter] = array($provider, $formatter);
244
245 return $this->formatters[$formatter];
246 }
247 }
248 throw new \InvalidArgumentException(sprintf('Unknown formatter "%s"', $formatter));
249 }
250
251 /**
252 * Replaces tokens ('{{ tokenName }}') with the result from the token method call
253 *
254 * @param string $string String that needs to bet parsed
255 * @return string
256 */
257 public function parse($string)
258 {
259 return preg_replace_callback('/\{\{\s?(\w+)\s?\}\}/u', array($this, 'callFormatWithMatches'), $string);
260 }
261
262 protected function callFormatWithMatches($matches)
263 {
264 return $this->format($matches[1]);
265 }
266
267 /**
268 * @param string $attribute
269 *
270 * @return mixed
271 */
272 public function __get($attribute)
273 {
274 return $this->format($attribute);
275 }
276
277 /**
278 * @param string $method
279 * @param array $attributes
280 *
281 * @return mixed
282 */
283 public function __call($method, $attributes)
284 {
285 return $this->format($method, $attributes);
286 }
287
288 public function __destruct()
289 {
290 $this->seed();
291 }
292
293 public function __wakeup()
294 {
295 $this->formatters = array();
296 }
297 }
298