You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Any logic inside this loops structures should be abstracted to their own methods or classes and a meaningful name must be chosen to explicitly represent what is being abstracted.
<?phpclass UserHandler
{
private$userRepo;
publicfunction__construct(UserRepositoryContract$userRepo)
{
$this->userRepo = $userRepo;
}
publicfunctiongetUsersFeedbackRate()
{
foreach ($this->userRepo->all() as$user) {
$this->calculateUserFeedbackRate($user);
}
}
privatefunctioncalculateUserFeedbackRate(UserValues$user)
{
// Use the User Values immutable object to get the data about the user and perform your logic
}
}
No description provided.
The text was updated successfully, but these errors were encountered: