Stricter phan config fixes

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
This commit is contained in:
Lukas Reschke 2017-07-19 15:37:03 +02:00 committed by Roeland Jago Douma
parent 456392e627
commit e1f52fc901
No known key found for this signature in database
GPG Key ID: F941078878347C0C
9 changed files with 22 additions and 22 deletions

View File

@ -201,13 +201,11 @@ class FilesPlugin extends ServerPlugin {
if ($sourceDir !== $destinationDir) { if ($sourceDir !== $destinationDir) {
$sourceNodeFileInfo = $sourceNode->getFileInfo(); $sourceNodeFileInfo = $sourceNode->getFileInfo();
if (is_null($sourceNodeFileInfo)) { if ($sourceNodeFileInfo !== null && !$sourceNodeFileInfo->isDeletable()) {
throw new NotFound($source . ' does not exist');
}
if (!$sourceNodeFileInfo->isDeletable()) {
throw new Forbidden($source . " cannot be deleted"); throw new Forbidden($source . " cannot be deleted");
} }
throw new NotFound($source . ' does not exist');
} }
} }

View File

@ -50,6 +50,10 @@ class FeedBackHandler {
private $progressStateStep = 0; private $progressStateStep = 0;
/** @var string */ /** @var string */
private $currentStep; private $currentStep;
/** @var \OCP\IEventSource */
private $eventSource;
/** @var \OCP\IL10N */
private $l10n;
public function __construct(\OCP\IEventSource $eventSource, \OCP\IL10N $l10n) { public function __construct(\OCP\IEventSource $eventSource, \OCP\IL10N $l10n) {
$this->eventSource = $eventSource; $this->eventSource = $eventSource;
@ -220,7 +224,7 @@ if (OC::checkUpgrade(false)) {
if (!empty($disabledApps)) { if (!empty($disabledApps)) {
$eventSource->send('notice', $eventSource->send('notice',
(string)$l->t('Following apps have been disabled: %s', implode(', ', $disabledApps))); (string)$l->t('Following apps have been disabled: %s', [implode(', ', $disabledApps)]));
} }
} else { } else {
$eventSource->send('notice', (string)$l->t('Already up to date')); $eventSource->send('notice', (string)$l->t('Already up to date'));

View File

@ -365,7 +365,7 @@ EOF;
* Adds a heading to the email * Adds a heading to the email
* *
* @param string $title * @param string $title
* @param string $plainTitle|bool Title that is used in the plain text email * @param string|bool $plainTitle Title that is used in the plain text email
* if empty the $title is used, if false none will be used * if empty the $title is used, if false none will be used
*/ */
public function addHeading($title, $plainTitle = '') { public function addHeading($title, $plainTitle = '') {

View File

@ -1249,7 +1249,6 @@ class Server extends ServerContainer implements IServerContainer {
} }
/** /**
* @internal For internal use only
* @return \OC\SystemConfig * @return \OC\SystemConfig
*/ */
public function getSystemConfig() { public function getSystemConfig() {

View File

@ -62,7 +62,7 @@ interface IEMailTemplate {
* Adds a heading to the email * Adds a heading to the email
* *
* @param string $title * @param string $title
* @param string $plainTitle|bool Title that is used in the plain text email * @param string|bool $plainTitle Title that is used in the plain text email
* if empty the $title is used, if false none will be used * if empty the $title is used, if false none will be used
* *
* @since 12.0.0 * @since 12.0.0

View File

@ -45,7 +45,6 @@ use OCP\Files\Config\IUserMountCache;
use OCP\Encryption\IEncryptionModule; use OCP\Encryption\IEncryptionModule;
use OCP\Encryption\IManager; use OCP\Encryption\IManager;
use OCP\IConfig; use OCP\IConfig;
use OCP\IGroupManager;
use OCP\IL10N; use OCP\IL10N;
use OCP\ILogger; use OCP\ILogger;
use OCP\IRequest; use OCP\IRequest;
@ -71,7 +70,7 @@ class UsersController extends Controller {
private $isAdmin; private $isAdmin;
/** @var IUserManager */ /** @var IUserManager */
private $userManager; private $userManager;
/** @var IGroupManager */ /** @var \OC\Group\Manager */
private $groupManager; private $groupManager;
/** @var IConfig */ /** @var IConfig */
private $config; private $config;
@ -113,7 +112,7 @@ class UsersController extends Controller {
* @param string $appName * @param string $appName
* @param IRequest $request * @param IRequest $request
* @param IUserManager $userManager * @param IUserManager $userManager
* @param IGroupManager $groupManager * @param \OC\Group\Manager $groupManager
* @param IUserSession $userSession * @param IUserSession $userSession
* @param IConfig $config * @param IConfig $config
* @param bool $isAdmin * @param bool $isAdmin
@ -136,7 +135,7 @@ class UsersController extends Controller {
public function __construct($appName, public function __construct($appName,
IRequest $request, IRequest $request,
IUserManager $userManager, IUserManager $userManager,
IGroupManager $groupManager, \OC\Group\Manager $groupManager,
IUserSession $userSession, IUserSession $userSession,
IConfig $config, IConfig $config,
$isAdmin, $isAdmin,
@ -180,14 +179,14 @@ class UsersController extends Controller {
$this->isEncryptionAppEnabled = $appManager->isEnabledForUser('encryption'); $this->isEncryptionAppEnabled = $appManager->isEnabledForUser('encryption');
if ($this->isEncryptionAppEnabled) { if ($this->isEncryptionAppEnabled) {
// putting this directly in empty is possible in PHP 5.5+ // putting this directly in empty is possible in PHP 5.5+
$result = $config->getAppValue('encryption', 'recoveryAdminEnabled', 0); $result = $config->getAppValue('encryption', 'recoveryAdminEnabled', '0');
$this->isRestoreEnabled = !empty($result); $this->isRestoreEnabled = !empty($result);
} }
} }
/** /**
* @param IUser $user * @param IUser $user
* @param array $userGroups * @param array|null $userGroups
* @return array * @return array
*/ */
private function formatUserForIndex(IUser $user, array $userGroups = null) { private function formatUserForIndex(IUser $user, array $userGroups = null) {

View File

@ -119,7 +119,7 @@ class Hooks {
if ($user->getEMailAddress() !== null) { if ($user->getEMailAddress() !== null) {
$template = $this->mailer->createEMailTemplate(); $template = $this->mailer->createEMailTemplate();
$template->addHeader(); $template->addHeader();
$template->addHeading($this->l->t('Password changed for %s', $user->getDisplayName()), false); $template->addHeading($this->l->t('Password changed for %s', [$user->getDisplayName()]), false);
$template->addBodyText($text . ' ' . $this->l->t('If you did not request this, please contact an administrator.')); $template->addBodyText($text . ' ' . $this->l->t('If you did not request this, please contact an administrator.'));
$template->addFooter(); $template->addFooter();
@ -185,10 +185,10 @@ class Hooks {
if ($oldMailAddress !== null) { if ($oldMailAddress !== null) {
$template = $this->mailer->createEMailTemplate(); $template = $this->mailer->createEMailTemplate();
$template->addHeader(); $template->addHeader();
$template->addHeading($this->l->t('Email address changed for %s', $user->getDisplayName()), false); $template->addHeading($this->l->t('Email address changed for %s', [$user->getDisplayName()]), false);
$template->addBodyText($text . ' ' . $this->l->t('If you did not request this, please contact an administrator.')); $template->addBodyText($text . ' ' . $this->l->t('If you did not request this, please contact an administrator.'));
if ($user->getEMailAddress()) { if ($user->getEMailAddress()) {
$template->addBodyText($this->l->t('The new email address is %s', $user->getEMailAddress())); $template->addBodyText($this->l->t('The new email address is %s', [$user->getEMailAddress()]));
} }
$template->addFooter(); $template->addFooter();

View File

@ -56,5 +56,5 @@ try {
} catch (Exception $ex) { } catch (Exception $ex) {
OC_Response::setStatus(OC_Response::STATUS_INTERNAL_SERVER_ERROR); OC_Response::setStatus(OC_Response::STATUS_INTERNAL_SERVER_ERROR);
\OCP\Util::writeLog('remote', $ex->getMessage(), \OCP\Util::FATAL); \OC::$server->getLogger()->logException($ex, ['app' => 'remote']);
} }

View File

@ -95,7 +95,7 @@ class Dummy extends Backend implements \OCP\IUserBackend {
* *
* @param string $uid The username * @param string $uid The username
* @param string $password The password * @param string $password The password
* @return string * @return string|bool
* *
* Check if the password is correct without logging in the user * Check if the password is correct without logging in the user
* returns the user id or false * returns the user id or false
@ -103,9 +103,9 @@ class Dummy extends Backend implements \OCP\IUserBackend {
public function checkPassword($uid, $password) { public function checkPassword($uid, $password) {
if (isset($this->users[$uid]) && $this->users[$uid] === $password) { if (isset($this->users[$uid]) && $this->users[$uid] === $password) {
return $uid; return $uid;
} else {
return false;
} }
return false;
} }
/** /**