Skip to content

Commit

Permalink
#469 enum p21
Browse files Browse the repository at this point in the history
  • Loading branch information
eventhorizonpl committed Jan 28, 2022
1 parent 9761504 commit 3b65f9b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/Service/RewardService.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ public function __construct(
) {
}

public function findReward(Routine $routine, string $type): ?Reward
public function findReward(Routine $routine, RewardTypeEnum $type): ?Reward
{
$user = $routine->getUser();
$types = [
RewardTypeEnum::ALL,
$type,
RewardTypeEnum::ALL->value,
$type->value,
];
$reward = $this->rewardRepository->findOneByUserAndTypesAndRoutine($user, $types, $routine);

Expand All @@ -33,7 +33,7 @@ public function findReward(Routine $routine, string $type): ?Reward
return $reward;
}

public function manageReward(Routine $routine, string $type): ?Reward
public function manageReward(Routine $routine, RewardTypeEnum $type): ?Reward
{
$reward = $this->findReward($routine, $type);

Expand Down
3 changes: 2 additions & 1 deletion src/Service/SavedEmailService.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace App\Service;

use App\Entity\{SavedEmail, User};
use App\Enum\SavedEmailTypeEnum;
use App\Factory\SavedEmailFactory;
use App\Manager\SavedEmailManager;

Expand All @@ -18,7 +19,7 @@ public function __construct(

public function create(
string $email,
string $type,
SavedEmailTypeEnum $type,
User $user
): SavedEmail {
$savedEmail = $this->savedEmailFactory->createSavedEmailWithRequired(
Expand Down

0 comments on commit 3b65f9b

Please sign in to comment.