Skip to content

Commit

Permalink
Fixed Code Style Issues
Browse files Browse the repository at this point in the history
  • Loading branch information
sashas777 committed Oct 8, 2019
1 parent 3cf8f22 commit 7597003
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 55 deletions.
41 changes: 0 additions & 41 deletions app/code/Magento/Customer/Api/RedirectCookieManagerInterface.php

This file was deleted.

13 changes: 8 additions & 5 deletions app/code/Magento/Customer/Model/Account/Redirect.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,17 @@
use Magento\Framework\Url\DecoderInterface;
use Magento\Framework\App\ObjectManager;
use Magento\Framework\Stdlib\CookieManagerInterface;
use Magento\Customer\Api\RedirectCookieManagerInterface;
use Magento\Customer\Model\RedirectCookieManager;

/**
* Account Redirect
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
*
*/
class Redirect
{
/** @deprecated
* @see \Magento\Customer\Model\RedirectCookieManager
* URL to redirect user on successful login or registration
*/
const LOGIN_REDIRECT_URL = 'login_redirect';
Expand Down Expand Up @@ -76,7 +77,7 @@ class Redirect
protected $cookieManager;

/**
* @var RedirectCookieManagerInterface
* @var RedirectCookieManager
*/
protected $redirectCookieManager;

Expand All @@ -100,7 +101,7 @@ class Redirect
* @param DecoderInterface $urlDecoder
* @param CustomerUrl $customerUrl
* @param ResultFactory $resultFactory
* @param RedirectCookieManagerInterface $redirectCookieManager
* @param RedirectCookieManager $redirectCookieManager
* @param HostChecker|null $hostChecker
*/
public function __construct(
Expand All @@ -112,7 +113,7 @@ public function __construct(
DecoderInterface $urlDecoder,
CustomerUrl $customerUrl,
ResultFactory $resultFactory,
RedirectCookieManagerInterface $redirectCookieManager,
RedirectCookieManager $redirectCookieManager,
HostChecker $hostChecker = null
) {
$this->request = $request;
Expand Down Expand Up @@ -254,6 +255,7 @@ private function applyRedirect($url)
* Get Cookie manager. For release backward compatibility.
*
* @deprecated 100.0.10
* @see \Magento\Customer\Model\RedirectCookieManager
* @return CookieManagerInterface
*/
protected function getCookieManager()
Expand All @@ -268,6 +270,7 @@ protected function getCookieManager()
* Set cookie manager. For unit tests.
*
* @deprecated 100.0.10
* @see \Magento\Customer\Model\RedirectCookieManager
* @param object $value
* @return void
*/
Expand Down
18 changes: 12 additions & 6 deletions app/code/Magento/Customer/Model/RedirectCookieManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
*/
class RedirectCookieManager implements RedirectCookieManagerInterface
{
/**
* Cookie name
*/
const COOKIE_NAME = 'login_redirect';

/**
Expand All @@ -46,15 +43,21 @@ public function __construct(
}

/**
* {@inheritdoc}
* Get redirect route from cookie for case of successful login/registration
*
* @return null|string
*/
public function getRedirectCookie()
{
return $this->cookieManager->getCookie(self::COOKIE_NAME, null);
}

/**
* {@inheritdoc}
* Save redirect route to cookie for case of successful login/registration
*
* @param string $route
* @param StoreInterface $store
* @return void
*/
public function setRedirectCookie($route, StoreInterface $store)
{
Expand All @@ -66,7 +69,10 @@ public function setRedirectCookie($route, StoreInterface $store)
}

/**
* {@inheritdoc}
* Clear cookie with requested route
*
* @param StoreInterface $store
* @return void
*/
public function clearRedirectCookie(StoreInterface $store)
{
Expand Down
3 changes: 0 additions & 3 deletions app/code/Magento/Customer/etc/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,4 @@
<preference
for="Magento\Customer\Api\AccountDelegationInterface"
type="Magento\Customer\Model\Delegation\AccountDelegation" />
<preference
for="Magento\Customer\Api\RedirectCookieManagerInterface"
type="Magento\Customer\Model\RedirectCookieManager" />
</config>

0 comments on commit 7597003

Please sign in to comment.