change name of private method, user to users
This commit is contained in:
parent
2c2b1751a7
commit
9a8edec923
1 changed files with 2 additions and 2 deletions
|
|
@ -6,7 +6,7 @@ class FlatFileUserRepository implements UserRepository
|
||||||
{
|
{
|
||||||
private string $pathToUserFile = __DIR__.'/../../storage/users.json';
|
private string $pathToUserFile = __DIR__.'/../../storage/users.json';
|
||||||
|
|
||||||
private function getUserData(): array
|
private function getUsersData(): array
|
||||||
{
|
{
|
||||||
$json = file_get_contents($this->pathToUserFile);
|
$json = file_get_contents($this->pathToUserFile);
|
||||||
$data = json_decode($json, true);
|
$data = json_decode($json, true);
|
||||||
|
|
@ -16,7 +16,7 @@ class FlatFileUserRepository implements UserRepository
|
||||||
|
|
||||||
public function findByEmail(string $email): ?User
|
public function findByEmail(string $email): ?User
|
||||||
{
|
{
|
||||||
$data = $this->getUserData();
|
$data = $this->getUsersData();
|
||||||
foreach ($data as $user) {
|
foreach ($data as $user) {
|
||||||
if ($user['email'] === $email) {
|
if ($user['email'] === $email) {
|
||||||
return new User($user['email'], $user['password']);
|
return new User($user['email'], $user['password']);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue