├── .gitignore ├── docker-compose.yml ├── src ├── Exceptions │ └── BadFormatException.php ├── FakerEnUsServiceProvider.php └── Extensions │ ├── FinancialExtension.php │ ├── CompanyExtension.php │ ├── PersonExtension.php │ ├── ColorsExtension.php │ ├── TextExtension.php │ └── AddressExtension.php └── composer.json /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | vendor 3 | .phpunit.result.cache 4 | composer.lock -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | php: 3 | build: . 4 | image: php:latest 5 | volumes: 6 | - ./:/var/www/html 7 | working_dir: /var/www/html 8 | tty: true -------------------------------------------------------------------------------- /src/Exceptions/BadFormatException.php: -------------------------------------------------------------------------------- 1 | extensions([ 18 | AddressExtension::class, 19 | CompanyExtension::class, 20 | FinancialExtension::class, 21 | PersonExtension::class, 22 | ColorsExtension::class, 23 | TextExtension::class, 24 | ]); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Extensions/FinancialExtension.php: -------------------------------------------------------------------------------- 1 | randomizer->getBytesFromString(implode(range(0, 9)), 2); 30 | $suffix = $this->randomizer->getBytesFromString(implode(range(0, 9)), 7); 31 | 32 | return $prefix . '-' . $suffix; 33 | } 34 | 35 | public function company(): string 36 | { 37 | return $this->pickArrayRandomElement($this->companies); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/Extensions/PersonExtension.php: -------------------------------------------------------------------------------- 1 | Paragraphs => Sentences => Words. 16 | * 17 | * @var array|array[] 18 | */ 19 | protected array $paragraphs = [ 20 | [ 21 | ['Innovation', 'drives', 'progress', 'in', 'modern', 'industries', 'and', 'services.'], 22 | ['Collaboration', 'between', 'teams', 'leads', 'to', 'more', 'efficient', 'outcomes.'], 23 | ['Effective', 'communication', 'is', 'a', 'cornerstone', 'of', 'productive', 'work', 'environments.'], 24 | ['Flexibility', 'and', 'adaptability', 'are', 'crucial', 'in', 'dynamic', 'business', 'settings.'], 25 | ], 26 | [ 27 | ['Resource', 'management', 'is', 'essential', 'for', 'achieving', 'organizational', 'goals.'], 28 | ['Continuous', 'improvement', 'helps', 'companies', 'stay', 'competitive', 'and', 'relevant.'], 29 | ['Leveraging', 'technology', 'enables', 'teams', 'to', 'work', 'smarter', 'and', 'faster.'], 30 | ['Strategic', 'planning', 'guides', 'long-term', 'success', 'in', 'challenging', 'markets.'], 31 | ], 32 | [ 33 | ['Customer', 'satisfaction', 'remains', 'a', 'key', 'measure', 'of', 'business', 'success.'], 34 | ['Monitoring', 'progress', 'helps', 'identify', 'opportunities', 'for', 'growth', 'and', 'improvement.'], 35 | ['Daily', 'challenges', 'are', 'overcome', 'through', 'teamwork', 'and', 'innovative', 'solutions.'], 36 | ['Regular', 'evaluations', 'ensure', 'processes', 'align', 'with', 'business', 'objectives.'], 37 | ], 38 | [ 39 | ['Professional', 'development', 'empowers', 'employees', 'to', 'achieve', 'their', 'full', 'potential.'], 40 | ['Training', 'programs', 'support', 'both', 'individual', 'and', 'organizational', 'growth.'], 41 | ['Continuous', 'learning', 'encourages', 'innovation', 'and', 'adaptation', 'to', 'changing', 'needs.'], 42 | ['Personalized', 'approaches', 'to', 'development', 'foster', 'engagement', 'and', 'retention.'], 43 | ], 44 | [ 45 | ['Data', 'analysis', 'provides', 'insights', 'into', 'performance', 'and', 'market', 'trends.'], 46 | ['Goals', 'are', 'adjusted', 'to', 'align', 'with', 'shifting', 'customer', 'expectations.'], 47 | ['Regular', 'reviews', 'enable', 'swift', 'responses', 'to', 'emerging', 'challenges.'], 48 | ['Decisions', 'are', 'driven', 'by', 'accurate', 'data', 'and', 'clear', 'strategies.'], 49 | ['Ongoing', 'assessments', 'help', 'refine', 'approaches', 'and', 'achieve', 'sustainable', 'growth.'], 50 | ], 51 | ]; 52 | } 53 | -------------------------------------------------------------------------------- /src/Extensions/AddressExtension.php: -------------------------------------------------------------------------------- 1 | 'Alabama'], ['AK' => 'Alaska'], ['AZ' => 'Arizona'], ['AR' => 'Arkansas'], ['CA' => 'California'], 17 | ['CO' => 'Colorado'], ['CT' => 'Connecticut'], ['DE' => 'Delaware'], ['FL' => 'Florida'], ['GA' => 'Georgia'], 18 | ['HI' => 'Hawaii'], ['ID' => 'Idaho'], ['IL' => 'Illinois'], ['IN' => 'Indiana'], ['IA' => 'Iowa'], 19 | ['KS' => 'Kansas'], ['KY' => 'Kentucky'], ['LA' => 'Louisiana'], ['ME' => 'Maine'], ['MD' => 'Maryland'], 20 | ['MA' => 'Massachusetts'], ['MI' => 'Michigan'], ['MN' => 'Minnesota'], ['MS' => 'Mississippi'], ['MO' => 'Missouri'], 21 | ['MT' => 'Montana'], ['NE' => 'Nebraska'], ['NV' => 'Nevada'], ['NH' => 'New Hampshire'], ['NJ' => 'New Jersey'], 22 | ['NM' => 'New Mexico'], ['NY' => 'New York'], ['NC' => 'North Carolina'], ['ND' => 'North Dakota'], ['OH' => 'Ohio'], 23 | ['OK' => 'Oklahoma'], ['OR' => 'Oregon'], ['PA' => 'Pennsylvania'], ['RI' => 'Rhode Island'], ['SC' => 'South Carolina'], 24 | ['SD' => 'South Dakota'], ['TN' => 'Tennessee'], ['TX' => 'Texas'], ['UT' => 'Utah'], ['VT' => 'Vermont'], 25 | ['VA' => 'Virginia'], ['WA' => 'Washington'], ['WV' => 'West Virginia'], ['WI' => 'Wisconsin'], ['WY' => 'Wyoming'], 26 | ]; 27 | 28 | protected $regions = [ 29 | 'Northeast', 'Midwest', 'South', 'West', 30 | ]; 31 | 32 | protected $streetSuffixes = [ 33 | 'Street', 'Avenue', 'Boulevard', 'Drive', 'Lane', 'Road', 'Court', 'Way', 'Place', 'Terrace', 'Circle', 34 | 'Trail', 'Parkway', 'Square', 'Loop', 'Commons', 'Path', 'Alley', 'Row', 'Crescent', 'Close', 35 | 'Garden', 'Walk', 'Mews', 'Quay', 'Point', 'Pike', 'Terrace', 'Highway', 'Driveway', 'Creek', 36 | 'Dock', 'Court', 'Causeway', 'Villas', 'Gateway', 'Ramp' 37 | ]; 38 | 39 | protected $streetNames = [ 40 | 'Main', 'Oak', 'Pine', 'Maple', 'Elm', 'Cedar', 'Birch', 'Spruce', 'Ash', 'Willow', 41 | 'Highland', 'Hill', 'River', 'Lake', 'Sunset', 'Lakeshore', 'Canyon', 'Westwood', 'Park', 'Meadow', 42 | 'Mountain', 'Forest', 'Valley', 'Brook', 'Woodland', 'Chestnut', 'Rose', 'King', 'Queen', 'Lincoln', 43 | 'Washington', 'Jefferson', 'Franklin', 'Adams', 'Clayton', 'Wellington', 'Harrison', 'Madison', 'Jefferson', 'Riverside', 44 | 'Sunrise', 'Golden', 'Silver', 'Sunnyside', 'Diamond' 45 | ]; 46 | 47 | protected $cities = [ 48 | 'New York', 'Los Angeles', 'Chicago', 'Houston', 'Phoenix', 'Philadelphia', 'San Antonio', 'San Diego', 'Dallas', 'San Jose', 49 | 'Austin', 'Jacksonville', 'Fort Worth', 'Columbus', 'Charlotte', 'San Francisco', 'Indianapolis', 'Seattle', 'Denver', 'Washington', 50 | 'Boston', 'El Paso', 'Nashville', 'Detroit', 'Oklahoma City', 'Portland', 'Las Vegas', 'Memphis', 'Louisville', 'Baltimore', 51 | 'Milwaukee', 'Albuquerque', 'Tucson', 'Fresno', 'Sacramento', 'Kansas City', 'Long Beach', 'Mesa', 'Atlanta', 'Colorado Springs', 52 | 'Virginia Beach', 'Raleigh', 'Omaha', 'Miami' 53 | ]; 54 | 55 | public function region(): string 56 | { 57 | return $this->pickArrayRandomElement($this->regions); 58 | } 59 | 60 | public function state(): array 61 | { 62 | return $this->pickArrayRandomElement($this->states); 63 | } 64 | 65 | public function houseNumber(): int 66 | { 67 | return $this->randomizer->getInt(1, 200); 68 | } 69 | 70 | public function streetName(): string 71 | { 72 | $streetName = $this->pickArrayRandomElement($this->streetNames); 73 | $streetSuffix = $this->pickArrayRandomElement($this->streetSuffixes); 74 | return sprintf('%s %s', $streetName, $streetSuffix); 75 | } 76 | 77 | public function streetAddress(): string 78 | { 79 | return sprintf('%d %s', $this->houseNumber(), $this->streetName()); 80 | } 81 | 82 | public function zipCode(string $format = '5-digits'): string 83 | { 84 | return match ($format) { 85 | '5-digits' => sprintf('%05d', $this->randomizer->getInt(1, 99999)), 86 | '9-digits' => sprintf('%05d-%04d', $this->randomizer->getInt(1, 99999), $this->randomizer->getInt(1, 9999)), 87 | default => throw new BadFormatException('Available formats are "5-digits" and "9-digits".'), 88 | }; 89 | } 90 | 91 | public function city(): string 92 | { 93 | return $this->pickArrayRandomElement($this->cities); 94 | } 95 | 96 | public function fullAddress(): string 97 | { 98 | $street = $this->streetAddress(); 99 | $city = $this->city(); 100 | $state = $this->state(); 101 | $zipCode = $this->zipCode(); 102 | 103 | return sprintf('%s, %s, %s %s', $street, $city, reset($state), $zipCode); 104 | } 105 | } 106 | --------------------------------------------------------------------------------