-
-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Faker methods autocompletion #426
Comments
I've added the annotations to my fork too. Works in PhpStorm and Eclipse. https://github.com/carspending/factory-muffin-faker/blob/annotations/src/Facade.php |
I went ahead and published the PR from @biserantonov: thephpleague/factory-muffin-faker#19 |
For those landing here, to work around this issue when using phpstorm you can place this somewhere in your project path, current or above the directory where you want this:
<?php
namespace League\FactoryMuffin\Faker;
/**
* @method static \Closure name() : string
* @method static \Closure firstName() : string
* @method static \Closure firstNameMale() : string
* @method static \Closure firstNameFemale() : string
* @method static \Closure lastName() : string
* @method static \Closure title() : string
* @method static \Closure titleMale() : string
* @method static \Closure titleFemale() : string
* @method static \Closure citySuffix() : string
* @method static \Closure streetSuffix() : string
* @method static \Closure buildingNumber() : string
* @method static \Closure city() : string
* @method static \Closure streetName() : string
* @method static \Closure streetAddress() : string
* @method static \Closure postcode() : string
* @method static \Closure address() : string
* @method static \Closure country() : string
* @method static \Closure latitude() : float
* @method static \Closure longitude() : float
* @method static \Closure ean13() : string
* @method static \Closure ean8() : string
* @method static \Closure isbn13() : string
* @method static \Closure isbn10() : string
* @method static \Closure phoneNumber() : string
* @method static \Closure company() : string
* @method static \Closure companySuffix() : string
* @method static \Closure jobTitle() : string
* @method static \Closure creditCardType() : string
* @method static \Closure creditCardNumber($type = null, $formatted = false, $separator = '-') : string
* @method static \Closure creditCardExpirationDate() : \DateTime
* @method static \Closure creditCardExpirationDateString() : string
* @method static \Closure creditCardDetails() : string
* @method static \Closure bankAccountNumber() : string
* @method static \Closure iban($countryCode = null, $prefix = '', $length = null) : string
* @method static \Closure swiftBicNumber() : string
* @method static \Closure vat() : string
* @method static \Closure word() : string
* @method static \Closure words($nb = 3, $asText = false) : string|array
* @method static \Closure sentence($nbWords = 6, $variableNbWords = true) : string
* @method static \Closure sentences($nb = 3, $asText = false) : string|array
* @method static \Closure paragraph($nbSentences = 3, $variableNbSentences = true) : string
* @method static \Closure paragraphs($nb = 3, $asText = false) : string|array
* @method static \Closure text($maxNbChars = 200) : string
* @method static \Closure realText($maxNbChars = 200, $indexSize = 2) : string
* @method static \Closure email() : string
* @method static \Closure safeEmail() : string
* @method static \Closure freeEmail() : string
* @method static \Closure companyEmail() : string
* @method static \Closure freeEmailDomain() : string
* @method static \Closure safeEmailDomain() : string
* @method static \Closure userName() : string
* @method static \Closure password($minLength = 6, $maxLength = 20) : string
* @method static \Closure domainName() : string
* @method static \Closure domainWord() : string
* @method static \Closure tld() : string
* @method static \Closure url() : string
* @method static \Closure slug($nbWords = 6, $variableNbWords = true) : string
* @method static \Closure ipv4() : string
* @method static \Closure ipv6() : string
* @method static \Closure localIpv4() : string
* @method static \Closure macAddress() : string
* @method static \Closure unixTime() : int
* @method static \Closure dateTime() : \DateTime
* @method static \Closure dateTimeAD() : \DateTime
* @method static \Closure iso8601() : string
* @method static \Closure dateTimeThisCentury() : \DateTime
* @method static \Closure dateTimeThisDecade() : \DateTime
* @method static \Closure dateTimeThisYear() : \DateTime
* @method static \Closure dateTimeThisMonth() : \DateTime
* @method static \Closure amPm() : string
* @method static \Closure dayOfMonth() : int
* @method static \Closure dayOfWeek() : int
* @method static \Closure month() : int
* @method static \Closure monthName() : string
* @method static \Closure year() : int
* @method static \Closure century() : int
* @method static \Closure timezone() : string
* @method static \Closure date($format = 'Y-m-d', $max = 'now') : string
* @method static \Closure time($format = 'H:i:s', $max = 'now') : string
* @method static \Closure dateTimeBetween($startDate = '-30 years', $endDate = 'now') : \DateTime
* @method static \Closure dateTimeInInterval($date = '-30 years', $interval = '+5 days', $timezone = null) : \DateTime
* @method static \Closure md5() : string
* @method static \Closure sha1() : string
* @method static \Closure sha256() : string
* @method static \Closure locale() : string
* @method static \Closure countryCode() : string
* @method static \Closure countryISOAlpha3() : string
* @method static \Closure languageCode() : string
* @method static \Closure currencyCode() : string
* @method static \Closure boolean($chanceOfGettingTrue = 50) : bool
* @method static \Closure randomDigit() : int
* @method static \Closure randomDigitNotNull() : int
* @method static \Closure randomLetter() : string
* @method static \Closure randomAscii() : string
* @method static \Closure randomNumber($nbDigits = null, $strict = false) : int
* @method static \Closure randomKey(array $array = array()) : int|string|null
* @method static \Closure numberBetween($min = 0, $max = 2147483647) : int
* @method static \Closure randomFloat($nbMaxDecimals = null, $min = 0, $max = null) : float
* @method static \Closure randomElement(array $array = array('a', 'b', 'c')) : mixed
* @method static \Closure randomElements(array $array = array('a', 'b', 'c'), $count = 1) : array
* @method static \Closure shuffle($arg = '') : array|string
* @method static \Closure shuffleArray(array $array = array()) : array
* @method static \Closure shuffleString($string = '', $encoding = 'UTF-8') : string
* @method static \Closure numerify($string = '###') : string
* @method static \Closure lexify($string = '????') : string
* @method static \Closure bothify($string = '## ??') : string
* @method static \Closure asciify($string = '****') : string
* @method static \Closure regexify($regex = '') : string
* @method static \Closure toLower($string = '') : string
* @method static \Closure toUpper($string = '') : string
* @method static \Closure biasedNumberBetween($min = 0, $max = 100, $function = 'sqrt') : int
* @method static \Closure macProcessor() : string
* @method static \Closure linuxProcessor() : string
* @method static \Closure userAgent() : string
* @method static \Closure chrome() : string
* @method static \Closure firefox() : string
* @method static \Closure safari() : string
* @method static \Closure opera() : string
* @method static \Closure internetExplorer() : string
* @method static \Closure windowsPlatformToken() : string
* @method static \Closure macPlatformToken() : string
* @method static \Closure linuxPlatformToken() : string
* @method static \Closure uuid() : string
* @method static \Closure mimeType() : string
* @method static \Closure fileExtension() : string
* @method static \Closure file($sourceDirectory = '/tmp', $targetDirectory = '/tmp', $fullPath = true) : string
* @method static \Closure imageUrl($width = 640, $height = 480, $category = null, $randomize = true, $word = null, $gray = false) : string
* @method static \Closure image($dir = null, $width = 640, $height = 480, $category = null, $fullPath = true, $randomize = true, $word = null) : string
* @method static \Closure hexColor() : string
* @method static \Closure safeHexColor() : string
* @method static \Closure rgbColor() : string
* @method static \Closure rgbColorAsArray() : array
* @method static \Closure rgbCssColor() : string
* @method static \Closure safeColorName() : string
* @method static \Closure colorName() : string
* @method static \Faker\Generator optional($weight = 0.5, $default = null)
* @method static \Faker\Generator unique($reset = false, $maxRetries = 10000)
*/
class Facade{
} I do not claim completeness or that this is the best way to solve this, but I needed a quick-fix. |
Hi,
I've experimented with including @method hints in the FactoryMuffin Facade class for all Faker methods, e.g.
It enables auto-complete in the model definition files when you type
Faker::
.Let me know if this is something you would be interested in and I could submit a pull request.
The text was updated successfully, but these errors were encountered: