Skip to content

Commit

Permalink
LEVEL 6の修正。
Browse files Browse the repository at this point in the history
  • Loading branch information
sai-gillingham committed Nov 2, 2023
1 parent 7436c1d commit c990d47
Show file tree
Hide file tree
Showing 8 changed files with 204 additions and 75 deletions.
2 changes: 1 addition & 1 deletion src/Eccube/Entity/OrderItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ public function setQuantity($quantity)
/**
* Get quantity.
*
* @return string
* @return string|float|int
*/
public function getQuantity()
{
Expand Down
56 changes: 40 additions & 16 deletions src/Eccube/Service/MailService.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
use Eccube\Repository\MailHistoryRepository;
use Eccube\Repository\MailTemplateRepository;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\Mailer\Exception\TransportExceptionInterface;
use Symfony\Component\Mailer\MailerInterface;
Expand Down Expand Up @@ -56,7 +55,7 @@ class MailService
protected $mailHistoryRepository;

/**
* @var EventDispatcher
* @var EventDispatcherInterface
*/
protected $eventDispatcher;

Expand Down Expand Up @@ -113,8 +112,14 @@ public function __construct(
/**
* Send customer confirm mail.
*
* @param $Customer 会員情報
* @param Customer $Customer 会員情報
* @param string $activateUrl アクティベート用url
*
* @return void
*
* @throws LoaderError
* @throws RuntimeError
* @throws SyntaxError
*/
public function sendCustomerConfirmMail(Customer $Customer, $activateUrl)
{
Expand Down Expand Up @@ -174,7 +179,11 @@ public function sendCustomerConfirmMail(Customer $Customer, $activateUrl)
/**
* Send customer complete mail.
*
* @param $Customer 会員情報
* @param Customer $Customer 会員情報
* @return void
* @throws LoaderError
* @throws RuntimeError
* @throws SyntaxError
*/
public function sendCustomerCompleteMail(Customer $Customer)
{
Expand Down Expand Up @@ -233,6 +242,10 @@ public function sendCustomerCompleteMail(Customer $Customer)
*
* @param $Customer Customer
* @param $email string
* @return void
* @throws LoaderError
* @throws RuntimeError
* @throws SyntaxError
*/
public function sendCustomerWithdrawMail(Customer $Customer, string $email)
{
Expand Down Expand Up @@ -290,7 +303,11 @@ public function sendCustomerWithdrawMail(Customer $Customer, string $email)
/**
* Send contact mail.
*
* @param $formData お問い合わせ内容
* @param array<string, string> $formData お問い合わせ内容
* @return void
* @throws LoaderError
* @throws RuntimeError
* @throws SyntaxError
*/
public function sendContactMail($formData)
{
Expand Down Expand Up @@ -423,8 +440,12 @@ public function sendOrderMail(Order $Order)
/**
* Send admin customer confirm mail.
*
* @param $Customer 会員情報
* @param Customer $Customer 会員情報
* @param string $activateUrl アクティベート用url
* @return void
* @throws LoaderError
* @throws RuntimeError
* @throws SyntaxError
*/
public function sendAdminCustomerConfirmMail(Customer $Customer, $activateUrl)
{
Expand Down Expand Up @@ -487,13 +508,10 @@ public function sendAdminCustomerConfirmMail(Customer $Customer, $activateUrl)
* Send admin order mail.
*
* @param Order $Order 受注情報
* @param $formData 入力内容
* @param array<string, string> $formData 入力内容
*
* @return Email
*
* @throws \Twig_Error_Loader
* @throws \Twig_Error_Runtime
* @throws \Twig_Error_Syntax
*/
public function sendAdminOrderMail(Order $Order, $formData)
{
Expand Down Expand Up @@ -532,8 +550,12 @@ public function sendAdminOrderMail(Order $Order, $formData)
/**
* Send password reset notification mail.
*
* @param $Customer 会員情報
* @param Customer $Customer 会員情報
* @param string $reset_url
* @return void
* @throws LoaderError
* @throws RuntimeError
* @throws SyntaxError
*/
public function sendPasswordResetNotificationMail(Customer $Customer, $reset_url)
{
Expand Down Expand Up @@ -594,8 +616,12 @@ public function sendPasswordResetNotificationMail(Customer $Customer, $reset_url
/**
* Send password reset notification mail.
*
* @param $Customer 会員情報
* @param Customer $Customer 会員情報
* @param string $password
* @return void
* @throws LoaderError
* @throws RuntimeError
* @throws SyntaxError
*/
public function sendPasswordResetCompleteMail(Customer $Customer, $password)
{
Expand Down Expand Up @@ -657,6 +683,7 @@ public function sendPasswordResetCompleteMail(Customer $Customer, $password)
* 発送通知メールは受注ごとに送られる
*
* @param Shipping $Shipping
* @return void
*
* @throws \Twig_Error
*/
Expand Down Expand Up @@ -753,10 +780,7 @@ public function getShippingNotifyMailBody(Shipping $Shipping, Order $Order, $tem
* 会員情報変更時にメール通知
*
* @param Customer $Customer
* @param array $userData
* - userAgent
* - ipAddress
* - preEmail
* @param array{userAgent: string, ipAddress: string, preEmail: string|null} $userData
* @param string $eventName
*
* @return void
Expand Down
32 changes: 27 additions & 5 deletions src/Eccube/Service/OrderHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
use Eccube\Entity\Master\DeviceType;
use Eccube\Entity\Master\OrderItemType;
use Eccube\Entity\Master\OrderStatus;
use Eccube\Entity\Master\TaxDisplayType;
use Eccube\Entity\Order;
use Eccube\Entity\OrderItem;
use Eccube\Entity\Shipping;
use Eccube\Entity\Master\TaxDisplayType;
use Eccube\EventListener\SecurityListener;
use Eccube\Repository\DeliveryRepository;
use Eccube\Repository\Master\DeviceTypeRepository;
Expand Down Expand Up @@ -110,7 +110,7 @@ class OrderHelper
protected $deviceTypeRepository;

/**
* @var MobileDetector
* @var MobileDetect
*/
protected $mobileDetector;

Expand Down Expand Up @@ -315,6 +315,9 @@ public function initializeOrder(Cart $Cart, Customer $Customer)
return $Order;
}

/**
* @return void
*/
public function removeSession()
{
$this->session->remove(self::SESSION_ORDER_ID);
Expand All @@ -327,6 +330,7 @@ public function removeSession()
*
* @param Order $Order
* @param Customer $Customer
* @return void
*/
public function updateCustomerInfo(Order $Order, Customer $Customer)
{
Expand All @@ -335,6 +339,9 @@ public function updateCustomerInfo(Order $Order, Customer $Customer)
}
}

/**
* @return string
*/
public function createPreOrderId()
{
// ランダムなpre_order_idを作成
Expand All @@ -351,6 +358,12 @@ public function createPreOrderId()
return $preOrderId;
}

/**
* @param Order $Order
* @param Customer $Customer
*
* @return void
*/
protected function setCustomer(Order $Order, Customer $Customer)
{
if ($Customer->getId()) {
Expand All @@ -369,7 +382,7 @@ protected function setCustomer(Order $Order, Customer $Customer)
}

/**
* @param Collection|ArrayCollection|CartItem[] $CartItems
* @param Collection<int, CartItem>|ArrayCollection<int, CartItem>|CartItem[]|array<int, CartItem> $CartItems
*
* @return OrderItem[]
*/
Expand Down Expand Up @@ -434,6 +447,8 @@ protected function createShippingFromCustomer(Customer $Customer)

/**
* @param Shipping $Shipping
*
* @return void
*/
protected function setDefaultDelivery(Shipping $Shipping)
{
Expand All @@ -458,6 +473,8 @@ protected function setDefaultDelivery(Shipping $Shipping)

/**
* @param Order $Order
*
* @return void
*/
protected function setDefaultPayment(Order $Order)
{
Expand Down Expand Up @@ -494,7 +511,8 @@ protected function setDefaultPayment(Order $Order)
/**
* @param Order $Order
* @param Shipping $Shipping
* @param array $OrderItems
* @param array<int, OrderItem> $OrderItems
* @return void
*/
protected function addOrderItems(Order $Order, Shipping $Shipping, array $OrderItems)
{
Expand All @@ -507,6 +525,9 @@ protected function addOrderItems(Order $Order, Shipping $Shipping, array $OrderI
}

/**
* @param mixed $attribute
* @param null $subject
* @return bool
* @see Symfony\Bundle\FrameworkBundle\Controller\AbstractController
*/
private function isGranted($attribute, $subject = null): bool
Expand All @@ -516,6 +537,7 @@ private function isGranted($attribute, $subject = null): bool

/**
* @see Symfony\Bundle\FrameworkBundle\Controller\AbstractController
* @return UserInterface|null
*/
private function getUser(): ?UserInterface
{
Expand All @@ -539,7 +561,7 @@ private function getUser(): ?UserInterface
* - 手数料: 税込
* - ポイント値引き: 税込
*
* @param $OrderItemType
* @param OrderItemType $OrderItemType
*
* @return TaxDisplayType
*/
Expand Down
Loading

0 comments on commit c990d47

Please sign in to comment.