Skip to content

Commit

Permalink
fixup! Bump vimeo/psalm from 4.2.1 to 4.3.0
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
  • Loading branch information
ChristophWurst committed Dec 28, 2020
1 parent f89660b commit 484b32d
Show file tree
Hide file tree
Showing 20 changed files with 50 additions and 36 deletions.
2 changes: 1 addition & 1 deletion apps/dav/lib/CalDAV/CalDavBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -1976,7 +1976,7 @@ public function getChangesForCalendar($calendarId, $syncToken, $syncLevel, $limi
if ($syncToken) {
$query = "SELECT `uri`, `operation` FROM `*PREFIX*calendarchanges` WHERE `synctoken` >= ? AND `synctoken` < ? AND `calendarid` = ? AND `calendartype` = ? ORDER BY `synctoken`";
if ($limit > 0) {
$query .= " LIMIT " . (int)$limit;
$query .= " LIMIT " . $limit;
}

// Fetching all changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@ private function getOrganizerEMailAndNameFromEvent(VEvent $vevent):?array {
}

$organizerEMail = substr($organizer->getValue(), 7);
if ($organizerEMail === false) {
return null;
}

$name = $organizer->offsetGet('CN');
if ($name instanceof Parameter) {
Expand Down
5 changes: 4 additions & 1 deletion apps/dav/lib/CalDAV/Schedule/IMipPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,10 @@ public function schedule(Message $iTipMessage) {
// Strip off mailto:
$sender = substr($iTipMessage->sender, 7);
$recipient = substr($iTipMessage->recipient, 7);
if ($sender === false || $recipient === false) {
// Shouldn't happen but in theory `substr` can return `false`
return;
}

$senderName = $iTipMessage->senderName ?: null;
$recipientName = $iTipMessage->recipientName ?: null;
Expand Down Expand Up @@ -207,7 +211,6 @@ public function schedule(Message $iTipMessage) {


$meetingUrl = $vevent->URL;
$meetingLocation = $vevent->LOCATION;

$defaultVal = '--';

Expand Down
4 changes: 2 additions & 2 deletions apps/encryption/lib/Controller/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,11 @@ public function updatePrivateKeyPassword($oldPassword, $newPassword) {
if ($result === true) {
$this->session->setStatus(Session::INIT_SUCCESSFUL);
return new DataResponse(
['message' => (string) $this->l->t('Private key password successfully updated.')]
['message' => $this->l->t('Private key password successfully updated.')]
);
} else {
return new DataResponse(
['message' => (string) $errorMessage],
['message' => $errorMessage],
Http::STATUS_BAD_REQUEST
);
}
Expand Down
6 changes: 5 additions & 1 deletion apps/encryption/lib/Crypto/EncryptAll.php
Original file line number Diff line number Diff line change
Expand Up @@ -414,10 +414,14 @@ protected function sendPasswordsByMail() {
$progress->advance();
if (!empty($password)) {
$recipient = $this->userManager->get($uid);
if ($recipient === null) {
$noMail[] = $uid;
continue;
}
$recipientDisplayName = $recipient->getDisplayName();
$to = $recipient->getEMailAddress();

if ($to === '') {
if (empty($to)) {
$noMail[] = $uid;
continue;
}
Expand Down
6 changes: 3 additions & 3 deletions apps/files_external/lib/MountConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -295,11 +295,11 @@ public static function dependencyMessage($backends) {
private static function getSingleDependencyMessage(\OCP\IL10N $l, $module, $backend) {
switch (strtolower($module)) {
case 'curl':
return (string)$l->t('The cURL support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it.', [$backend]);
return $l->t('The cURL support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it.', [$backend]);
case 'ftp':
return (string)$l->t('The FTP support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it.', [$backend]);
return $l->t('The FTP support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it.', [$backend]);
default:
return (string)$l->t('"%1$s" is not installed. Mounting of %2$s is not possible. Please ask your system administrator to install it.', [$module, $backend]);
return $l->t('"%1$s" is not installed. Mounting of %2$s is not possible. Please ask your system administrator to install it.', [$module, $backend]);
}
}

Expand Down
2 changes: 1 addition & 1 deletion apps/files_sharing/lib/Controller/ShareAPIController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1064,7 +1064,7 @@ public function updateShare(
}

if ($permissions !== null) {
$newPermissions = (int) $permissions;
$newPermissions = $permissions;
$newPermissions = $newPermissions & ~Constants::PERMISSION_SHARE;
}

Expand Down
2 changes: 1 addition & 1 deletion apps/files_sharing/lib/Controller/ShareesAPIController.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public function search(string $search = '', string $itemType = null, int $page =
}
sort($shareTypes);

$this->limit = (int) $perPage;
$this->limit = $perPage;
$this->offset = $perPage * ($page - 1);

// In global scale mode we always search the loogup server
Expand Down
2 changes: 1 addition & 1 deletion apps/settings/lib/Controller/HelpController.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function __construct(
public function help(string $mode = 'user'): TemplateResponse {
$this->navigationManager->setActiveEntry('help');

if (!isset($mode) || $mode !== 'admin') {
if (empty($mode) || $mode !== 'admin') {
$mode = 'user';
}

Expand Down
7 changes: 3 additions & 4 deletions apps/settings/lib/Hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,10 @@ public function onChangePassword($uid) {

$this->activityManager->publish($event);

if ($user->getEMailAddress() !== null) {
if (($email = $user->getEMailAddress()) !== null) {
$template = $this->mailer->createEMailTemplate('settings.PasswordChanged', [
'displayname' => $user->getDisplayName(),
'emailAddress' => $user->getEMailAddress(),
'emailAddress' => $email,
'instanceUrl' => $instanceUrl,
]);

Expand All @@ -140,9 +140,8 @@ public function onChangePassword($uid) {
$template->addBodyText($text . ' ' . $l->t('If you did not request this, please contact an administrator.'));
$template->addFooter();


$message = $this->mailer->createMessage();
$message->setTo([$user->getEMailAddress() => $user->getDisplayName()]);
$message->setTo([$email => $user->getDisplayName()]);
$message->useTemplate($template);
$this->mailer->send($message);
}
Expand Down
8 changes: 6 additions & 2 deletions apps/settings/lib/Mailer/NewUserMailHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,13 @@ public function generateTemplate(IUser $user, $generatePasswordResetToken = fals
* @throws \Exception If mail could not be sent
*/
public function sendMail(IUser $user,
IEMailTemplate $emailTemplate) {
IEMailTemplate $emailTemplate): void {
$message = $this->mailer->createMessage();
$message->setTo([$user->getEMailAddress() => $user->getDisplayName()]);
$email = $user->getEMailAddress();
if ($email === null) {
throw new \Exception("User has no email set");
}
$message->setTo([$email => $user->getDisplayName()]);
$message->setFrom([$this->fromAddress => $this->themingDefaults->getName()]);
$message->useTemplate($emailTemplate);
$this->mailer->send($message);
Expand Down
8 changes: 4 additions & 4 deletions apps/sharebymail/lib/Activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,24 +288,24 @@ protected function getParsedParameters(IEvent $event) {
case self::SUBJECT_SHARED_EMAIL_SELF:
case self::SUBJECT_UNSHARED_EMAIL_SELF:
return [
'file' => $this->generateFileParameter((int) $event->getObjectId(), $parameters[0]),
'file' => $this->generateFileParameter($event->getObjectId(), $parameters[0]),
'email' => $this->generateEmailParameter($parameters[1]),
];
case self::SUBJECT_SHARED_EMAIL_BY:
case self::SUBJECT_UNSHARED_EMAIL_BY:
return [
'file' => $this->generateFileParameter((int) $event->getObjectId(), $parameters[0]),
'file' => $this->generateFileParameter($event->getObjectId(), $parameters[0]),
'email' => $this->generateEmailParameter($parameters[1]),
'actor' => $this->generateUserParameter($parameters[2]),
];
case self::SUBJECT_SHARED_EMAIL_PASSWORD_SEND:
return [
'file' => $this->generateFileParameter((int) $event->getObjectId(), $parameters[0]),
'file' => $this->generateFileParameter($event->getObjectId(), $parameters[0]),
'email' => $this->generateEmailParameter($parameters[1]),
];
case self::SUBJECT_SHARED_EMAIL_PASSWORD_SEND_SELF:
return [
'file' => $this->generateFileParameter((int) $event->getObjectId(), $parameters[0]),
'file' => $this->generateFileParameter($event->getObjectId(), $parameters[0]),
];
}
throw new \InvalidArgumentException();
Expand Down
16 changes: 8 additions & 8 deletions apps/user_ldap/lib/User/OfflineUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public function getOCName() {
* @return string
*/
public function getUID() {
if (!isset($this->uid)) {
if ($this->uid === null) {
$this->fetchDetails();
}
return $this->uid;
Expand All @@ -145,7 +145,7 @@ public function getUID() {
* @return string
*/
public function getDN() {
if (!isset($this->dn)) {
if ($this->dn === null) {
$this->fetchDetails();
}
return $this->dn;
Expand All @@ -156,7 +156,7 @@ public function getDN() {
* @return string
*/
public function getDisplayName() {
if (!isset($this->displayName)) {
if ($this->displayName === null) {
$this->fetchDetails();
}
return $this->displayName;
Expand All @@ -167,7 +167,7 @@ public function getDisplayName() {
* @return string
*/
public function getEmail() {
if (!isset($this->email)) {
if ($this->email === null) {
$this->fetchDetails();
}
return $this->email;
Expand All @@ -178,7 +178,7 @@ public function getEmail() {
* @return string
*/
public function getHomePath() {
if (!isset($this->homePath)) {
if ($this->homePath === null) {
$this->fetchDetails();
}
return $this->homePath;
Expand All @@ -189,7 +189,7 @@ public function getHomePath() {
* @return int
*/
public function getLastLogin() {
if (!isset($this->lastLogin)) {
if ($this->lastLogin === null) {
$this->fetchDetails();
}
return (int)$this->lastLogin;
Expand All @@ -200,7 +200,7 @@ public function getLastLogin() {
* @return int
*/
public function getDetectedOn() {
if (!isset($this->foundDeleted)) {
if ($this->foundDeleted === null) {
$this->fetchDetails();
}
return (int)$this->foundDeleted;
Expand All @@ -211,7 +211,7 @@ public function getDetectedOn() {
* @return bool
*/
public function getHasActiveShares() {
if (!isset($this->hasActiveShares)) {
if ($this->hasActiveShares === null) {
$this->fetchDetails();
}
return $this->hasActiveShares;
Expand Down
2 changes: 1 addition & 1 deletion apps/weather_status/lib/Service/WeatherStatusService.php
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ private function forecastRequest(float $lat, float $lon, float $altitude, int $n
* @return array which contains the error message or the parsed JSON result
*/
private function requestJSON(string $url, array $params = []): array {
if (isset($this->cache)) {
if ($this->cache !== null) {
$cacheKey = $url . '|' . implode(',', $params) . '|' . implode(',', array_keys($params));
if ($this->cache->hasKey($cacheKey)) {
return $this->cache->get($cacheKey);
Expand Down
2 changes: 1 addition & 1 deletion apps/workflowengine/lib/Check/RequestUserAgent.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function executeCheck($operator, $value) {
* @return string
*/
protected function getActualValue() {
return (string) $this->request->getHeader('User-Agent');
return $this->request->getHeader('User-Agent');
}

public function isAvailableForScope(int $scope): bool {
Expand Down
1 change: 1 addition & 0 deletions core/Command/Config/ListConfigs.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ protected function configure() {
}

protected function execute(InputInterface $input, OutputInterface $output): int {
/** @var string $app */
$app = $input->getArgument('app');
$noSensitiveValues = !$input->getOption('private');

Expand Down
4 changes: 2 additions & 2 deletions lib/private/AppFramework/Http/Dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,15 @@ public function dispatch(Controller $controller, string $methodName): array {

if ($numBuilt > 50) {
$this->logger->debug('Controller {class}::{method} created {count} QueryBuilder objects, please check if they are created inside a loop by accident.' , [
'class' => (string) get_class($controller),
'class' => get_class($controller),
'method' => $methodName,
'count' => $numBuilt,
]);
}

if ($numExecuted > 100) {
$this->logger->warning('Controller {class}::{method} executed {count} queries.' , [
'class' => (string) get_class($controller),
'class' => get_class($controller),
'method' => $methodName,
'count' => $numExecuted,
]);
Expand Down
2 changes: 1 addition & 1 deletion lib/private/Cache/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class File implements ICache {
* @throws \OC\User\NoUserException
*/
protected function getStorage() {
if (isset($this->storage)) {
if ($this->storage !== null) {
return $this->storage;
}
if (\OC::$server->getUserSession()->isLoggedIn()) {
Expand Down
2 changes: 1 addition & 1 deletion lib/private/Files/FileInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ public function getPermissions() {
if (\OCP\Util::isSharingDisabledForUser() || ($this->isShared() && !\OC\Share\Share::isResharingAllowed())) {
$perms = $perms & ~\OCP\Constants::PERMISSION_SHARE;
}
return (int) $perms;
return $perms;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/private/Files/Storage/DAV.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ protected function init() {
'userName' => $this->user,
'password' => $this->password,
];
if (isset($this->authType)) {
if ($this->authType !== null) {
$settings['authType'] = $this->authType;
}

Expand Down

0 comments on commit 484b32d

Please sign in to comment.