mirror of
https://github.com/fzaninotto/Faker.git
synced 2025-03-23 00:39:47 +01:00
Replace ? with {{}} static function call
This commit is contained in:
parent
d4b4630ac1
commit
e89bb5b5ff
@ -31,7 +31,7 @@ class Address extends \Faker\Provider\en_US\Address
|
||||
|
||||
protected static $streetAddressFormats = array(
|
||||
'{{buildingNumber}} {{streetName}}',
|
||||
'{{buildingNumber}}? {{streetName}}',
|
||||
'{{buildingNumber}}{{buildingLetter}} {{streetName}}',
|
||||
'{{secondaryAddress}} {{buildingNumber}} {{streetName}}',
|
||||
);
|
||||
|
||||
@ -46,16 +46,11 @@ class Address extends \Faker\Provider\en_US\Address
|
||||
'# /',
|
||||
);
|
||||
|
||||
public function streetAddress()
|
||||
{
|
||||
return preg_replace_callback('/\?/u', 'static::randomBuildingLetter', parent::streetAddress());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a sane building letter
|
||||
* @example B
|
||||
*/
|
||||
public static function randomBuildingLetter()
|
||||
public static function buildingLetter()
|
||||
{
|
||||
return static::toUpper(static::randomElement(static::$buildingLetters));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user