Skip to content

Commit

Permalink
Revert "Fix the minor code styling issue"
Browse files Browse the repository at this point in the history
This reverts commit ebd39d3.
  • Loading branch information
dmytro-ch committed Sep 29, 2018
1 parent ebd39d3 commit 91275d6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions app/code/Magento/Customer/Model/AccountManagement.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ class AccountManagement implements AccountManagementInterface
/**
* @var CollectionFactory
*/
private $visitorColFactory;
private $visitorCollectionFactory;

/**
* @var DataObjectProcessor
Expand Down Expand Up @@ -360,7 +360,7 @@ class AccountManagement implements AccountManagementInterface
* @param AccountConfirmation|null $accountConfirmation
* @param SessionManagerInterface|null $sessionManager
* @param SaveHandlerInterface|null $saveHandler
* @param CollectionFactory|null $visitorColFactory
* @param CollectionFactory|null $visitorCollectionFactory
* @param AddressRegistry|null $addressRegistry
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
Expand Down Expand Up @@ -393,7 +393,7 @@ public function __construct(
AccountConfirmation $accountConfirmation = null,
SessionManagerInterface $sessionManager = null,
SaveHandlerInterface $saveHandler = null,
CollectionFactory $visitorColFactory = null,
CollectionFactory $visitorCollectionFactory = null,
AddressRegistry $addressRegistry = null
) {
$this->customerFactory = $customerFactory;
Expand Down Expand Up @@ -428,7 +428,7 @@ public function __construct(
?: ObjectManager::getInstance()->get(SessionManagerInterface::class);
$this->saveHandler = $saveHandler
?: ObjectManager::getInstance()->get(SaveHandlerInterface::class);
$this->visitorColFactory = $visitorColFactory
$this->visitorCollectionFactory = $visitorCollectionFactory
?: ObjectManager::getInstance()->get(CollectionFactory::class);
$this->addressRegistry = $addressRegistry
?: ObjectManager::getInstance()->get(AddressRegistry::class);
Expand Down Expand Up @@ -1480,7 +1480,7 @@ private function destroyCustomerSessions($customerId)
$activeSessionsTime = $dateTime->setTimestamp($dateTime->getTimestamp() - $sessionLifetime)
->format(DateTime::DATETIME_PHP_FORMAT);
/** @var \Magento\Customer\Model\ResourceModel\Visitor\Collection $visitorCollection */
$visitorCollection = $this->visitorColFactory->create();
$visitorCollection = $this->visitorCollectionFactory->create();
$visitorCollection->addFieldToFilter('customer_id', $customerId);
$visitorCollection->addFieldToFilter('last_visit_at', ['from' => $activeSessionsTime]);
$visitorCollection->addFieldToFilter('session_id', ['neq' => $this->sessionManager->getSessionId()]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class AccountManagementTest extends \PHPUnit\Framework\TestCase
/**
* @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Customer\Model\ResourceModel\Visitor\CollectionFactory
*/
private $visitorColFactory;
private $visitorCollectionFactory;

/**
* @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\Session\SaveHandlerInterface
Expand Down Expand Up @@ -200,7 +200,7 @@ protected function setUp()
$this->dateTimeFactory = $this->createMock(DateTimeFactory::class);
$this->accountConfirmation = $this->createMock(AccountConfirmation::class);

$this->visitorColFactory = $this->getMockBuilder(
$this->visitorCollectionFactory = $this->getMockBuilder(
\Magento\Customer\Model\ResourceModel\Visitor\CollectionFactory::class
)
->disableOriginalConstructor()
Expand Down Expand Up @@ -244,7 +244,7 @@ protected function setUp()
'accountConfirmation' => $this->accountConfirmation,
'sessionManager' => $this->sessionManager,
'saveHandler' => $this->saveHandler,
'visitorColFactory' => $this->visitorColFactory,
'visitorCollectionFactory' => $this->visitorCollectionFactory,
'addressRegistry' => $this->addressRegistryMock,
]
);
Expand Down Expand Up @@ -1385,7 +1385,7 @@ private function reInitModel()
$this->sessionManager = $this->getMockBuilder(\Magento\Framework\Session\SessionManagerInterface::class)
->disableOriginalConstructor()
->getMockForAbstractClass();
$this->visitorColFactory = $this->getMockBuilder(
$this->visitorCollectionFactory = $this->getMockBuilder(
\Magento\Customer\Model\ResourceModel\Visitor\CollectionFactory::class
)
->disableOriginalConstructor()
Expand Down Expand Up @@ -1431,7 +1431,7 @@ private function reInitModel()
'stringHelper' => $this->string,
'scopeConfig' => $this->scopeConfig,
'sessionManager' => $this->sessionManager,
'visitorColFactory' => $this->visitorColFactory,
'visitorCollectionFactory' => $this->visitorCollectionFactory,
'saveHandler' => $this->saveHandler,
'encryptor' => $this->encryptor,
'dataProcessor' => $this->dataObjectProcessor,
Expand Down Expand Up @@ -1530,7 +1530,7 @@ public function testChangePassword()
->disableOriginalConstructor()->setMethods(['addFieldToFilter', 'getItems'])->getMock();
$visitorCollection->expects($this->atLeastOnce())->method('addFieldToFilter')->willReturnSelf();
$visitorCollection->expects($this->atLeastOnce())->method('getItems')->willReturn([$visitor, $visitor]);
$this->visitorColFactory->expects($this->atLeastOnce())->method('create')
$this->visitorCollectionFactory->expects($this->atLeastOnce())->method('create')
->willReturn($visitorCollection);
$this->saveHandler->expects($this->atLeastOnce())->method('destroy')
->withConsecutive(
Expand Down Expand Up @@ -1584,7 +1584,7 @@ function ($string) {
->disableOriginalConstructor()->setMethods(['addFieldToFilter', 'getItems'])->getMock();
$visitorCollection->expects($this->atLeastOnce())->method('addFieldToFilter')->willReturnSelf();
$visitorCollection->expects($this->atLeastOnce())->method('getItems')->willReturn([$visitor, $visitor]);
$this->visitorColFactory->expects($this->atLeastOnce())->method('create')
$this->visitorCollectionFactory->expects($this->atLeastOnce())->method('create')
->willReturn($visitorCollection);
$this->saveHandler->expects($this->atLeastOnce())->method('destroy')
->withConsecutive(
Expand Down

0 comments on commit 91275d6

Please sign in to comment.