Skip to content

Commit

Permalink
Added few new methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Yury Potapov committed May 16, 2023
1 parent 93126cc commit 2e3cb2b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ $result = $faker->{useAnyPublicMethods}()

- More mocks data
- Add ENG Language
- Override Language after construct
13 changes: 13 additions & 0 deletions src/Service/FakerManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,17 @@ public function getRandomCity(): string
$city = json_decode($city, true);
return $this->getRandomElement($city);
}

public function getRandomPhoneNumber(): string
{
$ruPrefix = '+7';
$number = rand(1000000000, 9999999999);
return $ruPrefix . $number;
}

public function getRandomDateTimeThisMonth(): \DateTime
{
$date = date('01-m-Y');
return date_modify(new \DateTime($date), ' + ' . rand(2, 27) . ' days');
}
}

0 comments on commit 2e3cb2b

Please sign in to comment.