Merge pull request #18108 from nextcloud/refactor/strict-credential-store
Add return type hint to credential store and make it strict
This commit is contained in:
commit
0fab27f459
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @copyright 2016 Christoph Wurst <christoph@winzerhof-wurst.at>
|
||||
*
|
||||
|
@ -82,8 +83,8 @@ class Store implements IStore {
|
|||
* @return ICredentials the login credentials of the current user
|
||||
* @throws CredentialsUnavailableException
|
||||
*/
|
||||
public function getLoginCredentials() {
|
||||
if (is_null($this->tokenProvider)) {
|
||||
public function getLoginCredentials(): ICredentials {
|
||||
if ($this->tokenProvider === null) {
|
||||
throw new CredentialsUnavailableException();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @copyright 2016 Christoph Wurst <christoph@winzerhof-wurst.at>
|
||||
*
|
||||
|
@ -38,6 +39,6 @@ interface IStore {
|
|||
* @throws CredentialsUnavailableException
|
||||
* @return ICredentials the login credentials of the current user
|
||||
*/
|
||||
public function getLoginCredentials();
|
||||
public function getLoginCredentials(): ICredentials;
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue