Skip to content

Commit d5ffbe0

Browse files
committed
Merge branch 'phpstan' into 'master'
fix some Phpstan issues See merge request grommunio/grommunio-sync!95
2 parents 5a64c08 + b9d9974 commit d5ffbe0

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

lib/grommunio/grommunio.php

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,6 @@ public function SendMail($sm) {
453453
// only save the outgoing in sent items folder if the mobile requests it
454454
$mapiprops[$sendMailProps["sentmailentryid"]] = $storeprops[$sendMailProps["ipmsentmailentryid"]];
455455

456-
SLog::Write(LOGLEVEL_DEBUG, "Grommunio->SendMail(): Use the mapi_inetmapi_imtomapi function");
457456
$ab = mapi_openaddressbook($this->session);
458457
mapi_inetmapi_imtomapi($this->session, $this->defaultstore, $ab, $mapimessage, $sm->mime, []);
459458

@@ -538,9 +537,7 @@ public function SendMail($sm) {
538537
// only attach the original message if the mobile does not send it itself
539538
if (!isset($sm->replacemime)) {
540539
// get message's body in order to append forward or reply text
541-
if (!isset($body)) {
542-
$body = MAPIUtils::readPropStream($mapimessage, PR_BODY);
543-
}
540+
$body = MAPIUtils::readPropStream($mapimessage, PR_BODY);
544541
if (!isset($bodyHtml)) {
545542
$bodyHtml = MAPIUtils::readPropStream($mapimessage, PR_HTML);
546543
}
@@ -690,9 +687,7 @@ public function GetAttachmentData($attname) {
690687
}
691688

692689
list($id, $attachnum, $parentSourceKey, $exceptionBasedate) = explode(":", $attname);
693-
if (isset($parentEntryid)) {
694-
$this->Setup(GSync::GetAdditionalSyncFolderStore($parentSourceKey));
695-
}
690+
$this->Setup(GSync::GetAdditionalSyncFolderStore($parentSourceKey));
696691

697692
$entryid = hex2bin($id);
698693
$message = mapi_msgstore_openentry($this->store, $entryid);
@@ -929,11 +924,10 @@ public function MeetingResponse($folderid, $request) {
929924
if (empty($props)) {
930925
$props = MAPIMapping::GetMeetingRequestProperties();
931926
$props = getPropIdsFromStrings($this->store, $props);
932-
933-
$messageprops = mapi_getprops($mapimessage, [$props["goidtag"]]);
934-
$goid = $messageprops[$props["goidtag"]];
935927
}
936928

929+
$messageprops = mapi_getprops($mapimessage, [$props["goidtag"]]);
930+
$goid = $messageprops[$props["goidtag"]];
937931
$items = $meetingrequest->findCalendarItems($goid);
938932

939933
if (is_array($items)) {
@@ -953,8 +947,8 @@ public function MeetingResponse($folderid, $request) {
953947
if (isset($folderClass) && $folderClass == 'Email') {
954948
$folderentryid = mapi_msgstore_entryidfromsourcekey($this->store, hex2bin($folderid));
955949
$folder = mapi_msgstore_openentry($this->store, $folderentryid);
950+
mapi_folder_deletemessages($folder, [$reqentryid], 0);
956951
}
957-
mapi_folder_deletemessages($folder, [$reqentryid], 0);
958952

959953
$prefix = '';
960954
// prepend the short folderid of the target calendar: if available and short ids are used
@@ -2512,7 +2506,7 @@ private function copyAttachments(&$toMessage, $fromMessage) {
25122506
*/
25132507
private function getSearchFolder() {
25142508
// create new or open existing search folder
2515-
$searchFolderRoot = $this->getSearchFoldersRoot($this->store);
2509+
$searchFolderRoot = $this->getSearchFoldersRoot();
25162510
if ($searchFolderRoot === false) {
25172511
// error in finding search root folder
25182512
// or store doesn't support search folders
@@ -2674,7 +2668,7 @@ private function getFindRestriction($cpo) {
26742668
* @param int $maxAmbiguousRecipients
26752669
* @param bool $expandDistlist
26762670
*
2677-
* @return bool|SyncResolveRecipient
2671+
* @return array|bool
26782672
*/
26792673
private function resolveRecipient($to, $maxAmbiguousRecipients, $expandDistlist = true) {
26802674
$recipient = $this->resolveRecipientGAL($to, $maxAmbiguousRecipients, $expandDistlist);

0 commit comments

Comments
 (0)