summaryrefslogtreecommitdiff
path: root/plugins/libkolab
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2014-11-21 09:03:18 (GMT)
committerAleksander Machniak <machniak@kolabsys.com>2014-11-21 09:03:18 (GMT)
commitac4f6e75622c76e32d6a34fcbfb7b57ead18fd92 (patch)
tree7004e44eff67616b8cbc306c8652809f885b7b8d /plugins/libkolab
parent5738a7a7eca4256f39b279918d77f354cb9d4e28 (diff)
downloadroundcubemail-plugins-kolab-ac4f6e75622c76e32d6a34fcbfb7b57ead18fd92.tar.gz
Avoid unused variables (also fixed some bugs) found in static code analysis
Diffstat (limited to 'plugins/libkolab')
-rw-r--r--plugins/libkolab/lib/kolab_bonnie_api.php2
-rw-r--r--plugins/libkolab/lib/kolab_format_event.php4
-rw-r--r--plugins/libkolab/lib/kolab_storage.php10
-rw-r--r--plugins/libkolab/lib/kolab_storage_cache.php2
-rw-r--r--plugins/libkolab/lib/kolab_storage_folder.php4
5 files changed, 11 insertions, 11 deletions
diff --git a/plugins/libkolab/lib/kolab_bonnie_api.php b/plugins/libkolab/lib/kolab_bonnie_api.php
index 23dafd8..e8ac131 100644
--- a/plugins/libkolab/lib/kolab_bonnie_api.php
+++ b/plugins/libkolab/lib/kolab_bonnie_api.php
@@ -36,7 +36,7 @@ class kolab_bonnie_api
*/
public function __construct($config)
{
- $this->config = $confg;
+ $this->config = $config;
$this->client = new kolab_bonnie_api_client($config['uri'], $config['timeout'] ?: 5, (bool)$config['debug']);
diff --git a/plugins/libkolab/lib/kolab_format_event.php b/plugins/libkolab/lib/kolab_format_event.php
index c233f44..da0e43a 100644
--- a/plugins/libkolab/lib/kolab_format_event.php
+++ b/plugins/libkolab/lib/kolab_format_event.php
@@ -98,7 +98,7 @@ class kolab_format_event extends kolab_format_xcal
$vexceptions = new vectorevent;
foreach((array)$object['recurrence']['EXCEPTIONS'] as $exception) {
$exevent = new kolab_format_event;
- $exevent->set($this->compact_exception($exception, $object)); // only save differing values
+ $exevent->set($this->compact_exception($exception)); // only save differing values
$exevent->obj->setRecurrenceID(self::get_datetime($exception['start'], null, true), (bool)$exception['thisandfuture']);
$vexceptions->push($exevent->obj);
}
@@ -207,7 +207,7 @@ class kolab_format_event extends kolab_format_xcal
/**
* Remove some attributes from the exception container
*/
- private function compact_exception($exception, $master)
+ private function compact_exception($exception)
{
$forbidden = array('recurrence','organizer','attendees','sequence');
diff --git a/plugins/libkolab/lib/kolab_storage.php b/plugins/libkolab/lib/kolab_storage.php
index dfd1887..3a70bd5 100644
--- a/plugins/libkolab/lib/kolab_storage.php
+++ b/plugins/libkolab/lib/kolab_storage.php
@@ -403,13 +403,13 @@ class kolab_storage
'oldname' => $oldname, 'newname' => $newname));
$oldfolder = self::get_folder($oldname);
- $active = self::folder_is_active($oldname);
- $success = self::$imap->rename_folder($oldname, $newname);
+ $active = self::folder_is_active($oldname);
+ $success = self::$imap->rename_folder($oldname, $newname);
self::$last_error = self::$imap->get_error_str();
// pass active state to new folder name
if ($success && $active) {
- self::set_state($oldnam, false);
+ self::set_state($oldname, false);
self::set_state($newname, true);
}
@@ -1086,7 +1086,7 @@ class kolab_storage
return $types[self::CTYPE_KEY_PRIVATE];
}
else if (!empty($types[self::CTYPE_KEY])) {
- list($ctype, $suffix) = explode('.', $types[self::CTYPE_KEY]);
+ list($ctype, ) = explode('.', $types[self::CTYPE_KEY]);
return $ctype;
}
return null;
@@ -1464,7 +1464,7 @@ class kolab_storage
$user_attrib = self::$config->get('kolab_users_id_attrib', self::$config->get('kolab_auth_login', 'mail'));
array_walk($results, function(&$user, $dn) use ($root, $user_attrib) {
- list($localpart, $domain) = explode('@', $user[$user_attrib]);
+ list($localpart, ) = explode('@', $user[$user_attrib]);
$user['kolabtargetfolder'] = $root . $localpart;
});
diff --git a/plugins/libkolab/lib/kolab_storage_cache.php b/plugins/libkolab/lib/kolab_storage_cache.php
index 89f650d..6f22252 100644
--- a/plugins/libkolab/lib/kolab_storage_cache.php
+++ b/plugins/libkolab/lib/kolab_storage_cache.php
@@ -431,7 +431,7 @@ class kolab_storage_cache
/**
* Remove all objects from local cache
*/
- public function purge($type = null)
+ public function purge()
{
if (!$this->ready) {
return true;
diff --git a/plugins/libkolab/lib/kolab_storage_folder.php b/plugins/libkolab/lib/kolab_storage_folder.php
index 59d407f..d33f9d0 100644
--- a/plugins/libkolab/lib/kolab_storage_folder.php
+++ b/plugins/libkolab/lib/kolab_storage_folder.php
@@ -360,7 +360,7 @@ class kolab_storage_folder extends kolab_storage_folder_api
$object['_formatobj']->get_attachments($object);
}
- foreach ($object['_attachments'] as $k => $attach) {
+ foreach ($object['_attachments'] as $attach) {
if ($attach['id'] == $part) {
if ($print) echo $attach['content'];
else if ($fp) fwrite($fp, $attach['content']);
@@ -882,7 +882,7 @@ class kolab_storage_folder extends kolab_storage_folder_api
if (!empty($object['_attachments']) && ($mem_limit = parse_bytes(ini_get('memory_limit'))) > 0) {
$memory = function_exists('memory_get_usage') ? memory_get_usage() : 16*1024*1024; // safe value: 16MB
- foreach ($object['_attachments'] as $id => $attachment) {
+ foreach ($object['_attachments'] as $attachment) {
$memory += $attachment['size'];
}