Fix travis errors in share controller

This commit is contained in:
brantje 2016-10-07 23:57:42 +02:00
parent a63d32d1c8
commit bbcee22431
No known key found for this signature in database
GPG key ID: 5FF1D117F918687F
2 changed files with 5 additions and 5 deletions

View file

@ -196,7 +196,7 @@ class ShareController extends ApiController {
$usersTmp = $this->userManager->searchDisplayName($search, $this->limit, $this->offset);
foreach ($usersTmp as $user) {
if ($this->userId->getUID() != $user->getUID() && count($this->vaultService->getByUser($user->getUID())) >= 1) {
if ($this->userId->getUID() !== $user->getUID() && count($this->vaultService->getByUser($user->getUID())) >= 1) {
$users[] = array(
'text' => $user->getDisplayName(),
'uid' => $user->getUID(),
@ -416,7 +416,7 @@ class ShareController extends ApiController {
$views = $acl->getExpireViews();
if ($views === 0) {
return new NotFoundJSONResponse();
} else if ($views != -1) {
} else if ($views !== -1) {
$views--;
$acl->setExpireViews($views);
$this->shareService->updateCredentialACL($acl);
@ -441,7 +441,7 @@ class ShareController extends ApiController {
$pending = $this->shareService->getCredentialPendingAclList($item_guid);
try {
$credential = $this->credentialService->getCredentialByGUID($item_guid);
if ($credential->getUserId() == $this->userId->getUID()) {
if ($credential->getUserId() === $this->userId->getUID()) {
foreach ($pending as &$item) {
$item = $item->asACLJson();
}
@ -490,7 +490,7 @@ class ShareController extends ApiController {
} catch (DoesNotExistException $exception) {
return new NotFoundJSONResponse();
}
if ($this->userId->getUID() == $credential->getUserId()) {
if ($this->userId->getUID() === $credential->getUserId()) {
$acl = null;
try {
$acl = $this->shareService->getACL($user_id, $item_guid);

View file

@ -47,7 +47,7 @@ class VaultMapper extends Mapper {
/**
* @throws \OCP\AppFramework\Db\DoesNotExistException if not found
* @throws \OCP\AppFramework\Db\MultipleObjectsReturnedException if more than one result
* @return Vault
* @return Vault[]
*/
public function findVaultsFromUser($userId){
$sql = 'SELECT * FROM `*PREFIX*passman_vaults` ' .