Skip to content

Commit

Permalink
clean up code style issues (#22833)
Browse files Browse the repository at this point in the history
  • Loading branch information
lfolco committed May 22, 2019
1 parent cf66338 commit c552e5f
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 11 deletions.
6 changes: 2 additions & 4 deletions app/code/Magento/Security/Model/AdminSessionsManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,7 @@ public function processLogin()
}
}

if ($this->authSession->getUser()->getExpiresAt())
{
if ($this->authSession->getUser()->getExpiresAt()) {
$this->revokeExpiredAdminUser();
}

Expand All @@ -155,8 +154,7 @@ public function processProlong()
}

// todo: don't necessarily have a user here
if ($this->authSession->getUser()->getExpiresAt())
{
if ($this->authSession->getUser()->getExpiresAt()) {
$this->revokeExpiredAdminUser();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ public function setUp()
['create']
);

$this->currentSessionMock = $this->createPartialMock(\Magento\Security\Model\AdminSessionInfo::class, [
$this->currentSessionMock = $this->createPartialMock(
\Magento\Security\Model\AdminSessionInfo::class, [
'isActive',
'getStatus',
'load',
Expand All @@ -101,7 +102,8 @@ public function setUp()
'getUserId',
'getSessionId',
'getUpdatedAt'
]);
]
);

$this->securityConfigMock = $this->getMockBuilder(\Magento\Security\Model\ConfigInterface::class)
->disableOriginalConstructor()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\Ab

/**
* Define resource model
*
* @return void
*/
protected function _construct()
Expand Down Expand Up @@ -44,7 +45,8 @@ protected function _initSelect()

/**
* Filter for expired, active users.
* @param null $now
*
* @param string $now
* @return $this
*/
public function addActiveExpiredUsersFilter($now = null)
Expand Down
1 change: 1 addition & 0 deletions app/code/Magento/User/Model/UserValidationRules.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ public function addPasswordConfirmationRule(

/**
* Adds validation rule for expiration date.
*
* @param \Magento\Framework\Validator\DataObject $validator
* @return \Magento\Framework\Validator\DataObject
* @throws \Zend_Validate_Exception
Expand Down
1 change: 1 addition & 0 deletions app/code/Magento/User/Model/Validator/ExpiresAt.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class ExpiresAt extends AbstractValidator

/**
* Ensure that the given date is later than the current date.
*
* @param String $value
* @return bool
* @throws \Exception
Expand Down
6 changes: 6 additions & 0 deletions app/code/Magento/User/etc/crontab.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd">

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,5 @@ public function testExecuteWithNonExpiredUser()
static::assertEquals(1, $user->getIsActive());
static::assertNotNull($user->getExpiresAt());
static::assertNotNull($token->getId());

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,3 @@
$sql = "UPDATE " . $tableName . " SET expires_at = '2010-01-01 00:00:00' WHERE user_id=" .
$userIds[0] . ";";
$result = $conn->query($sql);


0 comments on commit c552e5f

Please sign in to comment.