Changes of Revision 64

kolab-syncroton.spec Changed
x
 
1
@@ -37,7 +37,7 @@
2
 %global upstream_version 2.4.2
3
 
4
 Name:           kolab-syncroton
5
-Version: 2.4.2.16
6
+Version: 2.4.2.18
7
 Release:        1%{?dist}
8
 Summary:        ActiveSync for Kolab Groupware
9
 
10
@@ -176,7 +176,14 @@
11
     /bin/systemctl reload php-fpm.service || :
12
 fi
13
 
14
-/usr/share/roundcubemail/bin/updatedb.sh \
15
+
16
+%if 0%{?plesk} > 0 && 0%{?rhel} == 7
17
+php="/opt/plesk/php/7.4/bin/php"
18
+%else
19
+php="/usr/bin/php"
20
+%endif
21
+
22
+${php} /usr/share/roundcubemail/bin/updatedb.sh \
23
     --dir /usr/share/doc/kolab-syncroton/SQL/ \
24
     --package syncroton \
25
     >/dev/null 2>&1 || :
26
debian.changelog Changed
7
 
1
@@ -1,4 +1,4 @@
2
-kolab-syncroton (2.4.2.16-0~kolab1) unstable; urgency=low
3
+kolab-syncroton (2.4.2.18-0~kolab1) unstable; urgency=low
4
 
5
   * Release version 2.4.2
6
 
7
kolab-syncroton-2.4.2.tar.gz/.gitignore Added
12
 
1
@@ -0,0 +1,10 @@
2
+*.patch
3
+/config/config.inc.php
4
+/config/defaults.inc.php
5
+/composer.json
6
+/composer.lock
7
+/lib/plugins
8
+/lib/ext/Roundcube
9
+/logs/*.log
10
+/tests/.phpunit.result.cache
11
+/vendor
12
kolab-syncroton-2.4.2.tar.gz/.php-cs-fixer.php Changed
10
 
1
@@ -8,7 +8,7 @@
2
 $finder = Finder::create()
3
     ->in(__DIR__)
4
     ->exclude(
5
-        'lib/ext',
6
+        'lib/ext/Roundcube',
7
         'lib/plugins',
8
         'vendor',
9
     )
10
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Backend/ABackend.php Changed
201
 
1
@@ -19,22 +19,22 @@
2
 {
3
     /**
4
      * the database adapter
5
-     * 
6
+     *
7
      * @var Zend_Db_Adapter_Abstract
8
      */
9
     protected $_db;
10
-    
11
+
12
     protected $_tablePrefix;
13
-    
14
+
15
     protected $_tableName;
16
-    
17
+
18
     protected $_modelClassName;
19
-    
20
+
21
     protected $_modelInterfaceName;
22
-    
23
+
24
     /**
25
      * the constructor
26
-     * 
27
+     *
28
      * @param  Zend_Db_Adapter_Abstract  $_db
29
      * @param  string                    $_tablePrefix
30
      */
31
@@ -46,7 +46,7 @@
32
 
33
     /**
34
      * create new device
35
-     * 
36
+     *
37
      * @param Syncroton_Model_AEntry $model
38
      * @return Syncroton_Model_AEntry
39
      */
40
@@ -55,70 +55,71 @@
41
         if (! $model instanceof $this->_modelInterfaceName) {
42
             throw new InvalidArgumentException('$model must be instance of ' . $this->_modelInterfaceName);
43
         }
44
-        
45
+
46
         $data = $this->_convertModelToArray($model);
47
-        
48
-        $data'id' = sha1(mt_rand(). microtime());
49
+
50
+        $data'id' = sha1(mt_rand() . microtime());
51
 
52
         $this->_db->insert($this->_tablePrefix . $this->_tableName, $data);
53
-        
54
+
55
         return $this->get($data'id');
56
     }
57
-    
58
+
59
     /**
60
      * convert iteratable object to array
61
-     * 
62
+     *
63
      * @param  Syncroton_Model_AEntry   $model
64
      * @return array
65
      */
66
     protected function _convertModelToArray($model)
67
     {
68
-        $data = array();
69
-        
70
+        $data = ;
71
+
72
         foreach ($model as $key => $value) {
73
             if ($value instanceof DateTime) {
74
                 $value = $value->format('Y-m-d H:i:s');
75
             } elseif (is_object($value) && isset($value->id)) {
76
                 $value = $value->id;
77
             }
78
-        
79
+
80
             $data$this->_fromCamelCase($key) = $value;
81
         }
82
-        
83
+
84
         return $data;
85
     }
86
-    
87
+
88
     /**
89
-     * @param string  $_id
90
+     * @param string $id
91
+     *
92
      * @throws Syncroton_Exception_NotFound
93
-     * @return Syncroton_Model_IDevice
94
+     * @return Syncroton_Model_AEntry
95
      */
96
     public function get($id)
97
     {
98
         $id = $id instanceof $this->_modelInterfaceName ? $id->id : $id;
99
-        
100
+
101
         if (empty($id)) {
102
             throw new Syncroton_Exception_NotFound('id can not be empty');
103
         }
104
-        
105
+
106
         $select = $this->_db->select()
107
             ->from($this->_tablePrefix . $this->_tableName)
108
             ->where('id = ?', $id);
109
-            
110
+
111
         $stmt = $this->_db->query($select);
112
         $data = $stmt->fetch();
113
         $stmt = null; # see https://bugs.php.net/bug.php?id=44081
114
-        
115
+
116
         if ($data === false) {
117
             throw new Syncroton_Exception_NotFound('id not found');
118
         }
119
 
120
         return $this->_getObject($data);
121
     }
122
-    
123
+
124
     /**
125
      * convert array to object
126
-     * 
127
+     *
128
      * @param  array  $data
129
      * @return object
130
      */
131
@@ -126,30 +127,30 @@
132
     {
133
         foreach ($data as $key => $value) {
134
             unset($data$key);
135
-            
136
+
137
             if (!empty($value) && preg_match('/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $value)) { # 2012-08-12 07:43:26
138
                 $value = new DateTime($value, new DateTimeZone('UTC'));
139
             }
140
-            
141
+
142
             $data$this->_toCamelCase($key, false) = $value;
143
         }
144
-        
145
+
146
         return new $this->_modelClassName($data);
147
     }
148
-    
149
+
150
     /**
151
      * (non-PHPdoc)
152
      * @see Syncroton_Backend_IBackend::delete()
153
      */
154
     public function delete($id)
155
     {
156
-        $id = $id instanceof $this->_modelInterfaceName ? $id->id : $id;
157
-        
158
-        $result = $this->_db->delete($this->_tablePrefix . $this->_tableName, array('id = ?' => $id));
159
-        
160
+        $id = $id instanceof $this->_modelInterfaceName ? $id->id : $id; // @phpstan-ignore-line
161
+
162
+        $result = $this->_db->delete($this->_tablePrefix . $this->_tableName, 'id = ?' => $id);
163
+
164
         return (bool) $result;
165
     }
166
-    
167
+
168
     /**
169
      * (non-PHPdoc)
170
      * @see Syncroton_Backend_IBackend::update()
171
@@ -159,14 +160,14 @@
172
         if (! $model instanceof $this->_modelInterfaceName) {
173
             throw new InvalidArgumentException('$model must be instanace of ' . $this->_modelInterfaceName);
174
         }
175
-        
176
+
177
         $data = $this->_convertModelToArray($model);
178
-        
179
-        $this->_db->update($this->_tablePrefix . $this->_tableName, $data, array(
180
-            'id = ?' => $model->id
181
-        ));
182
-        
183
-        return $this->get($model->id);
184
+
185
+        $this->_db->update($this->_tablePrefix . $this->_tableName, $data, 
186
+            'id = ?' => $model->id, // @phpstan-ignore-line
187
+        );
188
+
189
+        return $this->get($model->id); // @phpstan-ignore-line
190
     }
191
 
192
     /**
193
@@ -178,7 +179,7 @@
194
      */
195
     public function userAccounts($device)
196
     {
197
-        return array();
198
+        return ;
199
     }
200
 
201
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Backend/Content.php Changed
156
 
1
@@ -7,7 +7,7 @@
2
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
3
  * @author      Lars Kneschke <l.kneschke@metaways.de>
4
  * @copyright   Copyright (c) 2009-2012 Metaways Infosystems GmbH (http://www.metaways.de)
5
- * 
6
+ *
7
  */
8
 
9
 /**
10
@@ -18,83 +18,87 @@
11
  */
12
 class Syncroton_Backend_Content extends Syncroton_Backend_ABackend implements Syncroton_Backend_IContent
13
 {
14
-    protected $_tableName = 'content';
15
-    
16
-    protected $_modelClassName = 'Syncroton_Model_Content';
17
-    
18
-    protected $_modelInterfaceName = 'Syncroton_Model_IContent';
19
-    
20
+    protected $_tableName = 'content';
21
+
22
+    protected $_modelClassName = 'Syncroton_Model_Content';
23
+
24
+    protected $_modelInterfaceName = 'Syncroton_Model_IContent';
25
+
26
     /**
27
-     * mark state as deleted. The state gets removed finally, 
28
+     * mark state as deleted. The state gets removed finally,
29
      * when the synckey gets validated during next sync.
30
-     * 
31
-     * @param Syncroton_Model_IContent|string $_id
32
+     *
33
+     * @param Syncroton_Model_IContent|string $id
34
+     *
35
+     * @return bool
36
      */
37
     public function delete($id)
38
     {
39
         $id = $id instanceof $this->_modelInterfaceName ? $id->id : $id;
40
-        
41
-        $this->_db->update($this->_tablePrefix . 'content', array(
42
-            'is_deleted' => 1
43
-        ), array(
44
-            'id = ?' => $id
45
-        ));
46
-        
47
+
48
+        $this->_db->update($this->_tablePrefix . 'content', 
49
+            'is_deleted' => 1,
50
+        , 
51
+            'id = ?' => $id,
52
+        );
53
+
54
+        return true;
55
     }
56
-    
57
+
58
     /**
59
      * @param Syncroton_Model_IDevice|string $deviceId
60
      * @param Syncroton_Model_IFolder|string $folderId
61
-     * @param string $_contentId
62
+     * @param string                         $contentId
63
      * @return Syncroton_Model_IContent
64
      */
65
     public function getContentState($deviceId, $folderId, $contentId)
66
     {
67
         $deviceId = $deviceId instanceof Syncroton_Model_IDevice ? $deviceId->id : $deviceId;
68
         $folderId = $folderId instanceof Syncroton_Model_IFolder ? $folderId->id : $folderId;
69
-    
70
+
71
         $select = $this->_db->select()
72
             ->from($this->_tablePrefix . 'content')
73
-            ->where($this->_db->quoteIdentifier('device_id')  . ' = ?', $deviceId)
74
-            ->where($this->_db->quoteIdentifier('folder_id')  . ' = ?', $folderId)
75
-            ->where($this->_db->quoteIdentifier('contentid')  . ' = ?', $contentId)
76
+            ->where($this->_db->quoteIdentifier('device_id') . ' = ?', $deviceId)
77
+            ->where($this->_db->quoteIdentifier('folder_id') . ' = ?', $folderId)
78
+            ->where($this->_db->quoteIdentifier('contentid') . ' = ?', $contentId)
79
             ->where($this->_db->quoteIdentifier('is_deleted') . ' = ?', 0);
80
-    
81
-        $stmt = $this->_db->query($select);
82
-        $data = $stmt->fetch();
83
-        $stmt = null; # see https://bugs.php.net/bug.php?id=44081
84
-        
85
-        if ($data === false) {
86
-            throw new Syncroton_Exception_NotFound('id not found');
87
-        }
88
-        
89
-        return $this->_getObject($data);        
90
+
91
+        $stmt = $this->_db->query($select);
92
+        $data = $stmt->fetch();
93
+        $stmt = null; # see https://bugs.php.net/bug.php?id=44081
94
+
95
+        if ($data === false) {
96
+            throw new Syncroton_Exception_NotFound('id not found');
97
+        }
98
+
99
+        return $this->_getObject($data);
100
     }
101
-    
102
+
103
     /**
104
      * get array of ids which got send to the client for a given class
105
      *
106
      * @param Syncroton_Model_IDevice|string $deviceId
107
      * @param Syncroton_Model_IFolder|string $folderId
108
+     * @param int                            $syncKey
109
      * @return array
110
      */
111
-    public function getFolderState($deviceId, $folderId)
112
+    public function getFolderState($deviceId, $folderId, $syncKey = null)
113
     {
114
         $deviceId = $deviceId instanceof Syncroton_Model_IDevice ? $deviceId->id : $deviceId;
115
         $folderId = $folderId instanceof Syncroton_Model_IFolder ? $folderId->id : $folderId;
116
-                
117
+
118
         $select = $this->_db->select()
119
             ->from($this->_tablePrefix . 'content', 'contentid')
120
-            ->where($this->_db->quoteIdentifier('device_id')  . ' = ?', $deviceId)
121
-            ->where($this->_db->quoteIdentifier('folder_id')  . ' = ?', $folderId)
122
+            ->where($this->_db->quoteIdentifier('device_id') . ' = ?', $deviceId)
123
+            ->where($this->_db->quoteIdentifier('folder_id') . ' = ?', $folderId)
124
             ->where($this->_db->quoteIdentifier('is_deleted') . ' = ?', 0);
125
-        
126
+
127
         $stmt = $this->_db->query($select);
128
         $result = $stmt->fetchAll(Zend_Db::FETCH_COLUMN);
129
-    
130
+
131
         return $result;
132
     }
133
-    
134
+
135
     /**
136
      * reset list of stored id
137
      *
138
@@ -105,12 +109,12 @@
139
     {
140
         $deviceId = $deviceId instanceof Syncroton_Model_IDevice ? $deviceId->id : $deviceId;
141
         $folderId = $folderId instanceof Syncroton_Model_IFolder ? $folderId->id : $folderId;
142
-         
143
-        $where = array(
144
+
145
+        $where = 
146
             $this->_db->quoteInto($this->_db->quoteIdentifier('device_id') . ' = ?', $deviceId),
147
-            $this->_db->quoteInto($this->_db->quoteIdentifier('folder_id') . ' = ?', $folderId)
148
-        );
149
-        
150
+            $this->_db->quoteInto($this->_db->quoteIdentifier('folder_id') . ' = ?', $folderId),
151
+        ;
152
+
153
         $this->_db->delete($this->_tablePrefix . 'content', $where);
154
     }
155
 }
156
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Backend/Device.php Changed
65
 
1
@@ -18,15 +18,15 @@
2
 class Syncroton_Backend_Device extends Syncroton_Backend_ABackend implements Syncroton_Backend_IDevice
3
 {
4
     protected $_tableName = 'device';
5
-    
6
+
7
     protected $_modelClassName = 'Syncroton_Model_Device';
8
-    
9
+
10
     protected $_modelInterfaceName = 'Syncroton_Model_IDevice';
11
-    
12
+
13
     /**
14
      * return device for this user
15
-     * 
16
-     * @param  string  $userId
17
+     *
18
+     * @param  string  $ownerId
19
      * @param  string  $deviceId
20
      * @throws Syncroton_Exception_NotFound
21
      * @return Syncroton_Model_Device
22
@@ -37,10 +37,10 @@
23
             ->from($this->_tablePrefix . $this->_tableName)
24
             ->where('owner_id = ?', $ownerId)
25
             ->where('deviceid = ?', $deviceId);
26
-        
27
+
28
         $stmt = $this->_db->query($select);
29
         $data = $stmt->fetch();
30
-        
31
+
32
         if ($data === false) {
33
             throw new Syncroton_Exception_NotFound('id not found');
34
         }
35
@@ -49,9 +49,9 @@
36
             unset($data$key);
37
             $data$this->_toCamelCase($key, false) = $value;
38
         }
39
-        
40
+
41
         $model = new $this->_modelClassName($data);
42
-        
43
+
44
         return $model;
45
     }
46
 
47
@@ -64,7 +64,7 @@
48
      */
49
     public function userAccounts($device)
50
     {
51
-        return array();
52
+        return ;
53
     }
54
 
55
     /**
56
@@ -72,7 +72,7 @@
57
      *
58
      * @param array $request Oof/Get request data
59
      *
60
-     * @return Syncroton_Model_Oof Response object or NULL if OOF is not supported
61
+     * @return Syncroton_Model_Oof|null Response object or NULL if OOF is not supported
62
      * @throws Syncroton_Exception_Status
63
      */
64
     public function getOOF($request)
65
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Backend/Folder.php Changed
148
 
1
@@ -7,7 +7,7 @@
2
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
3
  * @author      Lars Kneschke <l.kneschke@metaways.de>
4
  * @copyright   Copyright (c) 2009-2012 Metaways Infosystems GmbH (http://www.metaways.de)
5
- * 
6
+ *
7
  */
8
 
9
 /**
10
@@ -19,11 +19,11 @@
11
 class Syncroton_Backend_Folder extends Syncroton_Backend_ABackend implements Syncroton_Backend_IFolder
12
 {
13
     protected $_tableName = 'folder';
14
-    
15
+
16
     protected $_modelClassName = 'Syncroton_Model_Folder';
17
-    
18
+
19
     protected $_modelInterfaceName = 'Syncroton_Model_IFolder';
20
-    
21
+
22
     /**
23
      * (non-PHPdoc)
24
      * @see Syncroton_Backend_IFolder::getFolder()
25
@@ -31,22 +31,22 @@
26
     public function getFolder($deviceId, $folderId)
27
     {
28
         $deviceId = $deviceId instanceof Syncroton_Model_IDevice ? $deviceId->id : $deviceId;
29
-        
30
+
31
         $select = $this->_db->select()
32
             ->from($this->_tablePrefix . $this->_tableName)
33
             ->where($this->_db->quoteIdentifier('device_id') . ' = ?', $deviceId)
34
-            ->where($this->_db->quoteIdentifier('folderid')  . ' = ?', $folderId);
35
-        
36
+            ->where($this->_db->quoteIdentifier('folderid') . ' = ?', $folderId);
37
+
38
         $stmt = $this->_db->query($select);
39
         $data = $stmt->fetch();
40
 
41
         if ($data === false) {
42
             throw new Syncroton_Exception_NotFound('id not found');
43
         }
44
-        
45
+
46
         return $this->_getObject($data);
47
     }
48
-    
49
+
50
     /**
51
      * (non-PHPdoc)
52
      * @see Syncroton_Backend_IFolder::getFolderState()
53
@@ -54,22 +54,22 @@
54
     public function getFolderState($deviceId, $class)
55
     {
56
         $deviceId = $deviceId instanceof Syncroton_Model_IDevice ? $deviceId->id : $deviceId;
57
-        
58
+
59
         $select = $this->_db->select()
60
             ->from($this->_tablePrefix . $this->_tableName)
61
             ->where($this->_db->quoteIdentifier('device_id') . ' = ?', $deviceId)
62
-            ->where($this->_db->quoteIdentifier('class')     . ' = ?', $class);
63
-        
64
-        $result = array();
65
-        
66
+            ->where($this->_db->quoteIdentifier('class') . ' = ?', $class);
67
+
68
+        $result = ;
69
+
70
         $stmt = $this->_db->query($select);
71
         while ($data = $stmt->fetch()) {
72
-            $result$data'folderid' = $this->_getObject($data); 
73
+            $result$data'folderid' = $this->_getObject($data);
74
         }
75
-        
76
+
77
         return $result;
78
     }
79
-    
80
+
81
     /**
82
      * (non-PHPdoc)
83
      * @see Syncroton_Backend_IFolder::resetState()
84
@@ -77,11 +77,11 @@
85
     public function resetState($deviceId)
86
     {
87
         $deviceId = $deviceId instanceof Syncroton_Model_IDevice ? $deviceId->id : $deviceId;
88
-         
89
-        $where = array(
90
-            $this->_db->quoteInto($this->_db->quoteIdentifier('device_id') . ' = ?', $deviceId)
91
-        );
92
-        
93
+
94
+        $where = 
95
+            $this->_db->quoteInto($this->_db->quoteIdentifier('device_id') . ' = ?', $deviceId),
96
+        ;
97
+
98
         $this->_db->delete($this->_tablePrefix . $this->_tableName, $where);
99
     }
100
 
101
@@ -104,19 +104,15 @@
102
             case 'displayName':
103
             case 'parentId':
104
                 return strtolower($string);
105
-                break;
106
-                
107
+
108
             case 'serverId':
109
                 return 'folderid';
110
-                break;
111
-                
112
+
113
             default:
114
                 return parent::_fromCamelCase($string);
115
-                
116
-                break;
117
         }
118
     }
119
-    
120
+
121
     /**
122
      * (non-PHPdoc)
123
      * @see Syncroton_Backend_ABackend::_toCamelCase()
124
@@ -126,20 +122,15 @@
125
         switch ($string) {
126
             case 'displayname':
127
                 return 'displayName';
128
-                break;
129
-                
130
+
131
             case 'parentid':
132
                 return 'parentId';
133
-                break;
134
-                
135
+
136
             case 'folderid':
137
                 return 'serverId';
138
-                break;
139
-            
140
+
141
             default:
142
                 return parent::_toCamelCase($string, $ucFirst);
143
-                
144
-                break;
145
         }
146
     }
147
 }
148
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Backend/IBackend.php Changed
45
 
1
@@ -20,32 +20,32 @@
2
     /**
3
      * Create a new device
4
      *
5
-     * @param  Syncroton_Model_IDevice $device
6
-     * @return Syncroton_Model_IDevice
7
+     * @param  Syncroton_Model_IEntry $model
8
+     * @return Syncroton_Model_IEntry
9
      */
10
     public function create($model);
11
-    
12
+
13
     /**
14
      * Deletes one or more existing devices
15
      *
16
-     * @param string|array $_id
17
-     * @return void
18
+     * @param string|Syncroton_Model_IEntry $id
19
+     * @return bool
20
      */
21
     public function delete($id);
22
-    
23
+
24
     /**
25
      * Return a single device
26
      *
27
-     * @param string $_id
28
-     * @return Syncroton_Model_IDevice
29
+     * @param string $id
30
+     * @return Syncroton_Model_IEntry
31
      */
32
     public function get($id);
33
-    
34
+
35
     /**
36
      * Upates an existing persistent record
37
      *
38
-     * @param  Syncroton_Model_IDevice $_device
39
-     * @return Syncroton_Model_IDevice
40
+     * @param  Syncroton_Model_IEntry $model
41
+     * @return Syncroton_Model_IEntry
42
      */
43
     public function update($model);
44
 }
45
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Backend/IContent.php Changed
13
 
1
@@ -31,9 +31,10 @@
2
      *
3
      * @param Syncroton_Model_IDevice|string $_deviceId
4
      * @param Syncroton_Model_IFolder|string $_folderId
5
+     * @param int                            $_syncKey
6
      * @return array
7
      */
8
-    public function getFolderState($_deviceId, $_folderId);
9
+    public function getFolderState($_deviceId, $_folderId, $_syncKey = null);
10
 
11
     /**
12
      * reset list of stored id
13
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Backend/ISyncState.php Changed
39
 
1
@@ -19,14 +19,6 @@
2
 interface Syncroton_Backend_ISyncState extends Syncroton_Backend_IBackend
3
 {
4
     /**
5
-     * create new sync state
6
-     * 
7
-     * @param  Syncroton_Model_IDevice  $model
8
-     * @param  boolean                  $keepPreviousSyncState
9
-     */
10
-    #public function create($model, $keepPreviousSyncState = true);
11
-
12
-    /**
13
      * always returns the latest syncstate
14
      *
15
      * @param  Syncroton_Model_IDevice|string  $deviceId
16
@@ -35,15 +27,18 @@
17
      */
18
     public function getSyncState($deviceId, $folderId);
19
 
20
-    public function resetState($_deviceId, $_type);
21
+    public function haveNext($deviceId, $folderId, $syncKey);
22
+
23
+    public function resetState($deviceId, $type);
24
 
25
     /**
26
      * get array of ids which got send to the client for a given class
27
      *
28
-     * @param Syncroton_Model_Device $_deviceId
29
-     * @param string $_class
30
+     * @param Syncroton_Model_IDevice|string $deviceId
31
+     * @param Syncroton_Model_IFolder|string $folderId
32
+     * @param int                            $syncKey
33
      *
34
      * @return Syncroton_Model_SyncState|false
35
      */
36
-    public function validate($_deviceId, $_syncKey, $_type);
37
+    public function validate($deviceId, $folderId, $syncKey);
38
 }
39
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Backend/Policy.php Changed
77
 
1
@@ -15,57 +15,57 @@
2
  * @package     Syncroton
3
  * @subpackage  Backend
4
  */
5
-class Syncroton_Backend_Policy extends Syncroton_Backend_ABackend #implements Syncroton_Backend_IDevice
6
+class Syncroton_Backend_Policy extends Syncroton_Backend_ABackend
7
 {
8
     protected $_tableName = 'policy';
9
-    
10
+
11
     protected $_modelClassName = 'Syncroton_Model_Policy';
12
-    
13
+
14
     protected $_modelInterfaceName = 'Syncroton_Model_IPolicy';
15
-    
16
+
17
     /**
18
      * convert iteratable object to array
19
-     * 
20
-     * @param  unknown   $model
21
+     *
22
+     * @param Syncroton_Model_IXMLEntry  $model
23
      * @return array
24
      */
25
     protected function _convertModelToArray($model)
26
     {
27
         $policyValues = $model->getProperties('Provision');
28
-        
29
-        $policy = array();
30
-        
31
+
32
+        $policy = ;
33
+
34
         foreach ($policyValues as $policyName) {
35
-            if ($model->$policyName !== NULL) { 
36
+            if ($model->$policyName !== null) {
37
                 $policy$policyName = $model->$policyName;
38
             }
39
-            
40
+
41
             unset($model->$policyName);
42
         }
43
 
44
         $data = parent::_convertModelToArray($model);
45
-        
46
+
47
         $data'json_policy' = Zend_Json::encode($policy);
48
-        
49
+
50
         return $data;
51
     }
52
-    
53
+
54
     /**
55
      * convert array to object
56
-     * 
57
+     *
58
      * @param  array  $data
59
      * @return object
60
      */
61
     protected function _getObject($data)
62
     {
63
         $policy = Zend_Json::decode($data'json_policy');
64
-        
65
+
66
         foreach ($policy as $policyKey => $policyValue) {
67
             $data$policyKey = $policyValue;
68
         }
69
-        
70
+
71
         unset($data'json_policy');
72
-        
73
+
74
         return parent::_getObject($data);
75
     }
76
 }
77
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Backend/SyncState.php Changed
201
 
1
@@ -7,7 +7,7 @@
2
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
3
  * @author      Lars Kneschke <l.kneschke@metaways.de>
4
  * @copyright   Copyright (c) 2009-2012 Metaways Infosystems GmbH (http://www.metaways.de)
5
- * 
6
+ *
7
  */
8
 
9
 /**
10
@@ -18,12 +18,12 @@
11
  */
12
 class Syncroton_Backend_SyncState extends Syncroton_Backend_ABackend implements Syncroton_Backend_ISyncState
13
 {
14
-    protected $_tableName = 'synckey';
15
-    
16
-    protected $_modelClassName = 'Syncroton_Model_SyncState';
17
+    protected $_tableName = 'synckey';
18
+
19
+    protected $_modelClassName = 'Syncroton_Model_SyncState';
20
+
21
+    protected $_modelInterfaceName = 'Syncroton_Model_ISyncState';
22
 
23
-    protected $_modelInterfaceName = 'Syncroton_Model_ISyncState';
24
-    
25
     /**
26
      * (non-PHPdoc)
27
      * @see Syncroton_Backend_ISyncState::create()
28
@@ -31,15 +31,15 @@
29
     public function create($model, $keepPreviousSyncState = true)
30
     {
31
         $state = parent::create($model);
32
-        
33
+
34
         if ($keepPreviousSyncState !== true) {
35
             // remove all other synckeys
36
             $this->_deleteOtherStates($state);
37
         }
38
-        
39
+
40
         return $state;
41
     }
42
-    
43
+
44
     /**
45
      * (non-PHPdoc)
46
      * @see Syncroton_Backend_ABackend::_convertModelToArray()
47
@@ -47,46 +47,46 @@
48
     protected function _convertModelToArray($model)
49
     {
50
         $model = parent::_convertModelToArray($model);
51
-        
52
+
53
         $model'pendingdata' = isset($model'pendingdata') && is_array($model'pendingdata') ? Zend_Json::encode($model'pendingdata') : null;
54
-        
55
+
56
         return $model;
57
     }
58
-    
59
+
60
     /**
61
-     * 
62
+     *
63
      * @param Syncroton_Model_ISyncState $state
64
      */
65
     protected function _deleteOtherStates(Syncroton_Model_ISyncState $state)
66
     {
67
         // remove all other synckeys
68
-        $where = array(
69
+        $where = 
70
             'device_id = ?' => $state->deviceId,
71
             'type = ?'      => $state->type,
72
-            'counter != ?'  => $state->counter
73
-        );
74
-    
75
+            'counter != ?'  => $state->counter,
76
+        ;
77
+
78
         $this->_db->delete($this->_tablePrefix . $this->_tableName, $where);
79
-    
80
+
81
         return true;
82
-    
83
+
84
     }
85
-    
86
+
87
     /**
88
      * (non-PHPdoc)
89
      * @see Syncroton_Backend_ABackend::_getObject()
90
      */
91
-    protected function _getObject($data)
92
+    protected function _getObject($data)
93
     {
94
         $model = parent::_getObject($data);
95
-        
96
-        if ($model->pendingdata !== NULL) {
97
-            $model->pendingdata = Zend_Json::decode($model->pendingdata);
98
+
99
+        if ($model->pendingdata !== null) {
100
+            $model->pendingdata = Zend_Json::decode($model->pendingdata);
101
         }
102
-        
103
-        return $model;
104
+
105
+        return $model;
106
     }
107
-    
108
+
109
     /**
110
      * (non-PHPdoc)
111
      * @see Syncroton_Backend_ISyncState::getSyncState()
112
@@ -95,25 +95,25 @@
113
     {
114
         $deviceId = $deviceId instanceof Syncroton_Model_IDevice ? $deviceId->id : $deviceId;
115
         $folderId = $folderId instanceof Syncroton_Model_IFolder ? $folderId->id : $folderId;
116
-    
117
+
118
         $select = $this->_db->select()
119
             ->from($this->_tablePrefix . $this->_tableName)
120
             ->where($this->_db->quoteIdentifier('device_id') . ' = ?', $deviceId)
121
-            ->where($this->_db->quoteIdentifier('type')      . ' = ?', $folderId)
122
+            ->where($this->_db->quoteIdentifier('type') . ' = ?', $folderId)
123
             ->order('counter DESC')
124
             ->limit(1);
125
-        
126
-        $stmt = $this->_db->query($select);
127
+
128
+        $stmt = $this->_db->query($select);
129
         $data = $stmt->fetch();
130
-        $stmt = null; # see https://bugs.php.net/bug.php?id=44081
131
-        
132
-        if ($data === false) {
133
-            throw new Syncroton_Exception_NotFound('id not found');
134
-        }
135
-        
136
+        $stmt = null; # see https://bugs.php.net/bug.php?id=44081
137
+
138
+        if ($data === false) {
139
+            throw new Syncroton_Exception_NotFound('id not found');
140
+        }
141
+
142
         return $this->_getObject($data);
143
     }
144
-    
145
+
146
     /**
147
      * delete all stored synckeys for given type
148
      *
149
@@ -124,20 +124,21 @@
150
     {
151
         $deviceId = $deviceId instanceof Syncroton_Model_IDevice ? $deviceId->id : $deviceId;
152
         $folderId = $folderId instanceof Syncroton_Model_IFolder ? $folderId->id : $folderId;
153
-         
154
-        $where = array(
155
+
156
+        $where = 
157
             $this->_db->quoteInto($this->_db->quoteIdentifier('device_id') . ' = ?', $deviceId),
158
-            $this->_db->quoteInto($this->_db->quoteIdentifier('type') . ' = ?',      $folderId)
159
-        );
160
-    
161
+            $this->_db->quoteInto($this->_db->quoteIdentifier('type') . ' = ?', $folderId),
162
+        ;
163
+
164
         $this->_db->delete($this->_tablePrefix . $this->_tableName, $where);
165
     }
166
-    
167
+
168
     /**
169
      * get array of ids which got send to the client for a given class
170
      *
171
-     * @param  Syncroton_Model_IDevice|string  $deviceId
172
-     * @param  Syncroton_Model_IFolder|string  $folderId
173
+     * @param Syncroton_Model_IDevice|string $deviceId
174
+     * @param Syncroton_Model_IFolder|string $folderId
175
+     * @param int                            $syncKey
176
      *
177
      * @return Syncroton_Model_SyncState|false
178
      */
179
@@ -145,65 +146,70 @@
180
     {
181
         $deviceId = $deviceId instanceof Syncroton_Model_IDevice ? $deviceId->id : $deviceId;
182
         $folderId = $folderId instanceof Syncroton_Model_IFolder ? $folderId->id : $folderId;
183
-        
184
+
185
         $select = $this->_db->select()
186
             ->from($this->_tablePrefix . $this->_tableName)
187
             ->where($this->_db->quoteIdentifier('device_id') . ' = ?', $deviceId)
188
-            ->where($this->_db->quoteIdentifier('counter')   . ' = ?', $syncKey)
189
-            ->where($this->_db->quoteIdentifier('type')      . ' = ?', $folderId);
190
-        
191
+            ->where($this->_db->quoteIdentifier('counter') . ' = ?', $syncKey)
192
+            ->where($this->_db->quoteIdentifier('type') . ' = ?', $folderId);
193
+
194
         $stmt = $this->_db->query($select);
195
         $data = $stmt->fetch();
196
         $stmt = null; # see https://bugs.php.net/bug.php?id=44081
197
-        
198
+
199
         if ($data === false) {
200
             return false;
201
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Command/AutoDiscover.php Changed
154
 
1
@@ -15,7 +15,7 @@
2
  * @package     Syncroton
3
  * @subpackage  Command
4
  */
5
-class Syncroton_Command_AutoDiscover implements Syncroton_Command_ICommand
6
+class Syncroton_Command_AutoDiscover extends Syncroton_Command_Wbxml
7
 {
8
     /**
9
      * the domDocucment containing the xml request from the client
10
@@ -23,104 +23,105 @@
11
      * @var DOMDocument
12
      */
13
     protected $requestBody;
14
-    
15
+
16
     protected $emailAddress;
17
-    
18
-    public    $mobileSyncUrl;
19
-    
20
-    public    $certEnrollUrl;
21
-    
22
+
23
+    public $mobileSyncUrl;
24
+
25
+    public $certEnrollUrl;
26
+
27
     /**
28
      * constructor of this class
29
-     * 
30
-     * @param DOMDocument              $_requestBody
31
-     * @param Syncroton_Model_IDevice  $_device
32
-     * @param string                   $_policyKey
33
+     *
34
+     * @param DOMDocument             $requestBody
35
+     * @param Syncroton_Model_IDevice $device
36
+     * @param array                   $requestParams
37
      */
38
-    public function __construct($requestBody, Syncroton_Model_IDevice $device = null, $policyKey = null)
39
+    // @phpstan-ignore-next-line
40
+    public function __construct($requestBody, Syncroton_Model_IDevice $device, $requestParams = )
41
     {
42
         $this->requestBody = $requestBody;
43
     }
44
-    
45
+
46
     /**
47
-     * process the incoming data 
48
+     * process the incoming data
49
      */
50
     public function handle()
51
     {
52
         $xpath = new DomXPath($this->requestBody);
53
         $xpath->registerNamespace('2006', 'http://schemas.microsoft.com/exchange/autodiscover/mobilesync/requestschema/2006');
54
-        
55
+
56
         $nodes = $xpath->query('//2006:Autodiscover/2006:Request/2006:EMailAddress');
57
         if ($nodes->length === 0) {
58
             throw new Syncroton_Exception();
59
         }
60
-        
61
+
62
         $this->emailAddress = $nodes->item(0)->nodeValue;
63
     }
64
-    
65
+
66
     /**
67
      * create the response
68
-     * 
69
+     *
70
      * @return DOMDocument
71
      */
72
     public function getResponse()
73
     {
74
         // Creates an instance of the DOMImplementation class
75
         $imp = new DOMImplementation();
76
-        
77
+
78
         // Creates a DOMDocument instance
79
         $document = $imp->createDocument("http://schemas.microsoft.com/exchange/autodiscover/mobilesync/requestschema/2006", 'Autodiscover');
80
         $document->xmlVersion   = '1.0';
81
         $document->encoding     = 'UTF-8';
82
         $document->formatOutput = false;
83
-        
84
+
85
         $response = $document->documentElement->appendChild($document->createElement('Response'));
86
-        
87
+
88
         $user = $response->appendChild($document->createElement('User'));
89
         $user->appendChild($document->createElement('EMailAddress', $this->emailAddress));
90
-        
91
+
92
         $settings = $document->createElement('Settings');
93
-        
94
+
95
         if (!empty($this->mobileSyncUrl)) {
96
             $server   = $document->createElement('Server');
97
-            
98
+
99
             $server->appendChild($document->createElement('Type', 'MobileSync'));
100
-            
101
-            $server->appendChild($document->createElement('Url',  $this->mobileSyncUrl));
102
+
103
+            $server->appendChild($document->createElement('Url', $this->mobileSyncUrl));
104
             $server->appendChild($document->createElement('Name', $this->mobileSyncUrl));
105
-            
106
+
107
             $settings->appendChild($server);
108
         }
109
-        
110
+
111
         if (!empty($this->certEnrollUrl)) {
112
             $server   = $document->createElement('Server');
113
-            
114
+
115
             $server->appendChild($document->createElement('Type', 'CertEnroll'));
116
-            
117
-            $server->appendChild($document->createElement('Url',  $this->certEnrollUrl));
118
+
119
+            $server->appendChild($document->createElement('Url', $this->certEnrollUrl));
120
             $server->appendChild($document->createElement('Name'));
121
             $server->appendChild($document->createElement('ServerData', 'CertEnrollTemplate'));
122
-            
123
+
124
             $settings->appendChild($server);
125
         }
126
-        
127
+
128
         if ($settings->hasChildNodes()) {
129
             $action   = $response->appendChild($document->createElement('Action'));
130
             $action->appendChild($settings);
131
         }
132
-        
133
+
134
         return $document;
135
     }
136
-    
137
+
138
     /**
139
      * return headers of command
140
-     * 
141
+     *
142
      * @return array list of headers
143
      */
144
     public function getHeaders()
145
     {
146
-        return array(
147
-            'Content-Type'  => 'text/xml;charset=utf-8'
148
-        );
149
+        return 
150
+            'Content-Type'  => 'text/xml;charset=utf-8',
151
+        ;
152
     }
153
 }
154
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Command/FolderCreate.php Changed
166
 
1
@@ -19,9 +19,9 @@
2
 {
3
     protected $_defaultNameSpace    = 'uri:FolderHierarchy';
4
     protected $_documentElement     = 'FolderCreate';
5
-    
6
+
7
     /**
8
-     * @var Syncroton_Model_Folder
9
+     * @var Syncroton_Model_IFolder
10
      */
11
     protected $_folder;
12
 
13
@@ -29,46 +29,49 @@
14
      * @var int
15
      */
16
     protected $_status;
17
-    
18
+
19
     /**
20
      * parse FolderCreate request
21
      */
22
     public function handle()
23
     {
24
         $xml = simplexml_import_dom($this->_requestBody);
25
-        
26
+
27
         $syncKey = (int)$xml->SyncKey;
28
 
29
-        if ($this->_logger instanceof Zend_Log) 
30
+        if ($this->_logger instanceof Zend_Log) {
31
             $this->_logger->debug(__METHOD__ . '::' . __LINE__ . " synckey is $syncKey");
32
-        
33
+        }
34
+
35
         if (!($this->_syncState = $this->_syncStateBackend->validate($this->_device, 'FolderSync', $syncKey)) instanceof Syncroton_Model_SyncState) {
36
-            if ($this->_logger instanceof Zend_Log) 
37
+            if ($this->_logger instanceof Zend_Log) {
38
                 $this->_logger->info(__METHOD__ . '::' . __LINE__ . " invalid synckey provided. FolderSync 0 needed.");
39
+            }
40
 
41
             $this->_status = Syncroton_Command_FolderSync::STATUS_INVALID_SYNC_KEY;
42
             return;
43
         }
44
-        
45
+
46
         $folder = new Syncroton_Model_Folder($xml);
47
-        
48
-        if ($this->_logger instanceof Zend_Log)
49
+
50
+        if ($this->_logger instanceof Zend_Log) {
51
             $this->_logger->debug(__METHOD__ . '::' . __LINE__ . " parentId: {$folder->parentId} displayName: {$folder->displayName}");
52
+        }
53
 
54
         if (!strlen($folder->displayName)) {
55
             $this->_status = Syncroton_Command_FolderSync::STATUS_MISFORMATTED;
56
             return;
57
         }
58
-        
59
+
60
         switch($folder->type) {
61
             case Syncroton_Command_FolderSync::FOLDERTYPE_CALENDAR_USER_CREATED:
62
                 $folder->class = Syncroton_Data_Factory::CLASS_CALENDAR;
63
                 break;
64
-                
65
+
66
             case Syncroton_Command_FolderSync::FOLDERTYPE_CONTACT_USER_CREATED:
67
                 $folder->class = Syncroton_Data_Factory::CLASS_CONTACTS;
68
                 break;
69
-                
70
+
71
             case Syncroton_Command_FolderSync::FOLDERTYPE_MAIL_USER_CREATED:
72
                 $folder->class = Syncroton_Data_Factory::CLASS_EMAIL;
73
                 break;
74
@@ -76,11 +79,11 @@
75
             case Syncroton_Command_FolderSync::FOLDERTYPE_NOTE_USER_CREATED:
76
                 $folder->class = Syncroton_Data_Factory::CLASS_NOTES;
77
                 break;
78
-                
79
+
80
             case Syncroton_Command_FolderSync::FOLDERTYPE_TASK_USER_CREATED:
81
                 $folder->class = Syncroton_Data_Factory::CLASS_TASKS;
82
                 break;
83
-                
84
+
85
             default:
86
                 // unsupported type
87
                 return;
88
@@ -95,61 +98,65 @@
89
                 $this->_status = Syncroton_Command_FolderSync::STATUS_UNKNOWN_ERROR;
90
             } else {
91
                 $this->_folder->class        = $folder->class;
92
-                $this->_folder->deviceId     = $this->_device;
93
+                $this->_folder->deviceId     = $this->_device->id;
94
                 $this->_folder->creationTime = $this->_syncTimeStamp;
95
 
96
                 // Check if the folder already exists to avoid a duplicate insert attempt in db
97
                 try {
98
                     $this->_folderBackend->getFolder($this->_device, $this->_folder->serverId);
99
 
100
-                    if ($this->_logger instanceof Zend_Log)
101
+                    if ($this->_logger instanceof Zend_Log) {
102
                         $this->_logger->info(__METHOD__ . '::' . __LINE__ . " Attempted to create a folder that already exists. parentId: {$folder->parentId} displayName: {$folder->displayName}");
103
+                    }
104
 
105
                     // The folder already exists
106
                     $this->_status = Syncroton_Command_FolderSync::STATUS_FOLDER_EXISTS;
107
                 } catch (Syncroton_Exception_NotFound $e) {
108
                     // This is the normal case
109
-                    if ($this->_logger instanceof Zend_Log)
110
+                    if ($this->_logger instanceof Zend_Log) {
111
                         $this->_logger->debug(__METHOD__ . '::' . __LINE__ . " " . $e->getMessage());
112
+                    }
113
 
114
                     $this->_folderBackend->create($this->_folder);
115
                 }
116
             }
117
         } catch (Syncroton_Exception_Status $e) {
118
-            if ($this->_logger instanceof Zend_Log)
119
+            if ($this->_logger instanceof Zend_Log) {
120
                 $this->_logger->warn(__METHOD__ . '::' . __LINE__ . " " . $e->getMessage());
121
+            }
122
 
123
             $this->_status = $e->getCode();
124
         } catch (Exception $e) {
125
-            if ($this->_logger instanceof Zend_Log)
126
+            if ($this->_logger instanceof Zend_Log) {
127
                 $this->_logger->warn(__METHOD__ . '::' . __LINE__ . " " . $e->getMessage());
128
+            }
129
 
130
             $this->_status = Syncroton_Command_FolderSync::STATUS_UNKNOWN_ERROR;
131
         }
132
     }
133
-    
134
+
135
     /**
136
      * generate FolderCreate response
137
      */
138
     public function getResponse()
139
     {
140
         $folderCreate = $this->_outputDom->documentElement;
141
-        
142
+
143
         if ($this->_status) {
144
             $folderCreate->appendChild($this->_outputDom->createElementNS('uri:FolderHierarchy', 'Status', $this->_status));
145
         } else {
146
             $this->_syncState->counter++;
147
             $this->_syncState->lastsync = $this->_syncTimeStamp;
148
-            
149
+
150
             // store folder in state backend
151
             $this->_syncStateBackend->update($this->_syncState);
152
-            
153
+
154
             // create xml output
155
-            $folderCreate->appendChild($this->_outputDom->createElementNS('uri:FolderHierarchy', 'Status',   Syncroton_Command_FolderSync::STATUS_SUCCESS));
156
-            $folderCreate->appendChild($this->_outputDom->createElementNS('uri:FolderHierarchy', 'SyncKey',  $this->_syncState->counter));
157
+            $folderCreate->appendChild($this->_outputDom->createElementNS('uri:FolderHierarchy', 'Status', Syncroton_Command_FolderSync::STATUS_SUCCESS));
158
+            $folderCreate->appendChild($this->_outputDom->createElementNS('uri:FolderHierarchy', 'SyncKey', $this->_syncState->counter));
159
             $folderCreate->appendChild($this->_outputDom->createElementNS('uri:FolderHierarchy', 'ServerId', $this->_folder->serverId));
160
         }
161
-        
162
+
163
         return $this->_outputDom;
164
     }
165
 }
166
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Command/FolderDelete.php Changed
115
 
1
@@ -15,55 +15,57 @@
2
  * @package     Syncroton
3
  * @subpackage  Command
4
  */
5
-class Syncroton_Command_FolderDelete extends Syncroton_Command_Wbxml 
6
-{        
7
+class Syncroton_Command_FolderDelete extends Syncroton_Command_Wbxml
8
+{
9
     protected $_defaultNameSpace    = 'uri:FolderHierarchy';
10
     protected $_documentElement     = 'FolderDelete';
11
-    
12
+
13
     /**
14
-     * @var Syncroton_Model_SyncState
15
+     * @var Syncroton_Model_IFolder
16
      */
17
     protected $_folder;
18
-    
19
+
20
     /**
21
      * parse FolderDelete request
22
      */
23
     public function handle()
24
     {
25
         $xml = simplexml_import_dom($this->_requestBody);
26
-        
27
+
28
         // parse xml request
29
         $syncKey  = (int)$xml->SyncKey;
30
-        $serverId = (string)$xml->ServerId;
31
-        
32
-        if ($this->_logger instanceof Zend_Log) 
33
+        $serverId = (string)$xml->ServerId;
34
+
35
+        if ($this->_logger instanceof Zend_Log) {
36
             $this->_logger->debug(__METHOD__ . '::' . __LINE__ . " synckey is $syncKey");
37
-        
38
+        }
39
+
40
         if (!($this->_syncState = $this->_syncStateBackend->validate($this->_device, 'FolderSync', $syncKey)) instanceof Syncroton_Model_SyncState) {
41
-            return;
42
+            return;
43
         }
44
-        
45
+
46
         try {
47
             $folder = $this->_folderBackend->getFolder($this->_device, $serverId);
48
-            
49
+
50
             $dataController = Syncroton_Data_Factory::factory($folder->class, $this->_device, $this->_syncTimeStamp);
51
-            
52
+
53
             // delete folder in data backend
54
             $dataController->deleteFolder($folder);
55
-            
56
+
57
         } catch (Syncroton_Exception_NotFound $senf) {
58
-            if ($this->_logger instanceof Zend_Log)
59
+            if ($this->_logger instanceof Zend_Log) {
60
                 $this->_logger->debug(__METHOD__ . '::' . __LINE__ . " " . $senf->getMessage());
61
-            
62
+            }
63
+
64
             return;
65
         }
66
-        
67
+
68
         // delete folder in syncState backend
69
         $this->_folderBackend->delete($folder);
70
-        
71
+
72
         $this->_folder = $folder;
73
     }
74
-    
75
+
76
     /**
77
      * generate FolderDelete response
78
      *
79
@@ -72,27 +74,28 @@
80
     public function getResponse()
81
     {
82
         $folderDelete = $this->_outputDom->documentElement;
83
-        
84
+
85
         if (!$this->_syncState instanceof Syncroton_Model_SyncState) {
86
-            if ($this->_logger instanceof Zend_Log)
87
+            if ($this->_logger instanceof Zend_Log) {
88
                 $this->_logger->info(__METHOD__ . '::' . __LINE__ . " invalid synckey provided. FolderSync 0 needed.");
89
+            }
90
             $folderDelete->appendChild($this->_outputDom->createElementNS('uri:FolderHierarchy', 'Status', Syncroton_Command_FolderSync::STATUS_INVALID_SYNC_KEY));
91
-            
92
+
93
         } elseif (!$this->_folder instanceof Syncroton_Model_IFolder) {
94
             $folderDelete->appendChild($this->_outputDom->createElementNS('uri:FolderHierarchy', 'Status', Syncroton_Command_FolderSync::STATUS_FOLDER_NOT_FOUND));
95
-            
96
+
97
         } else {
98
             $this->_syncState->counter++;
99
             $this->_syncState->lastsync = $this->_syncTimeStamp;
100
-            
101
+
102
             // store folder in state backend
103
             $this->_syncStateBackend->update($this->_syncState);
104
-            
105
+
106
             // create xml output
107
             $folderDelete->appendChild($this->_outputDom->createElementNS('uri:FolderHierarchy', 'Status', Syncroton_Command_FolderSync::STATUS_SUCCESS));
108
             $folderDelete->appendChild($this->_outputDom->createElementNS('uri:FolderHierarchy', 'SyncKey', $this->_syncState->counter));
109
         }
110
-        
111
+
112
         return $this->_outputDom;
113
     }
114
 }
115
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Command/FolderSync.php Changed
201
 
1
@@ -15,52 +15,52 @@
2
  * @package     Syncroton
3
  * @subpackage  Command
4
  */
5
-class Syncroton_Command_FolderSync extends Syncroton_Command_Wbxml 
6
+class Syncroton_Command_FolderSync extends Syncroton_Command_Wbxml
7
 {
8
-    const STATUS_SUCCESS                = 1;
9
-    const STATUS_FOLDER_EXISTS          = 2;
10
-    const STATUS_IS_SPECIAL_FOLDER      = 3;
11
-    const STATUS_FOLDER_NOT_FOUND       = 4;
12
-    const STATUS_PARENT_FOLDER_NOT_FOUND = 5;
13
-    const STATUS_SERVER_ERROR           = 6;
14
-    const STATUS_ACCESS_DENIED          = 7;
15
-    const STATUS_REQUEST_TIMED_OUT      = 8;
16
-    const STATUS_INVALID_SYNC_KEY       = 9;
17
-    const STATUS_MISFORMATTED           = 10;
18
-    const STATUS_UNKNOWN_ERROR          = 11;
19
+    public const STATUS_SUCCESS                = 1;
20
+    public const STATUS_FOLDER_EXISTS          = 2;
21
+    public const STATUS_IS_SPECIAL_FOLDER      = 3;
22
+    public const STATUS_FOLDER_NOT_FOUND       = 4;
23
+    public const STATUS_PARENT_FOLDER_NOT_FOUND = 5;
24
+    public const STATUS_SERVER_ERROR           = 6;
25
+    public const STATUS_ACCESS_DENIED          = 7;
26
+    public const STATUS_REQUEST_TIMED_OUT      = 8;
27
+    public const STATUS_INVALID_SYNC_KEY       = 9;
28
+    public const STATUS_MISFORMATTED           = 10;
29
+    public const STATUS_UNKNOWN_ERROR          = 11;
30
 
31
     /**
32
      * some usefull constants for working with the xml files
33
      */
34
-    const FOLDERTYPE_GENERIC_USER_CREATED   = 1;
35
-    const FOLDERTYPE_INBOX                  = 2;
36
-    const FOLDERTYPE_DRAFTS                 = 3;
37
-    const FOLDERTYPE_DELETEDITEMS           = 4;
38
-    const FOLDERTYPE_SENTMAIL               = 5;
39
-    const FOLDERTYPE_OUTBOX                 = 6;
40
-    const FOLDERTYPE_TASK                   = 7;
41
-    const FOLDERTYPE_CALENDAR               = 8;
42
-    const FOLDERTYPE_CONTACT                = 9;
43
-    const FOLDERTYPE_NOTE                   = 10;
44
-    const FOLDERTYPE_JOURNAL                = 11;
45
-    const FOLDERTYPE_MAIL_USER_CREATED      = 12;
46
-    const FOLDERTYPE_CALENDAR_USER_CREATED  = 13;
47
-    const FOLDERTYPE_CONTACT_USER_CREATED   = 14;
48
-    const FOLDERTYPE_TASK_USER_CREATED      = 15;
49
-    const FOLDERTYPE_JOURNAL_USER_CREATED   = 16;
50
-    const FOLDERTYPE_NOTE_USER_CREATED      = 17;
51
-    const FOLDERTYPE_UNKOWN                 = 18;
52
-    
53
+    public const FOLDERTYPE_GENERIC_USER_CREATED   = 1;
54
+    public const FOLDERTYPE_INBOX                  = 2;
55
+    public const FOLDERTYPE_DRAFTS                 = 3;
56
+    public const FOLDERTYPE_DELETEDITEMS           = 4;
57
+    public const FOLDERTYPE_SENTMAIL               = 5;
58
+    public const FOLDERTYPE_OUTBOX                 = 6;
59
+    public const FOLDERTYPE_TASK                   = 7;
60
+    public const FOLDERTYPE_CALENDAR               = 8;
61
+    public const FOLDERTYPE_CONTACT                = 9;
62
+    public const FOLDERTYPE_NOTE                   = 10;
63
+    public const FOLDERTYPE_JOURNAL                = 11;
64
+    public const FOLDERTYPE_MAIL_USER_CREATED      = 12;
65
+    public const FOLDERTYPE_CALENDAR_USER_CREATED  = 13;
66
+    public const FOLDERTYPE_CONTACT_USER_CREATED   = 14;
67
+    public const FOLDERTYPE_TASK_USER_CREATED      = 15;
68
+    public const FOLDERTYPE_JOURNAL_USER_CREATED   = 16;
69
+    public const FOLDERTYPE_NOTE_USER_CREATED      = 17;
70
+    public const FOLDERTYPE_UNKOWN                 = 18;
71
+
72
     protected $_defaultNameSpace    = 'uri:FolderHierarchy';
73
     protected $_documentElement     = 'FolderSync';
74
-    
75
-    protected $_classes             = array(
76
+
77
+    protected $_classes             = 
78
         Syncroton_Data_Factory::CLASS_CALENDAR,
79
         Syncroton_Data_Factory::CLASS_CONTACTS,
80
         Syncroton_Data_Factory::CLASS_EMAIL,
81
         Syncroton_Data_Factory::CLASS_NOTES,
82
-        Syncroton_Data_Factory::CLASS_TASKS
83
-    );
84
+        Syncroton_Data_Factory::CLASS_TASKS,
85
+    ;
86
 
87
     /**
88
      * @var string
89
@@ -74,42 +74,44 @@
90
     {
91
         $xml = simplexml_import_dom($this->_requestBody);
92
         $syncKey = (int)$xml->SyncKey;
93
-        
94
-        if ($this->_logger instanceof Zend_Log) 
95
+
96
+        if ($this->_logger instanceof Zend_Log) {
97
             $this->_logger->debug(__METHOD__ . '::' . __LINE__ . " synckey is $syncKey");
98
-        
99
+        }
100
+
101
         if ($syncKey === 0) {
102
-            $this->_syncState = new Syncroton_Model_SyncState(array(
103
+            $this->_syncState = new Syncroton_Model_SyncState(
104
                 'device_id' => $this->_device,
105
                 'counter'   => 0,
106
                 'type'      => 'FolderSync',
107
-                'lastsync'  => $this->_syncTimeStamp
108
-            ));
109
-            
110
+                'lastsync'  => $this->_syncTimeStamp,
111
+            );
112
+
113
             // reset state of foldersync
114
             $this->_syncStateBackend->resetState($this->_device, 'FolderSync');
115
-            
116
+
117
             return;
118
-        } 
119
-        
120
+        }
121
+
122
         if (!($this->_syncState = $this->_syncStateBackend->validate($this->_device, 'FolderSync', $syncKey)) instanceof Syncroton_Model_SyncState) {
123
             $this->_syncStateBackend->resetState($this->_device, 'FolderSync');
124
         }
125
     }
126
-    
127
+
128
     /**
129
      * generate FolderSync response
130
-     * 
131
+     *
132
      * @todo changes are missing in response (folder got renamed for example)
133
      */
134
     public function getResponse()
135
     {
136
         $folderSync = $this->_outputDom->documentElement;
137
-        
138
+
139
         // invalid synckey provided
140
         if (!$this->_syncState instanceof Syncroton_Model_SyncState) {
141
-            if ($this->_logger instanceof Zend_Log) 
142
+            if ($this->_logger instanceof Zend_Log) {
143
                 $this->_logger->info(__METHOD__ . '::' . __LINE__ . " invalid synckey provided. FolderSync 0 needed.");
144
+            }
145
             $folderSync->appendChild($this->_outputDom->createElementNS('uri:FolderHierarchy', 'Status', self::STATUS_INVALID_SYNC_KEY));
146
 
147
             return $this->_outputDom;
148
@@ -120,43 +122,46 @@
149
             $optionsCommand = new Syncroton_Command_Options();
150
             $this->_headers = array_merge($this->_headers, $optionsCommand->getHeaders());
151
         }
152
-        
153
-        $adds    = array();
154
-        $updates = array();
155
-        $deletes = array();
156
+
157
+        $adds    = ;
158
+        $updates = ;
159
+        $deletes = ;
160
 
161
         foreach($this->_classes as $class) {
162
             try {
163
                 $dataController = Syncroton_Data_Factory::factory($class, $this->_device, $this->_syncTimeStamp);
164
             } catch (Exception $e) {
165
                 // backend not defined
166
-                if ($this->_logger instanceof Zend_Log)
167
+                if ($this->_logger instanceof Zend_Log) {
168
                     $this->_logger->info(__METHOD__ . '::' . __LINE__ . " no data backend defined for class: " . $class);
169
+                }
170
                 continue;
171
             }
172
 
173
             try {
174
                 // retrieve all folders available in data backend
175
                 $serverFolders = $dataController->getAllFolders();
176
-                
177
+
178
                 // retrieve all folders sent to client
179
                 $clientFolders = $this->_folderBackend->getFolderState($this->_device, $class);
180
-                
181
+
182
                 if ($this->_syncState->counter > 0) {
183
                     // retrieve all folders changed since last sync
184
                     $changedFolders = $dataController->getChangedFolders($this->_syncState->lastsync, $this->_syncTimeStamp);
185
                 } else {
186
-                    $changedFolders = array();
187
+                    $changedFolders = ;
188
                 }
189
-                
190
+
191
                 // only folders which were sent to the client already are allowed to be in $changedFolders
192
                 $changedFolders = array_intersect_key($changedFolders, $clientFolders);
193
-                
194
+
195
             } catch (Exception $e) {
196
-                if ($this->_logger instanceof Zend_Log)
197
+                if ($this->_logger instanceof Zend_Log) {
198
                     $this->_logger->crit(__METHOD__ . '::' . __LINE__ . " Syncing folder hierarchy failed: " . $e->getMessage());
199
-                if ($this->_logger instanceof Zend_Log)
200
+                }
201
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Command/FolderUpdate.php Changed
138
 
1
@@ -15,22 +15,22 @@
2
  * @package     Syncroton
3
  * @subpackage  Command
4
  */
5
-class Syncroton_Command_FolderUpdate extends Syncroton_Command_Wbxml 
6
-{        
7
+class Syncroton_Command_FolderUpdate extends Syncroton_Command_Wbxml
8
+{
9
     protected $_defaultNameSpace    = 'uri:FolderHierarchy';
10
     protected $_documentElement     = 'FolderUpdate';
11
-    
12
+
13
     /**
14
-     * @var Syncroton_Model_SyncState
15
+     * @var Syncroton_Model_IFolder
16
      */
17
     protected $_folder;
18
-    
19
+
20
     /**
21
-     * 
22
+     *
23
      * @var Syncroton_Model_Folder
24
      */
25
     protected $_folderUpdate;
26
-    
27
+
28
     /**
29
      * parse FolderUpdate request
30
      *
31
@@ -38,72 +38,76 @@
32
     public function handle()
33
     {
34
         $xml = simplexml_import_dom($this->_requestBody);
35
-        
36
+
37
         $syncKey = (int)$xml->SyncKey;
38
-        
39
-        if ($this->_logger instanceof Zend_Log) 
40
+
41
+        if ($this->_logger instanceof Zend_Log) {
42
             $this->_logger->debug(__METHOD__ . '::' . __LINE__ . " synckey is $syncKey");
43
+        }
44
 
45
         if (!($this->_syncState = $this->_syncStateBackend->validate($this->_device, 'FolderSync', $syncKey)) instanceof Syncroton_Model_SyncState) {
46
             return;
47
         }
48
-        
49
+
50
         $updatedFolder = new Syncroton_Model_Folder($xml);
51
-        
52
-        if ($this->_logger instanceof Zend_Log)
53
-            $this->_logger->debug(__METHOD__ . '::' . __LINE__ . " parentId: {$updatedFolder->parentId} displayName: {$updatedFolder->displayName}");
54
-        
55
+
56
+        if ($this->_logger instanceof Zend_Log) {
57
+            $this->_logger->debug(__METHOD__ . '::' . __LINE__ . " parentId: {$updatedFolder->parentId} displayName: {$updatedFolder->displayName}");
58
+        }
59
+
60
         try {
61
             $folder = $this->_folderBackend->getFolder($this->_device, $updatedFolder->serverId);
62
-            
63
+
64
             $folder->displayName = $updatedFolder->displayName;
65
             $folder->parentId    = $updatedFolder->parentId;
66
-            
67
+
68
             $dataController = Syncroton_Data_Factory::factory($folder->class, $this->_device, $this->_syncTimeStamp);
69
-            
70
+
71
             // update folder in data backend
72
             $dataController->updateFolder($folder);
73
-            
74
+
75
         } catch (Syncroton_Exception_NotFound $senf) {
76
-            if ($this->_logger instanceof Zend_Log)
77
+            if ($this->_logger instanceof Zend_Log) {
78
                 $this->_logger->debug(__METHOD__ . '::' . __LINE__ . " " . $senf->getMessage());
79
-            
80
+            }
81
+
82
             return;
83
         }
84
-        
85
+
86
         // update folder status in Syncroton backend
87
-        $this->_folder = $this->_folderBackend->update($folder);
88
+        $this->_folder = $this->_folderBackend->update($folder); // @phpstan-ignore-line
89
     }
90
-    
91
+
92
     /**
93
      * generate FolderUpdate response
94
      *
95
      * @todo currently we support only the main folder which contains all contacts/tasks/events/notes per class
96
      */
97
-    public function getResponse($_keepSession = FALSE)
98
+    public function getResponse($_keepSession = false)
99
     {
100
         $folderUpdate = $this->_outputDom->documentElement;
101
-        
102
+
103
         if (!$this->_syncState instanceof Syncroton_Model_SyncState) {
104
-            if ($this->_logger instanceof Zend_Log) 
105
+            if ($this->_logger instanceof Zend_Log) {
106
                 $this->_logger->info(__METHOD__ . '::' . __LINE__ . " invalid synckey provided. FolderSync 0 needed.");
107
-            $folderUpdate->appendChild($this->_outputDom->createElementNS('uri:FolderHierarchy', 'Status',  Syncroton_Command_FolderSync::STATUS_INVALID_SYNC_KEY));
108
-            
109
-        } elseif (!$this->_folder instanceof Syncroton_Model_IFolder) {
110
-            $folderUpdate->appendChild($this->_outputDom->createElementNS('uri:FolderHierarchy', 'Status', Syncroton_Command_FolderSync::STATUS_FOLDER_NOT_FOUND));
111
-            
112
+            }
113
+            $folderUpdate->appendChild($this->_outputDom->createElementNS('uri:FolderHierarchy', 'Status', Syncroton_Command_FolderSync::STATUS_INVALID_SYNC_KEY));
114
+
115
+        } elseif (!$this->_folder instanceof Syncroton_Model_IFolder) {
116
+            $folderUpdate->appendChild($this->_outputDom->createElementNS('uri:FolderHierarchy', 'Status', Syncroton_Command_FolderSync::STATUS_FOLDER_NOT_FOUND));
117
+
118
         } else {
119
             $this->_syncState->counter++;
120
             $this->_syncState->lastsync = $this->_syncTimeStamp;
121
-            
122
+
123
             // store folder in state backend
124
             $this->_syncStateBackend->update($this->_syncState);
125
-                        
126
+
127
             // create xml output
128
-            $folderUpdate->appendChild($this->_outputDom->createElementNS('uri:FolderHierarchy', 'Status',  Syncroton_Command_FolderSync::STATUS_SUCCESS));
129
+            $folderUpdate->appendChild($this->_outputDom->createElementNS('uri:FolderHierarchy', 'Status', Syncroton_Command_FolderSync::STATUS_SUCCESS));
130
             $folderUpdate->appendChild($this->_outputDom->createElementNS('uri:FolderHierarchy', 'SyncKey', $this->_syncState->counter));
131
         }
132
-        
133
+
134
         return $this->_outputDom;
135
-    }    
136
+    }
137
 }
138
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Command/GetAttachment.php Changed
64
 
1
@@ -22,44 +22,42 @@
2
      * @var string
3
      */
4
     protected $_attachmentName;
5
-    
6
+
7
     protected $_skipValidatePolicyKey = true;
8
-    
9
+
10
     /**
11
-     * process the XML file and add, change, delete or fetches data 
12
-     *
13
-     * @return resource
14
+     * process the XML file and add, change, delete or fetches data
15
      */
16
     public function handle()
17
     {
18
         $this->_attachmentName = $this->_requestParameters'attachmentName';
19
     }
20
-    
21
+
22
     /**
23
      * this function generates the response for the client
24
-     * 
25
+     *
26
      * @return void
27
      */
28
     public function getResponse()
29
     {
30
         $dataController = Syncroton_Data_Factory::factory(Syncroton_Data_Factory::CLASS_EMAIL, $this->_device, $this->_syncTimeStamp);
31
-        
32
+
33
         $attachment = $dataController->getFileReference($this->_attachmentName);
34
-        
35
+
36
         if (PHP_SAPI !== 'cli') {
37
-            // cache for 3600 seconds
38
+            // cache for 3600 seconds
39
             $maxAge = 3600;
40
-            $now = new DateTime('now', new DateTimeZone('UTC'));
41
-            header('Cache-Control: private, max-age=' . $maxAge);
42
-            header("Expires: " . gmdate('D, d M Y H:i:s', $now->modify("+{$maxAge} sec")->getTimestamp()) . " GMT");
43
-            
44
-            // overwrite Pragma header from session
45
-            header("Pragma: cache");
46
-            
47
-            #header('Content-Disposition: attachment; filename="' . $filename . '"');
48
-            header("Content-Type: " . $attachment->contentType);
49
+            $now = new DateTime('now', new DateTimeZone('UTC'));
50
+            header('Cache-Control: private, max-age=' . $maxAge);
51
+            header("Expires: " . gmdate('D, d M Y H:i:s', $now->modify("+{$maxAge} sec")->getTimestamp()) . " GMT");
52
+
53
+            // overwrite Pragma header from session
54
+            header("Pragma: cache");
55
+
56
+            #header('Content-Disposition: attachment; filename="' . $filename . '"');
57
+            header("Content-Type: " . $attachment->contentType);
58
         }
59
-        
60
+
61
         if (is_resource($attachment->data)) {
62
             fpassthru($attachment->data);
63
         } else {
64
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Command/GetItemEstimate.php Changed
176
 
1
@@ -15,73 +15,75 @@
2
  * @package     Syncroton
3
  * @subpackage  Command
4
  */
5
-class Syncroton_Command_GetItemEstimate extends Syncroton_Command_Wbxml 
6
+class Syncroton_Command_GetItemEstimate extends Syncroton_Command_Wbxml
7
 {
8
-    const STATUS_SUCCESS                = 1;
9
-    const STATUS_INVALID_COLLECTION     = 2;
10
-    const STATUS_SYNC_STATE_NOT_PRIMED  = 3;
11
-    const STATUS_INVALID_SYNC_KEY       = 4;
12
-    
13
+    public const STATUS_SUCCESS                = 1;
14
+    public const STATUS_INVALID_COLLECTION     = 2;
15
+    public const STATUS_SYNC_STATE_NOT_PRIMED  = 3;
16
+    public const STATUS_INVALID_SYNC_KEY       = 4;
17
+
18
     protected $_defaultNameSpace    = 'uri:ItemEstimate';
19
     protected $_documentElement     = 'GetItemEstimate';
20
-    
21
+
22
     /**
23
      * list of collections
24
      *
25
      * @var array
26
      */
27
-    protected $_collections = array();
28
-    
29
+    protected $_collections = ;
30
+
31
     /**
32
      */
33
     public function handle()
34
     {
35
         $xml = simplexml_import_dom($this->_requestBody);
36
-        
37
+
38
         foreach ($xml->Collections->Collection as $xmlCollection) {
39
-            
40
+
41
             // fetch values from a different namespace
42
             $airSyncValues  = $xmlCollection->children('uri:AirSync');
43
-            
44
-            $collectionData = array(
45
+
46
+            $collectionData = 
47
                 'syncKey'       => (int)$airSyncValues->SyncKey,
48
                 'collectionId'  => (string) $xmlCollection->CollectionId,
49
                 'class'         => isset($xmlCollection->Class) ? (string) $xmlCollection->Class : null,
50
-                'filterType'    => isset($airSyncValues->Options) && isset($airSyncValues->Options->FilterType) ? (int)$airSyncValues->Options->FilterType : 0
51
-            );
52
-            
53
-            if ($this->_logger instanceof Zend_Log) 
54
+                'filterType'    => isset($airSyncValues->Options) && isset($airSyncValues->Options->FilterType) ? (int)$airSyncValues->Options->FilterType : 0,
55
+            ;
56
+
57
+            if ($this->_logger instanceof Zend_Log) {
58
                 $this->_logger->info(__METHOD__ . '::' . __LINE__ . " synckey is {$collectionData'syncKey'} class: {$collectionData'class'} collectionid: {$collectionData'collectionId'} filtertype: {$collectionData'filterType'}");
59
-            
60
+            }
61
+
62
             try {
63
                 // does the folder exist?
64
                 $collectionData'folder' = $this->_folderBackend->getFolder($this->_device, $collectionData'collectionId');
65
                 $collectionData'folder'->lastfiltertype = $collectionData'filterType';
66
-                
67
+
68
                 if($collectionData'syncKey' === 0) {
69
-                    $collectionData'syncState' = new Syncroton_Model_SyncState(array(
70
+                    $collectionData'syncState' = new Syncroton_Model_SyncState(
71
                         'device_id' => $this->_device,
72
                         'counter'   => 0,
73
                         'type'      => $collectionData'folder',
74
-                        'lastsync'  => $this->_syncTimeStamp
75
-                    ));
76
-                    
77
+                        'lastsync'  => $this->_syncTimeStamp,
78
+                    );
79
+
80
                     // reset sync state for this folder
81
                     $this->_syncStateBackend->resetState($this->_device, $collectionData'folder');
82
                     $this->_contentStateBackend->resetState($this->_device, $collectionData'folder');
83
-                    
84
+
85
                 } else {
86
                     $collectionData'syncState' = $this->_syncStateBackend->validate($this->_device, $collectionData'folder', $collectionData'syncKey');
87
                 }
88
             } catch (Syncroton_Exception_NotFound $senf) {
89
-                if ($this->_logger instanceof Zend_Log)
90
+                if ($this->_logger instanceof Zend_Log) {
91
                     $this->_logger->debug(__METHOD__ . '::' . __LINE__ . " " . $senf->getMessage());
92
+                }
93
             }
94
-            
95
+
96
             $this->_collections$collectionData'collectionId' = $collectionData;
97
         }
98
-    }    
99
-    
100
+    }
101
+
102
     /**
103
      * (non-PHPdoc)
104
      * @see Syncroton_Command_Wbxml::getResponse()
105
@@ -89,41 +91,43 @@
106
     public function getResponse()
107
     {
108
         $itemEstimate = $this->_outputDom->documentElement;
109
-        
110
+
111
         foreach($this->_collections as $collectionData) {
112
             $response = $itemEstimate->appendChild($this->_outputDom->createElementNS('uri:ItemEstimate', 'Response'));
113
 
114
             // invalid collectionid provided
115
             if (empty($collectionData'folder')) {
116
-                if ($this->_logger instanceof Zend_Log)
117
+                if ($this->_logger instanceof Zend_Log) {
118
                     $this->_logger->warn(__METHOD__ . '::' . __LINE__ . " folder does not exist");
119
-                
120
+                }
121
+
122
                 $response->appendChild($this->_outputDom->createElementNS('uri:ItemEstimate', 'Status', self::STATUS_INVALID_COLLECTION));
123
                 $collection = $response->appendChild($this->_outputDom->createElementNS('uri:ItemEstimate', 'Collection'));
124
                 $collection->appendChild($this->_outputDom->createElementNS('uri:ItemEstimate', 'CollectionId', $collectionData'collectionId'));
125
                 $collection->appendChild($this->_outputDom->createElementNS('uri:ItemEstimate', 'Estimate', 0));
126
-                
127
+
128
             } elseif (! ($collectionData'syncState' instanceof Syncroton_Model_ISyncState)) {
129
-                if ($this->_logger instanceof Zend_Log)
130
+                if ($this->_logger instanceof Zend_Log) {
131
                     $this->_logger->warn(__METHOD__ . '::' . __LINE__ . " invalid synckey ${collectionData'syncKey'} provided");
132
+                }
133
                 /*
134
                  * Android phones (and maybe others) don't take care about status 4(INVALID_SYNC_KEY)
135
                  * To solve the problem we always return status 1(SUCCESS) even the sync key is invalid with Estimate set to 1.
136
                  * This way the phone gets forced to sync. Handling invalid synckeys during sync command works without any problems.
137
-                 * 
138
+                 *
139
                     $response->appendChild($this->_outputDom->createElementNS('uri:ItemEstimate', 'Status', self::STATUS_INVALID_SYNC_KEY));
140
                     $collection = $response->appendChild($this->_outputDom->createElementNS('uri:ItemEstimate', 'Collection'));
141
-                    $collection->appendChild($this->_outputDom->createElementNS('uri:ItemEstimate', 'CollectionId', $collectionData'collectionId'));  
142
+                    $collection->appendChild($this->_outputDom->createElementNS('uri:ItemEstimate', 'CollectionId', $collectionData'collectionId'));
143
                     $collection->appendChild($this->_outputDom->createElementNS('uri:ItemEstimate', 'Estimate', 0));
144
                  */
145
-                                                              
146
+
147
                 $response->appendChild($this->_outputDom->createElementNS('uri:ItemEstimate', 'Status', self::STATUS_SUCCESS));
148
                 $collection = $response->appendChild($this->_outputDom->createElementNS('uri:ItemEstimate', 'Collection'));
149
-                $collection->appendChild($this->_outputDom->createElementNS('uri:ItemEstimate', 'CollectionId', $collectionData'collectionId'));  
150
-                $collection->appendChild($this->_outputDom->createElementNS('uri:ItemEstimate', 'Estimate', 1));                                              
151
+                $collection->appendChild($this->_outputDom->createElementNS('uri:ItemEstimate', 'CollectionId', $collectionData'collectionId'));
152
+                $collection->appendChild($this->_outputDom->createElementNS('uri:ItemEstimate', 'Estimate', 1));
153
             } else {
154
                 $dataController = Syncroton_Data_Factory::factory($collectionData'folder'->class, $this->_device, $this->_syncTimeStamp);
155
-                
156
+
157
                 $response->appendChild($this->_outputDom->createElementNS('uri:ItemEstimate', 'Status', self::STATUS_SUCCESS));
158
                 $collection = $response->appendChild($this->_outputDom->createElementNS('uri:ItemEstimate', 'Collection'));
159
                 $collection->appendChild($this->_outputDom->createElementNS('uri:ItemEstimate', 'CollectionId', $collectionData'collectionId'));
160
@@ -135,13 +139,13 @@
161
                 }
162
                 $collection->appendChild($this->_outputDom->createElementNS('uri:ItemEstimate', 'Estimate', $count));
163
             }
164
-            
165
+
166
             // folderState can be NULL in case of not existing folder
167
             if (isset($collectionData'folder') && $collectionData'folder'->isDirty()) {
168
                 $this->_folderBackend->update($collectionData'folder');
169
             }
170
         }
171
-                
172
+
173
         return $this->_outputDom;
174
     }
175
 }
176
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Command/ICommand.php Changed
40
 
1
@@ -15,19 +15,19 @@
2
  * @package     Syncroton
3
  * @subpackage  Command
4
  */
5
-interface Syncroton_Command_ICommand 
6
+interface Syncroton_Command_ICommand
7
 {
8
     /**
9
      * constructor of this class
10
-     * 
11
+     *
12
      * @param resource                 $_requestBody
13
      * @param Syncroton_Model_IDevice  $_device
14
-     * @param string                   $_policyKey
15
+     * @param array                    $_requestParams
16
      */
17
-    public function __construct($_requestBody, Syncroton_Model_IDevice $_device, $_policyKey);
18
-    
19
+    public function __construct($_requestBody, Syncroton_Model_IDevice $_device, $_requestParams = );
20
+
21
     /**
22
-     * process the incoming data 
23
+     * process the incoming data
24
      */
25
     public function handle();
26
 
27
@@ -35,10 +35,10 @@
28
      * create the response
29
      */
30
     public function getResponse();
31
-    
32
+
33
     /**
34
      * return headers of command
35
-     * 
36
+     *
37
      * @return array list of headers
38
      */
39
     public function getHeaders();
40
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Command/ItemOperations.php Changed
201
 
1
@@ -15,31 +15,31 @@
2
  * @package     Syncroton
3
  * @subpackage  Command
4
  */
5
-class Syncroton_Command_ItemOperations extends Syncroton_Command_Wbxml 
6
-{        
7
-    const STATUS_SUCCESS        = 1;
8
-    const STATUS_PROTOCOL_ERROR = 2;
9
-    const STATUS_SERVER_ERROR   = 3;
10
-    
11
-    const STATUS_ITEM_FAILED_CONVERSION = 14;
12
-    
13
+class Syncroton_Command_ItemOperations extends Syncroton_Command_Wbxml
14
+{
15
+    public const STATUS_SUCCESS        = 1;
16
+    public const STATUS_PROTOCOL_ERROR = 2;
17
+    public const STATUS_SERVER_ERROR   = 3;
18
+
19
+    public const STATUS_ITEM_FAILED_CONVERSION = 14;
20
+
21
     protected $_defaultNameSpace    = 'uri:ItemOperations';
22
     protected $_documentElement     = 'ItemOperations';
23
-    
24
+
25
     /**
26
      * list of items to move
27
-     * 
28
+     *
29
      * @var array
30
      */
31
-    protected $_fetches = array();
32
-    
33
+    protected $_fetches = ;
34
+
35
     /**
36
      * list of folder to empty
37
-     * 
38
+     *
39
      * @var array
40
      */
41
-    protected $_emptyFolderContents = array();
42
-    
43
+    protected $_emptyFolderContents = ;
44
+
45
     /**
46
      * parse MoveItems request
47
      *
48
@@ -47,112 +47,112 @@
49
     public function handle()
50
     {
51
         $xml = simplexml_import_dom($this->_requestBody);
52
-        
53
+
54
         if (isset($xml->Fetch)) {
55
             foreach ($xml->Fetch as $fetch) {
56
                 $this->_fetches = $this->_handleFetch($fetch);
57
             }
58
         }
59
-        
60
+
61
         if (isset($xml->EmptyFolderContents)) {
62
             foreach ($xml->EmptyFolderContents as $emptyFolderContents) {
63
                 $this->_emptyFolderContents = $this->_handleEmptyFolderContents($emptyFolderContents);
64
             }
65
         }
66
     }
67
-    
68
+
69
     /**
70
      * generate ItemOperations response
71
-     * 
72
+     *
73
      * @todo add multipart support to all types of fetches
74
      */
75
     public function getResponse()
76
     {
77
         // add aditional namespaces
78
-        $this->_outputDom->documentElement->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:AirSyncBase' , 'uri:AirSyncBase');
79
-        $this->_outputDom->documentElement->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:AirSync'     , 'uri:AirSync');
80
-        $this->_outputDom->documentElement->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:Search'      , 'uri:Search');
81
-        
82
+        $this->_outputDom->documentElement->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:AirSyncBase', 'uri:AirSyncBase');
83
+        $this->_outputDom->documentElement->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:AirSync', 'uri:AirSync');
84
+        $this->_outputDom->documentElement->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:Search', 'uri:Search');
85
+
86
         $itemOperations = $this->_outputDom->documentElement;
87
-        
88
+
89
         $itemOperations->appendChild($this->_outputDom->createElementNS('uri:ItemOperations', 'Status', Syncroton_Command_ItemOperations::STATUS_SUCCESS));
90
-        
91
+
92
         $response = $itemOperations->appendChild($this->_outputDom->createElementNS('uri:ItemOperations', 'Response'));
93
-        
94
+
95
         foreach ($this->_fetches as $fetch) {
96
             $fetchTag = $response->appendChild($this->_outputDom->createElementNS('uri:ItemOperations', 'Fetch'));
97
-            
98
+
99
             try {
100
                 $dataController = Syncroton_Data_Factory::factory($fetch'store', $this->_device, $this->_syncTimeStamp);
101
-                
102
+
103
                 if (isset($fetch'collectionId')) {
104
                     $fetchTag->appendChild($this->_outputDom->createElementNS('uri:ItemOperations', 'Status', Syncroton_Command_ItemOperations::STATUS_SUCCESS));
105
                     $fetchTag->appendChild($this->_outputDom->createElementNS('uri:AirSync', 'CollectionId', $fetch'collectionId'));
106
-                    $fetchTag->appendChild($this->_outputDom->createElementNS('uri:AirSync', 'ServerId',     $fetch'serverId'));
107
-                    
108
+                    $fetchTag->appendChild($this->_outputDom->createElementNS('uri:AirSync', 'ServerId', $fetch'serverId'));
109
+
110
                     $properties = $this->_outputDom->createElementNS('uri:ItemOperations', 'Properties');
111
                     $dataController
112
-                        ->getEntry(new Syncroton_Model_SyncCollection(array('collectionId' => $fetch'collectionId', 'options' => $fetch'options')), $fetch'serverId')
113
+                        ->getEntry(new Syncroton_Model_SyncCollection('collectionId' => $fetch'collectionId', 'options' => $fetch'options'), $fetch'serverId')
114
                         ->appendXML($properties, $this->_device);
115
                     $fetchTag->appendChild($properties);
116
-                    
117
+
118
                 } elseif (isset($fetch'longId')) {
119
                     $fetchTag->appendChild($this->_outputDom->createElementNS('uri:ItemOperations', 'Status', Syncroton_Command_ItemOperations::STATUS_SUCCESS));
120
                     $fetchTag->appendChild($this->_outputDom->createElementNS('uri:Search', 'LongId', $fetch'longId'));
121
-                    
122
+
123
                     $properties = $this->_outputDom->createElementNS('uri:ItemOperations', 'Properties');
124
                     $dataController
125
-                        ->getEntry(new Syncroton_Model_SyncCollection(array('collectionId' => $fetch'longId', 'options' => $fetch'options')), $fetch'longId')
126
+                        ->getEntry(new Syncroton_Model_SyncCollection('collectionId' => $fetch'longId', 'options' => $fetch'options'), $fetch'longId')
127
                         ->appendXML($properties, $this->_device);
128
                     $fetchTag->appendChild($properties);
129
-                    
130
+
131
                 } elseif (isset($fetch'fileReference')) {
132
                     $fetchTag->appendChild($this->_outputDom->createElementNS('uri:ItemOperations', 'Status', Syncroton_Command_ItemOperations::STATUS_SUCCESS));
133
                     $fetchTag->appendChild($this->_outputDom->createElementNS('uri:AirSyncBase', 'FileReference', $fetch'fileReference'));
134
 
135
                     $properties = $this->_outputDom->createElementNS('uri:ItemOperations', 'Properties');
136
-                    
137
+
138
                     $fileReference = $dataController->getFileReference($fetch'fileReference');
139
-                    
140
+
141
                     // unset data field and move content to stream
142
                     if (!empty($this->_requestParameters'acceptMultipart')) {
143
                         $this->_headers'Content-Type' = 'application/vnd.ms-sync.multipart';
144
-                        
145
+
146
                         $partStream = fopen("php://temp", 'r+');
147
-                        
148
+
149
                         if (is_resource($fileReference->data)) {
150
                             stream_copy_to_stream($fileReference->data, $partStream);
151
                         } else {
152
                             fwrite($partStream, $fileReference->data);
153
                         }
154
-                        
155
+
156
                         unset($fileReference->data);
157
-                        
158
+
159
                         $this->_parts = $partStream;
160
-                        
161
+
162
                         $fileReference->part = count($this->_parts);
163
-                    } 
164
-                    
165
+                    }
166
+
167
                     /**
168
                      * the client requested a range. But we return the whole file.
169
-                     * 
170
+                     *
171
                      * That's not correct, but allowed. The server is allowed to overwrite the range.
172
-                     * 
173
+                     *
174
                      * @todo implement cutting $fileReference->data into pieces
175
                      */
176
                     if (isset($fetch'options''range')) {
177
                         $dataSize = $this->_getDataSize($fileReference->data);
178
-                        
179
+
180
                         $total = $this->_outputDom->createElementNS('uri:ItemOperations', 'Total', $dataSize);
181
                         $properties->appendChild($total);
182
-                        
183
-                        $rangeEnd = $dataSize > 0 ?  $dataSize - 1 : 0;
184
+
185
+                        $rangeEnd = $dataSize > 0 ? $dataSize - 1 : 0;
186
                         $range = $this->_outputDom->createElementNS('uri:ItemOperations', 'Range', '0-' . $rangeEnd);
187
                         $properties->appendChild($range);
188
                     }
189
-                    
190
+
191
                     $fileReference->appendXML($properties, $this->_device);
192
-                    
193
+
194
                     $fetchTag->appendChild($properties);
195
                 }
196
             } catch (Syncroton_Exception_NotFound $e) {
197
@@ -162,9 +162,9 @@
198
                 $response->appendChild($this->_outputDom->createElementNS('uri:ItemOperations', 'Status', Syncroton_Command_ItemOperations::STATUS_SERVER_ERROR));
199
             }
200
         }
201
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Command/MeetingResponse.php Changed
88
 
1
@@ -17,9 +17,10 @@
2
  */
3
 class Syncroton_Command_MeetingResponse extends Syncroton_Command_Wbxml
4
 {
5
-    protected $_results = array();
6
-    
7
+    protected $_results = ;
8
+
9
     protected $_defaultNameSpace = 'uri:MeetingResponse';
10
+
11
     protected $_documentElement  = 'MeetingResponse';
12
 
13
     /**
14
@@ -27,27 +28,28 @@
15
      */
16
     public function handle()
17
     {
18
+        /** @var Syncroton_Data_IDataCalendar $dataController */
19
         $dataController = Syncroton_Data_Factory::factory(Syncroton_Data_Factory::CLASS_CALENDAR, $this->_device, $this->_syncTimeStamp);
20
-        
21
+
22
         $xml = simplexml_import_dom($this->_requestBody);
23
 
24
         foreach ($xml as $meetingResponse) {
25
             $request = new Syncroton_Model_MeetingResponse($meetingResponse);
26
-            
27
+
28
             try {
29
                 $calendarId = $dataController->setAttendeeStatus($request);
30
-                
31
-                $this->_results = array(
32
+
33
+                $this->_results = 
34
                     'calendarId' => $calendarId,
35
                     'request'    => $request,
36
-                    'status'     => 1
37
-                );
38
-                
39
+                    'status'     => 1,
40
+                ;
41
+
42
             } catch (Syncroton_Exception_Status_MeetingResponse $sesmr) {
43
-                $this->_results = array(
44
+                $this->_results = 
45
                     'request' => $request,
46
-                    'status'  => $sesmr->getCode()
47
-                );
48
+                    'status'  => $sesmr->getCode(),
49
+                ;
50
             }
51
         }
52
     }
53
@@ -58,27 +60,27 @@
54
     public function getResponse()
55
     {
56
         $this->_outputDom->documentElement->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:Search', 'uri:Search');
57
-        
58
+
59
         $meetingResponse = $this->_outputDom->documentElement;
60
 
61
         foreach ($this->_results as $result) {
62
             $resultElement = $this->_outputDom->createElementNS('uri:MeetingResponse', 'Result');
63
-            
64
+
65
             if (isset($result'request'->requestId)) {
66
                 $resultElement->appendChild($this->_outputDom->createElementNS('uri:MeetingResponse', 'RequestId', $result'request'->requestId));
67
             } elseif (isset($result'request'->longId)) {
68
                 $resultElement->appendChild($this->_outputDom->createElementNS('uri:Search', 'LongId', $result'request'->longId));
69
             }
70
-            
71
+
72
             $resultElement->appendChild($this->_outputDom->createElementNS('uri:MeetingResponse', 'Status', $result'status'));
73
-            
74
+
75
             if (isset($result'calendarId')) {
76
                 $resultElement->appendChild($this->_outputDom->createElementNS('uri:MeetingResponse', 'CalendarId', $result'calendarId'));
77
             }
78
-            
79
+
80
             $meetingResponse->appendChild($resultElement);
81
-        } 
82
-        
83
+        }
84
+
85
         return $this->_outputDom;
86
     }
87
 }
88
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Command/MoveItems.php Changed
34
 
1
@@ -20,7 +20,7 @@
2
  */
3
 class Syncroton_Command_MoveItems extends Syncroton_Command_Wbxml
4
 {
5
-    const STATUS_SUCCESS                = 3;
6
+    public const STATUS_SUCCESS                = 3;
7
 
8
     protected $_defaultNameSpace    = 'uri:Move';
9
     protected $_documentElement     = 'MoveItems';
10
@@ -30,7 +30,7 @@
11
      *
12
      * @var array
13
      */
14
-    protected $_moves = array();
15
+    protected $_moves = ;
16
 
17
     /**
18
      * parse MoveItems request
19
@@ -40,11 +40,11 @@
20
         $xml = simplexml_import_dom($this->_requestBody);
21
 
22
         foreach ($xml->Move as $move) {
23
-            $this->_moves = array(
24
+            $this->_moves = 
25
                 'srcMsgId' => (string)$move->SrcMsgId,
26
                 'srcFldId' => (string)$move->SrcFldId,
27
-                'dstFldId' => (string)$move->DstFldId
28
-            );
29
+                'dstFldId' => (string)$move->DstFldId,
30
+            ;
31
         }
32
     }
33
 
34
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Command/Options.php Changed
21
 
1
@@ -20,15 +20,15 @@
2
     /**
3
      * this function generates the response for the client
4
      *
5
-     * @return void
6
+     * @return array
7
      */
8
     public function getHeaders()
9
     {
10
         // same header like Exchange 2xxx???
11
-        return array(
12
+        return 
13
             'MS-Server-ActiveSync'  => '14.00.0536.000',
14
             'MS-ASProtocolVersions' => '2.5,12.0,12.1,14.0,14.1',
15
-            'MS-ASProtocolCommands' => 'FolderCreate,FolderDelete,FolderSync,FolderUpdate,GetAttachment,GetItemEstimate,ItemOperations,MeetingResponse,MoveItems,Provision,ResolveRecipients,Ping,SendMail,Search,Settings,SmartForward,SmartReply,Sync,ValidateCert'
16
-        );
17
+            'MS-ASProtocolCommands' => 'FolderCreate,FolderDelete,FolderSync,FolderUpdate,GetAttachment,GetItemEstimate,ItemOperations,MeetingResponse,MoveItems,Provision,ResolveRecipients,Ping,SendMail,Search,Settings,SmartForward,SmartReply,Sync,ValidateCert',
18
+        ;
19
     }
20
 }
21
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Command/Ping.php Changed
201
 
1
@@ -15,45 +15,38 @@
2
  * @package     Syncroton
3
  * @subpackage  Command
4
  */
5
-class Syncroton_Command_Ping extends Syncroton_Command_Wbxml 
6
+class Syncroton_Command_Ping extends Syncroton_Command_Wbxml
7
 {
8
-    const STATUS_NO_CHANGES_FOUND           = 1;
9
-    const STATUS_CHANGES_FOUND              = 2;
10
-    const STATUS_MISSING_PARAMETERS         = 3;
11
-    const STATUS_REQUEST_FORMAT_ERROR       = 4;
12
-    const STATUS_INTERVAL_TO_GREAT_OR_SMALL = 5;
13
-    const STATUS_TOO_MANY_FOLDERS           = 6;
14
-    const STATUS_FOLDER_NOT_FOUND           = 7;
15
-    const STATUS_GENERAL_ERROR              = 8;
16
-    
17
-    const MAX_PING_INTERVAL                 = 3540; // 59 minutes limit defined in Activesync protocol spec. 
18
-    
19
+    public const STATUS_NO_CHANGES_FOUND           = 1;
20
+    public const STATUS_CHANGES_FOUND              = 2;
21
+    public const STATUS_MISSING_PARAMETERS         = 3;
22
+    public const STATUS_REQUEST_FORMAT_ERROR       = 4;
23
+    public const STATUS_INTERVAL_TO_GREAT_OR_SMALL = 5;
24
+    public const STATUS_TOO_MANY_FOLDERS           = 6;
25
+    public const STATUS_FOLDER_NOT_FOUND           = 7;
26
+    public const STATUS_GENERAL_ERROR              = 8;
27
+
28
+    public const MAX_PING_INTERVAL                 = 3540; // 59 minutes limit defined in Activesync protocol spec.
29
+
30
+    protected $_defaultNameSpace = 'uri:Ping';
31
+
32
+    protected $_documentElement = 'Ping';
33
+
34
     protected $_skipValidatePolicyKey = true;
35
-    
36
     protected $_changesDetected = false;
37
-    
38
-    /**
39
-     * @var Syncroton_Backend_StandAlone_Abstract
40
-     */
41
-    protected $_dataBackend;
42
+    protected $_foldersWithChanges = ;
43
 
44
-    protected $_defaultNameSpace = 'uri:Ping';
45
-    protected $_documentElement  = 'Ping';
46
-    
47
-    protected $_foldersWithChanges = array();
48
-    
49
     /**
50
-     * process the XML file and add, change, delete or fetches data 
51
+     * process the XML file and add, change, delete or fetches data
52
      *
53
      * @todo can we get rid of LIBXML_NOWARNING
54
      * @todo we need to stored the initial data for folders and lifetime as the phone is sending them only when they change
55
-     * @return resource
56
      */
57
     public function handle()
58
     {
59
         $intervalStart = time();
60
         $status = self::STATUS_NO_CHANGES_FOUND;
61
-        
62
+
63
         // the client does not send a wbxml document, if the Ping parameters did not change compared with the last request
64
         if ($this->_requestBody instanceof DOMDocument) {
65
             $xml = simplexml_import_dom($this->_requestBody);
66
@@ -62,7 +55,7 @@
67
             if(isset($xml->HeartbeatInterval)) {
68
                 $this->_device->pinglifetime = (int)$xml->HeartbeatInterval;
69
             }
70
-            
71
+
72
             if (isset($xml->Folders->Folder)) {
73
                 $maxCollections = Syncroton_Registry::getMaxCollections();
74
                 if ($maxCollections && count($xml->Folders->Folder) > $maxCollections) {
75
@@ -72,16 +65,17 @@
76
                     return;
77
                 }
78
 
79
-                $folders = array();
80
+                $folders = ;
81
                 foreach ($xml->Folders->Folder as $folderXml) {
82
                     try {
83
                         // does the folder exist?
84
                         $folder = $this->_folderBackend->getFolder($this->_device, (string)$folderXml->Id);
85
-                        
86
+
87
                         $folders$folder->id = $folder;
88
                     } catch (Syncroton_Exception_NotFound $senf) {
89
-                        if ($this->_logger instanceof Zend_Log) 
90
+                        if ($this->_logger instanceof Zend_Log) {
91
                             $this->_logger->debug(__METHOD__ . '::' . __LINE__ . " " . $senf->getMessage());
92
+                        }
93
                         $status = self::STATUS_FOLDER_NOT_FOUND;
94
                         break;
95
                     }
96
@@ -89,13 +83,13 @@
97
                 $this->_device->pingfolder = serialize(array_keys($folders));
98
             }
99
         }
100
-        
101
+
102
         $this->_device->lastping = new DateTime('now', new DateTimeZone('UTC'));
103
 
104
         if ($status == self::STATUS_NO_CHANGES_FOUND) {
105
-            $this->_device = $this->_deviceBackend->update($this->_device);
106
+            $this->_device = $this->_deviceBackend->update($this->_device); // @phpstan-ignore-line
107
         }
108
-        
109
+
110
         $lifeTime    = $this->_device->pinglifetime;
111
         $maxInterval = Syncroton_Registry::getPingInterval();
112
 
113
@@ -109,19 +103,20 @@
114
             $ping->appendChild($this->_outputDom->createElementNS('uri:Ping', 'HeartbeatInterval', $maxInterval));
115
             return;
116
         }
117
-        
118
+
119
         $intervalEnd = $intervalStart + $lifeTime;
120
         $secondsLeft = $intervalEnd;
121
-        
122
-        $folders = $this->_device->pingfolder ? unserialize($this->_device->pingfolder) : array();
123
-        
124
+
125
+        $folders = $this->_device->pingfolder ? unserialize($this->_device->pingfolder) : ;
126
+
127
         if ($status === self::STATUS_NO_CHANGES_FOUND && (!is_array($folders) || count($folders) == 0)) {
128
             $status = self::STATUS_MISSING_PARAMETERS;
129
         }
130
-        
131
-        if ($this->_logger instanceof Zend_Log) 
132
+
133
+        if ($this->_logger instanceof Zend_Log) {
134
             $this->_logger->debug(__METHOD__ . '::' . __LINE__ . " Folders to monitor($lifeTime / $intervalStart / $intervalEnd / $status): " . print_r($folders, true));
135
-        
136
+        }
137
+
138
         if ($status === self::STATUS_NO_CHANGES_FOUND) {
139
             $sleepCallback  = Syncroton_Registry::getSleepCallback();
140
             $wakeupCallback = Syncroton_Registry::getWakeupCallback();
141
@@ -133,8 +128,9 @@
142
 
143
                 // make sure the connection is still alive, abort otherwise
144
                 if (connection_aborted()) {
145
-                    if ($this->_logger instanceof Zend_Log)
146
+                    if ($this->_logger instanceof Zend_Log) {
147
                         $this->_logger->debug(__METHOD__ . '::' . __LINE__ . " Exiting on aborted connection");
148
+                    }
149
                     exit;
150
                 }
151
 
152
@@ -146,132 +142,147 @@
153
                 $secondsLeft = $intervalEnd - time();
154
 
155
                 try {
156
+                    /** @var Syncroton_Model_Device $device */
157
                     $device = $this->_deviceBackend->get($this->_device->id);
158
                 } catch (Syncroton_Exception_NotFound $e) {
159
-                    if ($this->_logger instanceof Zend_Log)
160
+                    if ($this->_logger instanceof Zend_Log) {
161
                         $this->_logger->debug(__METHOD__ . '::' . __LINE__ . " " . $e->getMessage());
162
+                    }
163
 
164
                     $status = self::STATUS_FOLDER_NOT_FOUND;
165
                     break;
166
                 } catch (Exception $e) {
167
-                    if ($this->_logger instanceof Zend_Log)
168
+                    if ($this->_logger instanceof Zend_Log) {
169
                         $this->_logger->err(__METHOD__ . '::' . __LINE__ . " " . $e->getMessage());
170
+                    }
171
 
172
                     // do nothing, maybe temporal issue, should we stop?
173
                     continue;
174
                 }
175
 
176
                 // if another Ping command updated lastping property, we can stop processing this Ping command request
177
-                if ((isset($device->lastping) && $device->lastping instanceof DateTime) &&
178
+                if ((isset($device->lastping) &&
179
+                    $device->lastping instanceof DateTime) &&
180
                     $device->pingfolder === $this->_device->pingfolder &&
181
-                    $device->lastping->getTimestamp() > $this->_device->lastping->getTimestamp() ) {
182
+                    $device->lastping->getTimestamp() > $this->_device->lastping->getTimestamp()
183
+                ) {
184
                     break;
185
                 }
186
 
187
                 // If folders hierarchy changed, break the loop and ask the client for FolderSync
188
                 try {
189
                     if ($this->_folderBackend->hasHierarchyChanges($this->_device)) {
190
-                        if ($this->_logger instanceof Zend_Log)
191
+                        if ($this->_logger instanceof Zend_Log) {
192
                             $this->_logger->debug(__METHOD__ . '::' . __LINE__ . ' Detected changes in folders hierarchy');
193
+                        }
194
 
195
                         $status = self::STATUS_FOLDER_NOT_FOUND;
196
                         break;
197
                     }
198
                 } catch (Exception $e) {
199
-                    if ($this->_logger instanceof Zend_Log)
200
+                    if ($this->_logger instanceof Zend_Log) {
201
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Command/Provision.php Changed
201
 
1
@@ -19,67 +19,65 @@
2
 {
3
     protected $_defaultNameSpace = 'uri:Provision';
4
     protected $_documentElement  = 'Provision';
5
-    
6
-    const POLICYTYPE_WBXML = 'MS-EAS-Provisioning-WBXML';
7
-    
8
-    const STATUS_SUCCESS                   = 1;
9
-    const STATUS_PROTOCOL_ERROR            = 2;
10
-    const STATUS_GENERAL_SERVER_ERROR      = 3;
11
-    const STATUS_DEVICE_MANAGED_EXTERNALLY = 4;
12
-    
13
-    const STATUS_POLICY_SUCCESS        = 1;
14
-    const STATUS_POLICY_NOPOLICY       = 2;
15
-    const STATUS_POLICY_UNKNOWNTYPE    = 3;
16
-    const STATUS_POLICY_CORRUPTED      = 4;
17
-    const STATUS_POLICY_WRONGPOLICYKEY = 5;
18
-    
19
-    const REMOTEWIPE_REQUESTED = 1;
20
-    const REMOTEWIPE_CONFIRMED = 2;
21
-    
22
+
23
+    public const POLICYTYPE_WBXML = 'MS-EAS-Provisioning-WBXML';
24
+
25
+    public const STATUS_SUCCESS                   = 1;
26
+    public const STATUS_PROTOCOL_ERROR            = 2;
27
+    public const STATUS_GENERAL_SERVER_ERROR      = 3;
28
+    public const STATUS_DEVICE_MANAGED_EXTERNALLY = 4;
29
+
30
+    public const STATUS_POLICY_SUCCESS        = 1;
31
+    public const STATUS_POLICY_NOPOLICY       = 2;
32
+    public const STATUS_POLICY_UNKNOWNTYPE    = 3;
33
+    public const STATUS_POLICY_CORRUPTED      = 4;
34
+    public const STATUS_POLICY_WRONGPOLICYKEY = 5;
35
+
36
+    public const REMOTEWIPE_REQUESTED = 1;
37
+    public const REMOTEWIPE_CONFIRMED = 2;
38
+
39
     protected $_skipValidatePolicyKey = true;
40
-    
41
+
42
     protected $_policyType;
43
     protected $_sendPolicyKey;
44
-    
45
+
46
     /**
47
      * @var Syncroton_Model_DeviceInformation
48
      */
49
     protected $_deviceInformation;
50
-    
51
+
52
     /**
53
-     * process the XML file and add, change, delete or fetches data 
54
-     *
55
-     * @return resource
56
+     * process the XML file and add, change, delete or fetches data
57
      */
58
     public function handle()
59
     {
60
         $xml = simplexml_import_dom($this->_requestBody);
61
-        
62
+
63
         $this->_policyType     = isset($xml->Policies->Policy->PolicyType) ? (string) $xml->Policies->Policy->PolicyType : null;
64
-        $this->_sendPolicyKey  = isset($xml->Policies->Policy->PolicyKey)  ? (int) $xml->Policies->Policy->PolicyKey     : null;
65
-        
66
+        $this->_sendPolicyKey  = isset($xml->Policies->Policy->PolicyKey) ? (int) $xml->Policies->Policy->PolicyKey : null;
67
+
68
         if ($this->_device->remotewipe == self::REMOTEWIPE_REQUESTED && isset($xml->RemoteWipe->Status) && (int)$xml->RemoteWipe->Status == self::STATUS_SUCCESS) {
69
             $this->_device->remotewipe = self::REMOTEWIPE_CONFIRMED;
70
         }
71
-        
72
-        // try to fetch element from Settings namespace
73
+
74
+        // try to fetch element from Settings namespace
75
         $settings = $xml->children('uri:Settings');
76
         if (isset($settings->DeviceInformation) && isset($settings->DeviceInformation->Set)) {
77
             $this->_deviceInformation = new Syncroton_Model_DeviceInformation($settings->DeviceInformation->Set);
78
-            
79
-            $this->_device->model           = $this->_deviceInformation->model;
80
-            $this->_device->imei            = $this->_deviceInformation->iMEI;
81
-            $this->_device->friendlyname    = $this->_deviceInformation->friendlyName;
82
-            $this->_device->os              = $this->_deviceInformation->oS;
83
-            $this->_device->oslanguage      = $this->_deviceInformation->oSLanguage;
84
-            $this->_device->phonenumber     = $this->_deviceInformation->phoneNumber;
85
+
86
+            $this->_device->model           = $this->_deviceInformation->model;
87
+            $this->_device->imei            = $this->_deviceInformation->iMEI;
88
+            $this->_device->friendlyname    = $this->_deviceInformation->friendlyName;
89
+            $this->_device->os              = $this->_deviceInformation->oS;
90
+            $this->_device->oslanguage      = $this->_deviceInformation->oSLanguage;
91
+            $this->_device->phonenumber     = $this->_deviceInformation->phoneNumber;
92
         }
93
 
94
         if ($this->_device->isDirty()) {
95
-            $this->_device = $this->_deviceBackend->update($this->_device);
96
+            $this->_device = $this->_deviceBackend->update($this->_device); // @phpstan-ignore-line
97
         }
98
     }
99
-    
100
+
101
     /**
102
      * generate search command response
103
      *
104
@@ -87,27 +85,28 @@
105
     public function getResponse()
106
     {
107
         $this->_outputDom->documentElement->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:Settings', 'uri:Settings');
108
-        
109
+
110
         // should we wipe the device
111
         if ($this->_device->remotewipe >= self::REMOTEWIPE_REQUESTED) {
112
             $this->_sendRemoteWipe();
113
         } else {
114
-            if ($this->_logger instanceof Zend_Log) 
115
+            if ($this->_logger instanceof Zend_Log) {
116
                 $this->_logger->debug(__METHOD__ . '::' . __LINE__ . ' PolicyType: ' . $this->_policyType . ' PolicyKey: ' . $this->_sendPolicyKey);
117
-            
118
+            }
119
+
120
             if (!$this->_sendPolicyKey) {
121
                 $this->_sendPolicy();
122
             } elseif ($this->_sendPolicyKey == $this->_device->policykey) {
123
                 $this->_acknowledgePolicy();
124
-            }       
125
-        } 
126
-            
127
+            }
128
+        }
129
+
130
         return $this->_outputDom;
131
     }
132
-    
133
+
134
     /**
135
      * function the send policy to client
136
-     * 
137
+     *
138
      * 4131 (Enforce password on device) 0: enabled 1: disabled
139
      * 4133 (Unlock from computer) 0: disabled 1: enabled
140
      * AEFrequencyType 0: no inactivity time 1: inactivity time is set
141
@@ -120,9 +119,10 @@
142
      */
143
     protected function _sendPolicy()
144
     {
145
-        if ($this->_logger instanceof Zend_Log) 
146
+        if ($this->_logger instanceof Zend_Log) {
147
             $this->_logger->info(__METHOD__ . '::' . __LINE__ . ' send policy to device');
148
-        
149
+        }
150
+
151
         $provision = $sync = $this->_outputDom->documentElement;
152
         $provision->appendChild($this->_outputDom->createElementNS('uri:Provision', 'Status', 1));
153
 
154
@@ -131,61 +131,65 @@
155
             $deviceInformation = $provision->appendChild($this->_outputDom->createElementNS('uri:Settings', 'DeviceInformation'));
156
             $deviceInformation->appendChild($this->_outputDom->createElementNS('uri:Settings', 'Status', 1));
157
         }
158
-        
159
+
160
         // policies
161
         $policies = $provision->appendChild($this->_outputDom->createElementNS('uri:Provision', 'Policies'));
162
         $policy = $policies->appendChild($this->_outputDom->createElementNS('uri:Provision', 'Policy'));
163
         $policy->appendChild($this->_outputDom->createElementNS('uri:Provision', 'PolicyType', $this->_policyType));
164
-        
165
+
166
         if ($this->_policyType != self::POLICYTYPE_WBXML) {
167
             $policy->appendChild($this->_outputDom->createElementNS('uri:Provision', 'Status', self::STATUS_POLICY_UNKNOWNTYPE));
168
         } elseif (empty($this->_device->policyId)) {
169
             $policy->appendChild($this->_outputDom->createElementNS('uri:Provision', 'Status', self::STATUS_POLICY_NOPOLICY));
170
         } else {
171
             $this->_device->policykey = $this->generatePolicyKey();
172
-            
173
+
174
             $policy->appendChild($this->_outputDom->createElementNS('uri:Provision', 'Status', self::STATUS_POLICY_SUCCESS));
175
             $policy->appendChild($this->_outputDom->createElementNS('uri:Provision', 'PolicyKey', $this->_device->policykey));
176
-            
177
+
178
             $data = $policy->appendChild($this->_outputDom->createElementNS('uri:Provision', 'Data'));
179
             $easProvisionDoc = $data->appendChild($this->_outputDom->createElementNS('uri:Provision', 'EASProvisionDoc'));
180
-            $this->_policyBackend
181
-                ->get($this->_device->policyId)
182
-                ->appendXML($easProvisionDoc, $this->_device);
183
-            
184
+
185
+            /** @var Syncroton_Model_Policy $_policy */
186
+            $_policy = $this->_policyBackend->get($this->_device->policyId);
187
+            $_policy->appendXML($easProvisionDoc, $this->_device);
188
+
189
             $this->_deviceBackend->update($this->_device);
190
         }
191
     }
192
-    
193
+
194
     /**
195
      * function the send remote wipe command
196
      */
197
     protected function _sendRemoteWipe()
198
     {
199
-        if ($this->_logger instanceof Zend_Log) 
200
+        if ($this->_logger instanceof Zend_Log) {
201
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Command/Search.php Changed
59
 
1
@@ -17,8 +17,8 @@
2
  */
3
 class Syncroton_Command_Search extends Syncroton_Command_Wbxml
4
 {
5
-    const STATUS_SUCCESS      = 1;
6
-    const STATUS_SERVER_ERROR = 3;
7
+    public const STATUS_SUCCESS      = 1;
8
+    public const STATUS_SERVER_ERROR = 3;
9
 
10
     protected $_defaultNameSpace    = 'uri:Search';
11
     protected $_documentElement     = 'Search';
12
@@ -39,7 +39,8 @@
13
     {
14
         if (! $this->_requestBody instanceof DOMDocument) {
15
             throw new Syncroton_Exception_UnexpectedValue(
16
-                'request body is no DOMDocument. got: ' . print_r($this->_requestBody, true));
17
+                'request body is no DOMDocument. got: ' . print_r($this->_requestBody, true)
18
+            );
19
         }
20
 
21
         $xml = simplexml_import_dom($this->_requestBody);
22
@@ -54,24 +55,26 @@
23
     public function getResponse()
24
     {
25
         $dataController = Syncroton_Data_Factory::factory($this->_store->name, $this->_device, new DateTime());
26
-        
27
-        if (! $dataController instanceof Syncroton_Data_IDataSearch) {
28
-            throw new RuntimeException('class must be instanceof Syncroton_Data_IDataSearch');
29
+
30
+        if (! $dataController instanceof Syncroton_Data_IDataSearch) {
31
+            throw new RuntimeException('class must be instanceof Syncroton_Data_IDataSearch');
32
         }
33
-        
34
+
35
         try {
36
             // Search
37
             $storeResponse = $dataController->search($this->_store);
38
             $storeResponse->status = self::STATUS_SUCCESS;
39
         } catch (Exception $e) {
40
-            if ($this->_logger instanceof Zend_Log)
41
+            if ($this->_logger instanceof Zend_Log) {
42
                 $this->_logger->debug(__METHOD__ . '::' . __LINE__ . " search exception: " . $e->getMessage());
43
-            if ($this->_logger instanceof Zend_Log)
44
+            }
45
+            if ($this->_logger instanceof Zend_Log) {
46
                 $this->_logger->debug(__METHOD__ . '::' . __LINE__ . " saerch exception trace : " . $e->getTraceAsString());
47
-            
48
-            $storeResponse = new Syncroton_Model_StoreResponse(array(
49
-               'status' => self::STATUS_SERVER_ERROR
50
-            ));
51
+            }
52
+
53
+            $storeResponse = new Syncroton_Model_StoreResponse(
54
+               'status' => self::STATUS_SERVER_ERROR,
55
+            );
56
         }
57
 
58
         $search = $this->_outputDom->documentElement;
59
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Command/SendMail.php Changed
88
 
1
@@ -38,35 +38,36 @@
2
             $this->_saveInSent    = $this->_requestParameters'saveInSent';
3
             $this->_replaceMime   = false;
4
 
5
-            $this->_source = array(
6
+            $this->_source = 
7
                 'collectionId' => $this->_requestParameters'collectionId',
8
                 'itemId'       => $this->_requestParameters'itemId',
9
-                'instanceId'   => null
10
-            );
11
+                'instanceId'   => null,
12
+            ;
13
 
14
-        } else if ($this->_requestBody) {
15
+        } elseif ($this->_requestBody) {
16
             $xml = simplexml_import_dom($this->_requestBody);
17
 
18
             $this->_mime          = (string) $xml->Mime;
19
             $this->_saveInSent    = isset($xml->SaveInSentItems);
20
             $this->_replaceMime   = isset($xml->ReplaceMime);
21
 
22
-            if (isset ($xml->Source)) {
23
+            if (isset($xml->Source)) {
24
                 if ($xml->Source->LongId) {
25
                     $this->_source = (string)$xml->Source->LongId;
26
                 } else {
27
-                    $this->_source = array(
28
+                    $this->_source = 
29
                         'collectionId' => (string)$xml->Source->FolderId,
30
                         'itemId'       => (string)$xml->Source->ItemId,
31
-                        'instanceId'   => isset($xml->Source->InstanceId) ? (string)$xml->Source->InstanceId : null
32
-                    );
33
+                        'instanceId'   => isset($xml->Source->InstanceId) ? (string)$xml->Source->InstanceId : null,
34
+                    ;
35
                 }
36
             }
37
         }
38
 
39
         if (empty($this->_mime)) {
40
-            if ($this->_logger instanceof Zend_Log)
41
+            if ($this->_logger instanceof Zend_Log) {
42
                 $this->_logger->warn(__METHOD__ . '::' . __LINE__ . " Sending email failed: Empty input");
43
+            }
44
 
45
 
46
             if (version_compare($this->_device->acsversion, '14.0', '<')) {
47
@@ -75,9 +76,9 @@
48
             }
49
 
50
             $response_type = 'Syncroton_Model_' . $this->_documentElement;
51
-            $response      = new $response_type(array(
52
+            $response      = new $response_type(
53
                 'status' => Syncroton_Exception_Status::INVALID_CONTENT,
54
-            ));
55
+            );
56
 
57
             $response->appendXML($this->_outputDom->documentElement, $this->_device);
58
 
59
@@ -85,8 +86,9 @@
60
         }
61
 
62
 
63
-        if ($this->_logger instanceof Zend_Log)
64
+        if ($this->_logger instanceof Zend_Log) {
65
             $this->_logger->debug(__METHOD__ . '::' . __LINE__ . " saveInSent: " . (int)$this->_saveInSent);
66
+        }
67
     }
68
 
69
     /**
70
@@ -101,13 +103,14 @@
71
         try {
72
             $this->sendMail($dataController);
73
         } catch (Syncroton_Exception_Status $ses) {
74
-            if ($this->_logger instanceof Zend_Log)
75
+            if ($this->_logger instanceof Zend_Log) {
76
                 $this->_logger->warn(__METHOD__ . '::' . __LINE__ . " Sending email failed: " . $ses->getMessage());
77
+            }
78
 
79
             $response_type = 'Syncroton_Model_' . $this->_documentElement;
80
-            $response      = new $response_type(array(
81
+            $response      = new $response_type(
82
                 'status' => $ses->getCode(),
83
-            ));
84
+            );
85
 
86
             $response->appendXML($this->_outputDom->documentElement, $this->_device);
87
 
88
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Command/Settings.php Changed
134
 
1
@@ -15,13 +15,13 @@
2
  * @package     Syncroton
3
  * @subpackage  Command
4
  */
5
-class Syncroton_Command_Settings extends Syncroton_Command_Wbxml 
6
+class Syncroton_Command_Settings extends Syncroton_Command_Wbxml
7
 {
8
-    const STATUS_SUCCESS = 1;
9
-    
10
+    public const STATUS_SUCCESS = 1;
11
+
12
     protected $_defaultNameSpace = 'uri:Settings';
13
     protected $_documentElement  = 'Settings';
14
-    
15
+
16
     /**
17
      * @var Syncroton_Model_DeviceInformation
18
      */
19
@@ -30,44 +30,45 @@
20
     protected $_userInformationRequested = false;
21
     protected $_OofGet;
22
     protected $_OofSet;
23
-    
24
-    
25
+
26
+
27
     /**
28
-     * process the XML file and add, change, delete or fetches data 
29
+     * process the XML file and add, change, delete or fetches data
30
      *
31
      */
32
     public function handle()
33
     {
34
         $xml = simplexml_import_dom($this->_requestBody);
35
-        
36
-        if(isset($xml->DeviceInformation->Set)) {
37
-            $this->_deviceInformation = new Syncroton_Model_DeviceInformation($xml->DeviceInformation->Set);
38
-            
39
-            $this->_device->model           = $this->_deviceInformation->model;
40
-            $this->_device->imei            = $this->_deviceInformation->iMEI;
41
-            $this->_device->friendlyname    = $this->_deviceInformation->friendlyName;
42
-            $this->_device->os              = $this->_deviceInformation->oS;
43
-            $this->_device->oslanguage      = $this->_deviceInformation->oSLanguage;
44
-            $this->_device->phonenumber     = $this->_deviceInformation->phoneNumber;
45
+
46
+        if (isset($xml->DeviceInformation->Set)) {
47
+            $this->_deviceInformation = new Syncroton_Model_DeviceInformation($xml->DeviceInformation->Set);
48
+
49
+            $this->_device->model           = $this->_deviceInformation->model;
50
+            $this->_device->imei            = $this->_deviceInformation->iMEI;
51
+            $this->_device->friendlyname    = $this->_deviceInformation->friendlyName;
52
+            $this->_device->os              = $this->_deviceInformation->oS;
53
+            $this->_device->oslanguage      = $this->_deviceInformation->oSLanguage;
54
+            $this->_device->phonenumber     = $this->_deviceInformation->phoneNumber;
55
 
56
             if ($this->_device->isDirty()) {
57
+                // @phpstan-ignore-next-line
58
                 $this->_device = $this->_deviceBackend->update($this->_device);
59
             }
60
         }
61
-        
62
-        if(isset($xml->UserInformation->Get)) {
63
+
64
+        if (isset($xml->UserInformation->Get)) {
65
             $this->_userInformationRequested = true;
66
         }
67
 
68
         if (isset($xml->Oof)) {
69
             if (isset($xml->Oof->Get)) {
70
-                $this->_OofGet = array('bodyType' => $xml->Oof->Get->BodyType);
71
-            } else if (isset($xml->Oof->Set)) {
72
+                $this->_OofGet = 'bodyType' => $xml->Oof->Get->BodyType;
73
+            } elseif (isset($xml->Oof->Set)) {
74
                 $this->_OofSet = new Syncroton_Model_Oof($xml->Oof->Set);
75
             }
76
         }
77
     }
78
-    
79
+
80
     /**
81
      * this function generates the response for the client
82
      *
83
@@ -75,29 +76,29 @@
84
     public function getResponse()
85
     {
86
         $settings = $this->_outputDom->documentElement;
87
-        
88
+
89
         $settings->appendChild($this->_outputDom->createElementNS('uri:Settings', 'Status', self::STATUS_SUCCESS));
90
-        
91
+
92
         if ($this->_deviceInformation instanceof Syncroton_Model_DeviceInformation) {
93
             $deviceInformation = $settings->appendChild($this->_outputDom->createElementNS('uri:Settings', 'DeviceInformation'));
94
             $set = $deviceInformation->appendChild($this->_outputDom->createElementNS('uri:Settings', 'Set'));
95
             $set->appendChild($this->_outputDom->createElementNS('uri:Settings', 'Status', self::STATUS_SUCCESS));
96
         }
97
-        
98
+
99
         if ($this->_userInformationRequested === true) {
100
             $userInformation = $settings->appendChild($this->_outputDom->createElementNS('uri:Settings', 'UserInformation'));
101
             $userInformation->appendChild($this->_outputDom->createElementNS('uri:Settings', 'Status', self::STATUS_SUCCESS));
102
 
103
             $get = $userInformation->appendChild($this->_outputDom->createElementNS('uri:Settings', 'Get'));
104
-/*
105
-            $smtpAddresses = array();
106
-            if (!empty($smtpAddresses)) {
107
-                $emailAddresses = $get->appendChild($this->_outputDom->createElementNS('uri:Settings', 'EmailAddresses'));
108
-                foreach($smtpAddresses as $smtpAddress) {
109
-                    $emailAddresses->appendChild($this->_outputDom->createElementNS('uri:Settings', 'SMTPAddress', $smtpAddress));
110
-                }
111
-            }
112
-*/
113
+            /*
114
+                        $smtpAddresses = array();
115
+                        if (!empty($smtpAddresses)) {
116
+                            $emailAddresses = $get->appendChild($this->_outputDom->createElementNS('uri:Settings', 'EmailAddresses'));
117
+                            foreach($smtpAddresses as $smtpAddress) {
118
+                                $emailAddresses->appendChild($this->_outputDom->createElementNS('uri:Settings', 'SMTPAddress', $smtpAddress));
119
+                            }
120
+                        }
121
+            */
122
             $userAccounts = $this->_deviceBackend->userAccounts($this->_device);
123
             if (!empty($userAccounts)) {
124
                 $accounts = $get->appendChild($this->_outputDom->createElementNS('uri:Settings', 'Accounts'));
125
@@ -133,7 +134,7 @@
126
                 $Get = $Oof->appendChild($this->_outputDom->createElementNS('uri:Settings', 'Get'));
127
                 $OofGet->appendXML($Get, $this->_device);
128
             }
129
-        } else if (!empty($this->_OofSet)) {
130
+        } elseif (!empty($this->_OofSet)) {
131
             try {
132
                 $this->_deviceBackend->setOOF($this->_OofSet);
133
                 $OofStatus = self::STATUS_SUCCESS;
134
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Command/Sync.php Changed
201
 
1
@@ -15,82 +15,82 @@
2
  * @package     Syncroton
3
  * @subpackage  Command
4
  */
5
-class Syncroton_Command_Sync extends Syncroton_Command_Wbxml 
6
+class Syncroton_Command_Sync extends Syncroton_Command_Wbxml
7
 {
8
-    const STATUS_SUCCESS                                = 1;
9
-    const STATUS_PROTOCOL_VERSION_MISMATCH              = 2;
10
-    const STATUS_INVALID_SYNC_KEY                       = 3;
11
-    const STATUS_PROTOCOL_ERROR                         = 4;
12
-    const STATUS_SERVER_ERROR                           = 5;
13
-    const STATUS_ERROR_IN_CLIENT_SERVER_CONVERSION      = 6;
14
-    const STATUS_CONFLICT_MATCHING_THE_CLIENT_AND_SERVER_OBJECT = 7;
15
-    const STATUS_OBJECT_NOT_FOUND                       = 8;
16
-    const STATUS_USER_ACCOUNT_MAYBE_OUT_OF_DISK_SPACE   = 9;
17
-    const STATUS_ERROR_SETTING_NOTIFICATION_GUID        = 10;
18
-    const STATUS_DEVICE_NOT_PROVISIONED_FOR_NOTIFICATIONS = 11;
19
-    const STATUS_FOLDER_HIERARCHY_HAS_CHANGED           = 12;
20
-    const STATUS_RESEND_FULL_XML                        = 13;
21
-    const STATUS_WAIT_INTERVAL_OUT_OF_RANGE             = 14;
22
-    const STATUS_TOO_MANY_COLLECTIONS                   = 15;
23
-    
24
-    const CONFLICT_OVERWRITE_SERVER                     = 0;
25
-    const CONFLICT_OVERWRITE_PIM                        = 1;
26
-    
27
-    const MIMESUPPORT_DONT_SEND_MIME                    = 0;
28
-    const MIMESUPPORT_SMIME_ONLY                        = 1;
29
-    const MIMESUPPORT_SEND_MIME                         = 2;
30
-    
31
-    const BODY_TYPE_PLAIN_TEXT                          = 1;
32
-    const BODY_TYPE_HTML                                = 2;
33
-    const BODY_TYPE_RTF                                 = 3;
34
-    const BODY_TYPE_MIME                                = 4;
35
-    
36
+    public const STATUS_SUCCESS                                = 1;
37
+    public const STATUS_PROTOCOL_VERSION_MISMATCH              = 2;
38
+    public const STATUS_INVALID_SYNC_KEY                       = 3;
39
+    public const STATUS_PROTOCOL_ERROR                         = 4;
40
+    public const STATUS_SERVER_ERROR                           = 5;
41
+    public const STATUS_ERROR_IN_CLIENT_SERVER_CONVERSION      = 6;
42
+    public const STATUS_CONFLICT_MATCHING_THE_CLIENT_AND_SERVER_OBJECT = 7;
43
+    public const STATUS_OBJECT_NOT_FOUND                       = 8;
44
+    public const STATUS_USER_ACCOUNT_MAYBE_OUT_OF_DISK_SPACE   = 9;
45
+    public const STATUS_ERROR_SETTING_NOTIFICATION_GUID        = 10;
46
+    public const STATUS_DEVICE_NOT_PROVISIONED_FOR_NOTIFICATIONS = 11;
47
+    public const STATUS_FOLDER_HIERARCHY_HAS_CHANGED           = 12;
48
+    public const STATUS_RESEND_FULL_XML                        = 13;
49
+    public const STATUS_WAIT_INTERVAL_OUT_OF_RANGE             = 14;
50
+    public const STATUS_TOO_MANY_COLLECTIONS                   = 15;
51
+
52
+    public const CONFLICT_OVERWRITE_SERVER                     = 0;
53
+    public const CONFLICT_OVERWRITE_PIM                        = 1;
54
+
55
+    public const MIMESUPPORT_DONT_SEND_MIME                    = 0;
56
+    public const MIMESUPPORT_SMIME_ONLY                        = 1;
57
+    public const MIMESUPPORT_SEND_MIME                         = 2;
58
+
59
+    public const BODY_TYPE_PLAIN_TEXT                          = 1;
60
+    public const BODY_TYPE_HTML                                = 2;
61
+    public const BODY_TYPE_RTF                                 = 3;
62
+    public const BODY_TYPE_MIME                                = 4;
63
+
64
     /**
65
      * truncate types
66
      */
67
-    const TRUNCATE_ALL                                  = 0;
68
-    const TRUNCATE_4096                                 = 1;
69
-    const TRUNCATE_5120                                 = 2;
70
-    const TRUNCATE_7168                                 = 3;
71
-    const TRUNCATE_10240                                = 4;
72
-    const TRUNCATE_20480                                = 5;
73
-    const TRUNCATE_51200                                = 6;
74
-    const TRUNCATE_102400                               = 7;
75
-    const TRUNCATE_NOTHING                              = 8;
76
-    
77
+    public const TRUNCATE_ALL                                  = 0;
78
+    public const TRUNCATE_4096                                 = 1;
79
+    public const TRUNCATE_5120                                 = 2;
80
+    public const TRUNCATE_7168                                 = 3;
81
+    public const TRUNCATE_10240                                = 4;
82
+    public const TRUNCATE_20480                                = 5;
83
+    public const TRUNCATE_51200                                = 6;
84
+    public const TRUNCATE_102400                               = 7;
85
+    public const TRUNCATE_NOTHING                              = 8;
86
+
87
     /**
88
      * filter types
89
      */
90
-    const FILTER_NOTHING        = 0;
91
-    const FILTER_1_DAY_BACK     = 1;
92
-    const FILTER_3_DAYS_BACK    = 2;
93
-    const FILTER_1_WEEK_BACK    = 3;
94
-    const FILTER_2_WEEKS_BACK   = 4;
95
-    const FILTER_1_MONTH_BACK   = 5;
96
-    const FILTER_3_MONTHS_BACK  = 6;
97
-    const FILTER_6_MONTHS_BACK  = 7;
98
-    const FILTER_INCOMPLETE     = 8;
99
-    
100
-    
101
+    public const FILTER_NOTHING        = 0;
102
+    public const FILTER_1_DAY_BACK     = 1;
103
+    public const FILTER_3_DAYS_BACK    = 2;
104
+    public const FILTER_1_WEEK_BACK    = 3;
105
+    public const FILTER_2_WEEKS_BACK   = 4;
106
+    public const FILTER_1_MONTH_BACK   = 5;
107
+    public const FILTER_3_MONTHS_BACK  = 6;
108
+    public const FILTER_6_MONTHS_BACK  = 7;
109
+    public const FILTER_INCOMPLETE     = 8;
110
+
111
+
112
     protected $_defaultNameSpace    = 'uri:AirSync';
113
     protected $_documentElement     = 'Sync';
114
-    
115
+
116
     /**
117
      * list of collections
118
      *
119
-     * @var array
120
+     * @var array<string,Syncroton_Model_SyncCollection>
121
      */
122
-    protected $_collections = array();
123
-    
124
-    protected $_modifications = array();
125
-    
126
+    protected $_collections = ;
127
+
128
+    protected $_modifications = ;
129
+
130
     /**
131
      * the global WindowSize
132
      *
133
      * @var integer
134
      */
135
     protected $_globalWindowSize;
136
-    
137
+
138
     /**
139
      * there are more entries than WindowSize available
140
      * the MoreAvailable tag hot added to the xml output
141
@@ -98,64 +98,65 @@
142
      * @var boolean
143
      */
144
     protected $_moreAvailable = false;
145
-    
146
+
147
     protected $_maxWindowSize = 100;
148
-    
149
+
150
     protected $_heartbeatInterval = null;
151
-    
152
+
153
     /**
154
-     * process the XML file and add, change, delete or fetches data 
155
+     * process the XML file and add, change, delete or fetches data
156
      */
157
     public function handle()
158
     {
159
         // input xml
160
         $requestXML = simplexml_import_dom($this->_mergeSyncRequest($this->_requestBody, $this->_device));
161
-        
162
+
163
         if (! isset($requestXML->Collections)) {
164
             $this->_outputDom->documentElement->appendChild(
165
                 $this->_outputDom->createElementNS('uri:AirSync', 'Status', self::STATUS_RESEND_FULL_XML)
166
             );
167
-            
168
+
169
             return $this->_outputDom;
170
         }
171
-        
172
+
173
+        $intervalDiv = 1;
174
         if (isset($requestXML->HeartbeatInterval)) {
175
             $intervalDiv = 1;
176
             $this->_heartbeatInterval = (int)$requestXML->HeartbeatInterval;
177
-        } else if (isset($requestXML->Wait)) {
178
+        } elseif (isset($requestXML->Wait)) {
179
             $intervalDiv = 60;
180
             $this->_heartbeatInterval = (int)$requestXML->Wait * $intervalDiv;
181
         }
182
-        
183
+
184
         $maxInterval = Syncroton_Registry::getPingInterval();
185
         if ($maxInterval <= 0 || $maxInterval > Syncroton_Server::MAX_HEARTBEAT_INTERVAL) {
186
             $maxInterval = Syncroton_Server::MAX_HEARTBEAT_INTERVAL;
187
         }
188
-        
189
+
190
         if ($this->_heartbeatInterval && $this->_heartbeatInterval > $maxInterval) {
191
             $sync = $this->_outputDom->documentElement;
192
             $sync->appendChild($this->_outputDom->createElementNS('uri:AirSync', 'Status', self::STATUS_WAIT_INTERVAL_OUT_OF_RANGE));
193
-            $sync->appendChild($this->_outputDom->createElementNS('uri:AirSync', 'Limit', floor($maxInterval/$intervalDiv)));
194
+            $sync->appendChild($this->_outputDom->createElementNS('uri:AirSync', 'Limit', floor($maxInterval / $intervalDiv)));
195
             $this->_heartbeatInterval = null;
196
             return;
197
         }
198
-        
199
+
200
         $this->_globalWindowSize = isset($requestXML->WindowSize) ? (int)$requestXML->WindowSize : 100;
201
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Command/Wbxml.php Changed
201
 
1
@@ -15,122 +15,121 @@
2
  * @package     Syncroton
3
  * @subpackage  Command
4
  */
5
- 
6
+
7
 abstract class Syncroton_Command_Wbxml implements Syncroton_Command_ICommand
8
 {
9
     /**
10
      * informations about the currently device
11
      *
12
-     * @var Syncroton_Model_Device
13
+     * @var Syncroton_Model_IDevice
14
      */
15
     protected $_device;
16
-    
17
+
18
     /**
19
      * informations about the currently device
20
      *
21
      * @var Syncroton_Backend_IDevice
22
      */
23
     protected $_deviceBackend;
24
-    
25
+
26
     /**
27
      * informations about the currently device
28
      *
29
      * @var Syncroton_Backend_IFolder
30
      */
31
     protected $_folderBackend;
32
-    
33
+
34
     /**
35
      * @var Syncroton_Backend_ISyncState
36
      */
37
     protected $_syncStateBackend;
38
-    
39
+
40
     /**
41
      * @var Syncroton_Backend_IContent
42
      */
43
     protected $_contentStateBackend;
44
-    
45
+
46
     /**
47
-     * 
48
-     * @var Syncroton_Backend_IPolicy
49
+     * @var Syncroton_Backend_Policy
50
      */
51
     protected $_policyBackend;
52
-    
53
+
54
     /**
55
      * the domDocument containing the xml response from the server
56
      *
57
      * @var DOMDocument
58
      */
59
     protected $_outputDom;
60
-    
61
+
62
     /**
63
      * the domDocucment containing the xml request from the client
64
      *
65
      * @var DOMDocument
66
      */
67
     protected $_requestBody;
68
-    
69
+
70
     /**
71
      * the default namespace
72
      *
73
-     * @var string
74
+     * @var ?string
75
      */
76
     protected $_defaultNameSpace;
77
-    
78
+
79
     /**
80
      * the main xml tag
81
      *
82
-     * @var string
83
+     * @var ?string
84
      */
85
     protected $_documentElement;
86
-    
87
+
88
     /**
89
      * @var array
90
      */
91
     protected $_requestParameters;
92
-    
93
+
94
     /**
95
      * @var Syncroton_Model_SyncState
96
      */
97
     protected $_syncState;
98
-    
99
+
100
     protected $_skipValidatePolicyKey = false;
101
-    
102
+
103
     /**
104
      * timestamp to use for all sync requests
105
      *
106
      * @var DateTime
107
      */
108
     protected $_syncTimeStamp;
109
-    
110
+
111
     /**
112
      * @var string
113
      */
114
     protected $_transactionId;
115
-    
116
+
117
     /**
118
      * @var string
119
      */
120
     protected $_policyKey;
121
-    
122
+
123
     /**
124
      * @var Zend_Log
125
      */
126
     protected $_logger;
127
-    
128
+
129
     /**
130
      * list of part streams
131
-     * 
132
+     *
133
      * @var array
134
      */
135
-    protected $_parts = array();
136
-    
137
+    protected $_parts = ;
138
+
139
     /**
140
      * list of headers
141
-     * 
142
+     *
143
      * @var array
144
      */
145
-    protected $_headers = array();
146
-    
147
+    protected $_headers = ;
148
+
149
     /**
150
      * the constructor
151
      *
152
@@ -138,12 +137,12 @@
153
      * @param  Syncroton_Model_Device  $device
154
      * @param  array                   $requestParameters
155
      */
156
-    public function __construct($requestBody, Syncroton_Model_IDevice $device, $requestParameters)
157
+    public function __construct($requestBody, Syncroton_Model_IDevice $device, $requestParameters = )
158
     {
159
         $this->_requestBody       = $requestBody;
160
         $this->_device            = $device;
161
         $this->_requestParameters = $requestParameters;
162
-        $this->_policyKey         = isset($requestParameters'policyKey') ? $requestParameters'policyKey' : null;
163
+        $this->_policyKey         = $requestParameters'policyKey' ?? null;
164
 
165
         $this->_deviceBackend       = Syncroton_Registry::getDeviceBackend();
166
         $this->_folderBackend       = Syncroton_Registry::getFolderBackend();
167
@@ -153,55 +152,57 @@
168
         if (Syncroton_Registry::isRegistered('loggerBackend')) {
169
             $this->_logger          = Syncroton_Registry::get('loggerBackend');
170
         }
171
-        
172
+
173
         $this->_syncTimeStamp = new DateTime('now', new DateTimeZone('UTC'));
174
-        
175
+
176
         // set default content type
177
         $this->_headers'Content-Type' = 'application/vnd.ms-sync.wbxml';
178
-        
179
-        if ($this->_logger instanceof Zend_Log) 
180
+
181
+        if ($this->_logger instanceof Zend_Log) {
182
             $this->_logger->debug(__METHOD__ . '::' . __LINE__ . " sync timestamp: " . $this->_syncTimeStamp->format('Y-m-d H:i:s'));
183
-        
184
+        }
185
+
186
         if (isset($this->_defaultNameSpace) && isset($this->_documentElement)) {
187
             // Creates an instance of the DOMImplementation class
188
             $imp = new DOMImplementation();
189
-            
190
+
191
             // Creates a DOMDocumentType instance
192
             $dtd = $imp->createDocumentType('AirSync', "-//AIRSYNC//DTD AirSync//EN", "http://www.microsoft.com/");
193
-            
194
+
195
             // Creates a DOMDocument instance
196
             $this->_outputDom = $imp->createDocument($this->_defaultNameSpace, $this->_documentElement, $dtd);
197
             $this->_outputDom->documentElement->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:Syncroton', 'uri:Syncroton');
198
             $this->_outputDom->formatOutput = false;
199
             $this->_outputDom->encoding     = 'utf-8';
200
         }
201
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Data/AData.php Changed
201
 
1
@@ -17,16 +17,30 @@
2
  */
3
 abstract class Syncroton_Data_AData implements Syncroton_Data_IData
4
 {
5
-    const LONGID_DELIMITER = "\xe2\x87\x94"; # UTF-8 character ⇔
6
-    
7
-    /**
8
-     * @var DateTime
9
-     */
10
+    public const LONGID_DELIMITER = "\xe2\x87\x94"; // UTF-8 character ⇔
11
+
12
+    /** @var DateTime */
13
     protected $_timeStamp;
14
-    
15
+
16
+    /** @var Syncroton_Model_IDevice */
17
+    protected $_device;
18
+
19
+    /** @var Zend_Db_Adapter_Abstract */
20
+    protected $_db;
21
+
22
+    /** @var string */
23
+    protected $_tablePrefix;
24
+
25
+    /** @var string */
26
+    protected $_ownerId;
27
+
28
+    /** @var array */
29
+    protected $_supportedFolderTypes = ;
30
+
31
+
32
     /**
33
      * the constructor
34
-     * 
35
+     *
36
      * @param Syncroton_Model_IDevice $_device
37
      * @param DateTime $_timeStamp
38
      */
39
@@ -38,10 +52,10 @@
40
         $this->_tablePrefix = 'Syncroton_';
41
         $this->_ownerId     = '1234';
42
     }
43
-    
44
+
45
     /**
46
      * return one folder identified by id
47
-     * 
48
+     *
49
      * @param  string  $id
50
      * @throws Syncroton_Exception_NotFound
51
      * @return Syncroton_Model_Folder
52
@@ -52,23 +66,23 @@
53
             ->from($this->_tablePrefix . 'data_folder')
54
             ->where('owner_id = ?', $this->_ownerId)
55
             ->where('id = ?', $id);
56
-        
57
+
58
         $stmt   = $this->_db->query($select);
59
         $folder = $stmt->fetch();
60
         $stmt = null; # see https://bugs.php.net/bug.php?id=44081
61
-        
62
+
63
         if ($folder === false) {
64
             throw new Syncroton_Exception_NotFound("folder $id not found");
65
         }
66
-        
67
-        return new Syncroton_Model_Folder(array(
68
+
69
+        return new Syncroton_Model_Folder(
70
             'serverId'    => $folder'id',
71
             'displayName' => $folder'name',
72
             'type'        => $folder'type',
73
-            'parentId'    => !empty($folder'parent_id') ? $folder'parent_id' : null
74
-        ));
75
+            'parentId'    => !empty($folder'parent_id') ? $folder'parent_id' : null,
76
+        );
77
     }
78
-    
79
+
80
     /**
81
      * (non-PHPdoc)
82
      * @see Syncroton_Data_IData::createFolder()
83
@@ -78,53 +92,53 @@
84
         if (!in_array($folder->type, $this->_supportedFolderTypes)) {
85
             throw new Syncroton_Exception_UnexpectedValue();
86
         }
87
-        
88
-        $id = !empty($folder->serverId) ? $folder->serverId : sha1(mt_rand(). microtime());
89
-        
90
-        $this->_db->insert($this->_tablePrefix . 'data_folder', array(
91
+
92
+        $id = !empty($folder->serverId) ? $folder->serverId : sha1(mt_rand() . microtime());
93
+
94
+        $this->_db->insert($this->_tablePrefix . 'data_folder', 
95
             'id'            => $id,
96
             'type'          => $folder->type,
97
             'name'          => $folder->displayName,
98
             'owner_id'      => $this->_ownerId,
99
             'parent_id'     => $folder->parentId,
100
-            'creation_time' => $this->_timeStamp->format("Y-m-d H:i:s")
101
-        ));
102
-        
103
+            'creation_time' => $this->_timeStamp->format("Y-m-d H:i:s"),
104
+        );
105
+
106
         return $this->getFolder($id);
107
     }
108
-    
109
+
110
     /**
111
      * (non-PHPdoc)
112
      * @see Syncroton_Data_IData::createEntry()
113
      */
114
-    public function createEntry($_folderId, Syncroton_Model_IEntry $_entry)
115
-    {
116
-        $id = sha1(mt_rand(). microtime());
117
-    
118
-        $this->_db->insert($this->_tablePrefix . 'data', array(
119
-            'id'            => $id,
120
+    public function createEntry($_folderId, Syncroton_Model_IEntry $_entry)
121
+    {
122
+        $id = sha1(mt_rand() . microtime());
123
+
124
+        $this->_db->insert($this->_tablePrefix . 'data', 
125
+            'id'            => $id,
126
             'class'         => get_class($_entry),
127
             'folder_id'     => $_folderId,
128
             'creation_time' => $this->_timeStamp->format("Y-m-d H:i:s"),
129
-            'data'          => serialize($_entry)
130
-        ));
131
-    
132
-        return $id;
133
-    }
134
-    
135
+            'data'          => serialize($_entry),
136
+        );
137
+
138
+        return $id;
139
+    }
140
+
141
     /**
142
      * (non-PHPdoc)
143
      * @see Syncroton_Data_IData::deleteEntry()
144
      */
145
-    public function deleteEntry($_folderId, $_serverId, $_collectionData)
146
+    public function deleteEntry($_folderId, $_serverId, $_collectionData = null)
147
     {
148
         $folderId = $_folderId instanceof Syncroton_Model_IFolder ? $_folderId->serverId : $_folderId;
149
-        
150
-        $result = $this->_db->delete($this->_tablePrefix . 'data', array('id = ?' => $_serverId));
151
-        
152
+
153
+        $result = $this->_db->delete($this->_tablePrefix . 'data', 'id = ?' => $_serverId);
154
+
155
         return (bool) $result;
156
     }
157
-    
158
+
159
     /**
160
      * (non-PHPdoc)
161
      * @see Syncroton_Data_IData::deleteFolder()
162
@@ -132,13 +146,13 @@
163
     public function deleteFolder($_folderId)
164
     {
165
         $folderId = $_folderId instanceof Syncroton_Model_IFolder ? $_folderId->serverId : $_folderId;
166
-        
167
-        $result = $this->_db->delete($this->_tablePrefix . 'data', array('folder_id = ?' => $folderId));
168
-        $result = $this->_db->delete($this->_tablePrefix . 'data_folder', array('id = ?' => $folderId));
169
-        
170
+
171
+        $result = $this->_db->delete($this->_tablePrefix . 'data', 'folder_id = ?' => $folderId);
172
+        $result = $this->_db->delete($this->_tablePrefix . 'data_folder', 'id = ?' => $folderId);
173
+
174
         return (bool) $result;
175
     }
176
-    
177
+
178
     /**
179
      * (non-PHPdoc)
180
      * @see Syncroton_Data_IData::emptyFolderContents()
181
@@ -147,7 +161,7 @@
182
     {
183
         return true;
184
     }
185
-    
186
+
187
     /**
188
      * (non-PHPdoc)
189
      * @see Syncroton_Data_IData::getAllFolders()
190
@@ -158,57 +172,52 @@
191
             ->from($this->_tablePrefix . 'data_folder')
192
             ->where('type IN (?)', $this->_supportedFolderTypes)
193
             ->where('owner_id = ?', $this->_ownerId);
194
-        
195
+
196
         $stmt    = $this->_db->query($select);
197
         $folders = $stmt->fetchAll();
198
         $stmt = null; # see https://bugs.php.net/bug.php?id=44081
199
-        
200
-        $result = array();
201
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Data/Calendar.php Changed
32
 
1
@@ -17,20 +17,20 @@
2
  */
3
 class Syncroton_Data_Calendar extends Syncroton_Data_AData implements Syncroton_Data_IDataCalendar
4
 {
5
-    protected $_supportedFolderTypes = array(
6
+    protected $_supportedFolderTypes = 
7
         Syncroton_Command_FolderSync::FOLDERTYPE_CALENDAR,
8
-        Syncroton_Command_FolderSync::FOLDERTYPE_CALENDAR_USER_CREATED
9
-    );
10
-    
11
+        Syncroton_Command_FolderSync::FOLDERTYPE_CALENDAR_USER_CREATED,
12
+    ;
13
+
14
     /**
15
      * set attendee status for meeting
16
-     * 
17
-     * @param  Syncroton_Model_MeetingResponse  $request  the meeting response
18
-     * @return  string  id of new calendar entry
19
+     *
20
+     * @param Syncroton_Model_MeetingResponse $response The meeting response
21
+     *
22
+     * @return string ID of new calendar entry
23
      */
24
-    public function setAttendeeStatus(Syncroton_Model_MeetingResponse $reponse)
25
+    public function setAttendeeStatus(Syncroton_Model_MeetingResponse $response)
26
     {
27
-        return $reponse->requestId;
28
+        return $response->requestId;
29
     }
30
 }
31
-
32
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Data/Contacts.php Changed
101
 
1
@@ -15,31 +15,31 @@
2
  * @package     Syncroton
3
  * @subpackage  Data
4
  */
5
-
6
 class Syncroton_Data_Contacts extends Syncroton_Data_AData implements Syncroton_Data_IDataSearch
7
 {
8
-    protected $_supportedFolderTypes = array(
9
+    protected $_supportedFolderTypes = 
10
         Syncroton_Command_FolderSync::FOLDERTYPE_CONTACT,
11
-        Syncroton_Command_FolderSync::FOLDERTYPE_CONTACT_USER_CREATED
12
-    );
13
-    
14
+        Syncroton_Command_FolderSync::FOLDERTYPE_CONTACT_USER_CREATED,
15
+    ;
16
+
17
     /**
18
      * (non-PHPdoc)
19
      * @see Syncroton_Data_IDataSearch::getSearchEntry()
20
      */
21
     public function getSearchEntry($longId, $options)
22
     {
23
-        list($collectionId, $serverId) = explode(Syncroton_Data_AData::LONGID_DELIMITER, $longId, 2);
24
-        
25
-        $contact = $this->getEntry(new Syncroton_Model_SyncCollection(array('collectionId' => $collectionId)), $serverId);
26
-        
27
-        return new Syncroton_Model_GAL(array(
28
+        $collectionId, $serverId = explode(Syncroton_Data_AData::LONGID_DELIMITER, $longId, 2);
29
+
30
+        /** @var Syncroton_Model_Contact $contact */
31
+        $contact = $this->getEntry(new Syncroton_Model_SyncCollection('collectionId' => $collectionId), $serverId);
32
+
33
+        return new Syncroton_Model_GAL(
34
             'firstName' => $contact->firstName,
35
             'lastName'  => $contact->lastName,
36
-            'picture'   => new Syncroton_Model_GALPicture(array('status' => 1, 'data' => 'abc'))
37
-        ));
38
+            'picture'   => new Syncroton_Model_GALPicture('status' => 1, 'data' => 'abc'),
39
+        );
40
     }
41
-    
42
+
43
     /**
44
      * (non-PHPdoc)
45
      * @see Syncroton_Data_IDataSearch::search()
46
@@ -47,37 +47,37 @@
47
     public function search(Syncroton_Model_StoreRequest $store)
48
     {
49
         $storeResponse = new Syncroton_Model_StoreResponse();
50
-        
51
+
52
         $serverIds = $this->getServerEntries('addressbookFolderId', Syncroton_Command_Sync::FILTER_NOTHING);
53
-        
54
+
55
         $total = 0;
56
-        $found = array();
57
-        
58
+        $found = ;
59
+
60
         foreach ($serverIds as $serverId) {
61
-            $contact = $this->getEntry(new Syncroton_Model_SyncCollection(array('collectionId' => 'addressbookFolderId')), $serverId);
62
-            
63
+            /** @var Syncroton_Model_Contact $contact */
64
+            $contact = $this->getEntry(new Syncroton_Model_SyncCollection('collectionId' => 'addressbookFolderId'), $serverId);
65
+
66
             if ($contact->firstName == $store->query) {
67
                 $total++;
68
-                
69
-                if (count($found) == $store->options'range'1+1) {
70
+
71
+                if (count($found) == $store->options'range'1 + 1) {
72
                     continue;
73
                 }
74
-                $found = new Syncroton_Model_StoreResponseResult(array(
75
-                    'longId' => 'addressbookFolderId' . Syncroton_Data_AData::LONGID_DELIMITER .  $serverId,
76
-                    'properties' => $this->getSearchEntry('addressbookFolderId' . Syncroton_Data_AData::LONGID_DELIMITER .  $serverId, $store->options)
77
-                ));
78
+                $found = new Syncroton_Model_StoreResponseResult(
79
+                    'longId' => 'addressbookFolderId' . Syncroton_Data_AData::LONGID_DELIMITER . $serverId,
80
+                    'properties' => $this->getSearchEntry('addressbookFolderId' . Syncroton_Data_AData::LONGID_DELIMITER . $serverId, $store->options),
81
+                );
82
             }
83
         }
84
-        
85
+
86
         if (count($found) > 0) {
87
             $storeResponse->result = $found;
88
-            $storeResponse->range = array(0, count($found) - 1);
89
+            $storeResponse->range = 0, count($found) - 1;
90
             $storeResponse->total = $total;
91
         } else {
92
-            $storeResponse->total = $total;
93
+            $storeResponse->total = $total;
94
         }
95
-        
96
+
97
         return $storeResponse;
98
     }
99
 }
100
-
101
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Data/Email.php Changed
95
 
1
@@ -17,52 +17,52 @@
2
  */
3
 class Syncroton_Data_Email extends Syncroton_Data_AData implements Syncroton_Data_IDataEmail
4
 {
5
-    protected $_supportedFolderTypes = array(
6
+    protected $_supportedFolderTypes = 
7
         Syncroton_Command_FolderSync::FOLDERTYPE_DELETEDITEMS,
8
         Syncroton_Command_FolderSync::FOLDERTYPE_DRAFTS,
9
         Syncroton_Command_FolderSync::FOLDERTYPE_INBOX,
10
         Syncroton_Command_FolderSync::FOLDERTYPE_MAIL_USER_CREATED,
11
         Syncroton_Command_FolderSync::FOLDERTYPE_OUTBOX,
12
-        Syncroton_Command_FolderSync::FOLDERTYPE_SENTMAIL
13
-    );
14
-    
15
+        Syncroton_Command_FolderSync::FOLDERTYPE_SENTMAIL,
16
+    ;
17
+
18
     /**
19
      * (non-PHPdoc)
20
      * @see Syncroton_Data_IDataEmail::forwardEmail()
21
      */
22
     public function forwardEmail($source, $inputStream, $saveInSent, $replaceMime)
23
     {
24
-        if ($inputStream == 'triggerException') {
25
-            throw new Syncroton_Exception_Status(Syncroton_Exception_Status::MAILBOX_SERVER_OFFLINE);
26
-        }
27
-        
28
+        if ($inputStream == 'triggerException') {
29
+            throw new Syncroton_Exception_Status(Syncroton_Exception_Status::MAILBOX_SERVER_OFFLINE);
30
+        }
31
+
32
         // forward email
33
     }
34
-    
35
+
36
     /**
37
      * (non-PHPdoc)
38
      * @see Syncroton_Data_AData::getFileReference()
39
      */
40
-    public function getFileReference($fileReference)
41
-    {
42
-        list($messageId, $partId) = explode(Syncroton_Data_AData::LONGID_DELIMITER, $fileReference, 2);
43
-    
44
-        // example code
45
-        return new Syncroton_Model_FileReference(array(
46
-            'contentType' => 'text/plain',
47
-            'data'        => 'Lars'
48
-        ));
49
+    public function getFileReference($fileReference)
50
+    {
51
+        $messageId, $partId = explode(Syncroton_Data_AData::LONGID_DELIMITER, $fileReference, 2);
52
+
53
+        // example code
54
+        return new Syncroton_Model_FileReference(
55
+            'contentType' => 'text/plain',
56
+            'data'        => 'Lars',
57
+        );
58
     }
59
-    
60
+
61
     /**
62
      * (non-PHPdoc)
63
      * @see Syncroton_Data_IDataEmail::replyEmail()
64
-     */
65
-    public function replyEmail($source, $inputStream, $saveInSent, $replaceMime)
66
-    {
67
-        // forward email
68
-    }
69
-    
70
+     */
71
+    public function replyEmail($source, $inputStream, $saveInSent, $replaceMime)
72
+    {
73
+        // forward email
74
+    }
75
+
76
     /**
77
      * (non-PHPdoc)
78
      * @see Syncroton_Data_AData::updateEntry()
79
@@ -70,8 +70,9 @@
80
     public function updateEntry($_folderId, $_serverId, Syncroton_Model_IEntry $_entry)
81
     {
82
         // not used by email
83
+        return '';
84
     }
85
-    
86
+
87
     /**
88
      * (non-PHPdoc)
89
      * @see Syncroton_Data_IDataEmail::sendEmail()
90
@@ -84,4 +85,3 @@
91
         // send email
92
     }
93
 }
94
-
95
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Data/Factory.php Changed
78
 
1
@@ -18,39 +18,40 @@
2
 
3
 class Syncroton_Data_Factory
4
 {
5
-    const CLASS_CALENDAR = 'Calendar';
6
-    const CLASS_CONTACTS = 'Contacts';
7
-    const CLASS_EMAIL    = 'Email';
8
-    const CLASS_NOTES    = 'Notes';
9
-    const CLASS_TASKS    = 'Tasks';
10
-    const STORE_EMAIL    = 'Mailbox';
11
-    const STORE_GAL      = 'GAL';
12
-    
13
-    protected static $_classMap = array();
14
-    
15
+    public const CLASS_CALENDAR = 'Calendar';
16
+    public const CLASS_CONTACTS = 'Contacts';
17
+    public const CLASS_EMAIL    = 'Email';
18
+    public const CLASS_NOTES    = 'Notes';
19
+    public const CLASS_TASKS    = 'Tasks';
20
+    public const STORE_EMAIL    = 'Mailbox';
21
+    public const STORE_GAL      = 'GAL';
22
+
23
+    protected static $_classMap = ;
24
+
25
     /**
26
-     * @param unknown_type $_class
27
+     * @param string                  $_classFactory
28
      * @param Syncroton_Model_IDevice $_device
29
-     * @param DateTime $_timeStamp
30
+     * @param DateTime                $_timeStamp
31
+     *
32
      * @throws InvalidArgumentException
33
      * @return Syncroton_Data_IData
34
      */
35
     public static function factory($_classFactory, Syncroton_Model_IDevice $_device, DateTime $_timeStamp)
36
     {
37
-        switch($_classFactory) {
38
+        switch ($_classFactory) {
39
             case self::CLASS_CALENDAR:
40
                 $className = Syncroton_Registry::get(Syncroton_Registry::CALENDAR_DATA_CLASS);
41
                 break;
42
-                
43
+
44
             case self::CLASS_CONTACTS:
45
                 $className = Syncroton_Registry::get(Syncroton_Registry::CONTACTS_DATA_CLASS);
46
                 break;
47
-                
48
+
49
             case self::STORE_EMAIL:
50
             case self::CLASS_EMAIL:
51
                 $className = Syncroton_Registry::get(Syncroton_Registry::EMAIL_DATA_CLASS);
52
                 break;
53
-                
54
+
55
             case self::CLASS_NOTES:
56
                 $className = Syncroton_Registry::get(Syncroton_Registry::NOTES_DATA_CLASS);
57
                 break;
58
@@ -65,16 +66,14 @@
59
 
60
             default:
61
                 throw new Syncroton_Exception_UnexpectedValue('invalid class type provided');
62
-                breeak;
63
         }
64
-        
65
+
66
         $class = new $className($_device, $_timeStamp);
67
-        
68
+
69
         if (! $class instanceof Syncroton_Data_IData) {
70
             throw new RuntimeException('class must be instanceof Syncroton_Data_IData');
71
         }
72
-                    
73
+
74
         return $class;
75
     }
76
 }
77
-
78
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Data/IData.php Changed
150
 
1
@@ -19,37 +19,37 @@
2
 {
3
     /**
4
      * create new entry
5
-     * 
6
+     *
7
      * @param string                  $folderId
8
      * @param Syncroton_Model_IEntry  $entry
9
      * @return string  id of created entry
10
      */
11
     public function createEntry($folderId, Syncroton_Model_IEntry $entry);
12
-    
13
+
14
     /**
15
      * create a new folder in backend
16
-     * 
17
+     *
18
      * @param Syncroton_Model_IFolder $folder
19
      * @return Syncroton_Model_IFolder
20
      */
21
     public function createFolder(Syncroton_Model_IFolder $folder);
22
-    
23
+
24
     /**
25
      * delete entry in backend
26
-     * 
27
+     *
28
      * @param string                          $_folderId
29
      * @param string                          $_serverId
30
      * @param ?Syncroton_Model_SyncCollection $_collectionData
31
      */
32
     public function deleteEntry($_folderId, $_serverId, $_collectionData = null);
33
-    
34
+
35
     /**
36
      * delete folder
37
-     * 
38
+     *
39
      * @param string $folderId
40
      */
41
     public function deleteFolder($folderId);
42
-    
43
+
44
     /**
45
      * empty folder
46
      *
47
@@ -57,78 +57,77 @@
48
      * @param array  $options
49
      */
50
     public function emptyFolderContents($folderId, $options);
51
-    
52
+
53
     /**
54
      * return list off all folders
55
      * @return array  of Syncroton_Model_IFolder
56
      */
57
     public function getAllFolders();
58
-    
59
-    public function getChangedEntries($folderId, Syncroton_Model_ISyncState $syncState, $filterType = NULL);
60
+
61
+    public function getChangedEntries($folderId, Syncroton_Model_ISyncState $syncState, $filterType = null);
62
 
63
     /**
64
      * Retrieve extra data that is stored with the sync key
65
      * @return string|null
66
      **/
67
     public function getExtraData(Syncroton_Model_IFolder $folder);
68
-    
69
-    
70
+
71
+
72
     /**
73
      * retrieve folders which were modified since last sync
74
-     * 
75
+     *
76
      * @param DateTime $startTimeStamp
77
      * @param DateTime $endTimeStamp
78
      */
79
     public function getChangedFolders(DateTime $startTimeStamp, DateTime $endTimeStamp);
80
-    
81
+
82
     public function getCountOfChanges(Syncroton_Backend_IContent $contentBackend, Syncroton_Model_IFolder $folder, Syncroton_Model_ISyncState $syncState);
83
-    
84
+
85
     /**
86
-     * 
87
+     *
88
      * @param Syncroton_Model_SyncCollection $collection
89
      * @param string $serverId
90
-     * @return Syncroton_Model_IEntry
91
+     * @return Syncroton_Model_IXMLEntry
92
      */
93
     public function getEntry(Syncroton_Model_SyncCollection $collection, $serverId);
94
-    
95
+
96
     /**
97
-     * 
98
+     *
99
      * @param string $fileReference
100
      * @return Syncroton_Model_FileReference
101
      */
102
     public function getFileReference($fileReference);
103
-    
104
+
105
     /**
106
-     * return array of all id's stored in folder 
107
-     * 
108
-     * @param  Syncroton_Model_IFolder|string  $folderId
109
-     * @param  string                          $filter
110
-     * @return array
111
-     */
112
+     * return array of all id's stored in folder
113
+     *
114
+     * @param  Syncroton_Model_IFolder|string  $folderId
115
+     * @param  string                          $filter
116
+     * @return array
117
+     */
118
     public function getServerEntries($folderId, $filter);
119
 
120
     /**
121
      * return true if any data got modified in the backend
122
-     * 
123
+     *
124
      * @param  Syncroton_Backend_IContent  $contentBackend
125
      * @param  Syncroton_Model_IFolder     $folder
126
      * @param  Syncroton_Model_ISyncState  $syncState
127
      * @return bool
128
      */
129
     public function hasChanges(Syncroton_Backend_IContent $contentBackend, Syncroton_Model_IFolder $folder, Syncroton_Model_ISyncState $syncState);
130
-    
131
+
132
     public function moveItem($srcFolderId, $serverId, $dstFolderId);
133
-    
134
+
135
     /**
136
      * update existing entry
137
-     * 
138
+     *
139
      * @param  string                  $folderId
140
      * @param  string                  $serverId
141
      * @param  Syncroton_Model_IEntry  $entry
142
      * @return string  id of updated entry
143
      */
144
     public function updateEntry($folderId, $serverId, Syncroton_Model_IEntry $entry);
145
-    
146
+
147
     public function updateFolder(Syncroton_Model_IFolder $folder);
148
 }
149
-
150
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Data/IDataCalendar.php Changed
13
 
1
@@ -19,10 +19,9 @@
2
 {
3
     /**
4
      * set attendee status for meeting
5
-     * 
6
+     *
7
      * @param  Syncroton_Model_MeetingResponse  $request  the meeting response
8
      * @return  string  id of new calendar entry
9
      */
10
     public function setAttendeeStatus(Syncroton_Model_MeetingResponse $request);
11
 }
12
-
13
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Data/IDataEmail.php Changed
33
 
1
@@ -19,15 +19,15 @@
2
 {
3
     /**
4
      * send an email
5
-     * 
6
+     *
7
      * @param  resource  $inputStream
8
      * @param  boolean   $saveInSent
9
      */
10
     public function sendEmail($inputStream, $saveInSent);
11
-    
12
+
13
     /**
14
      * forward an email
15
-     * 
16
+     *
17
      * @param  string|array  $source       is either a string(LongId) or an array with following properties collectionId, itemId and instanceId
18
      * @param  string        $inputStream
19
      * @param  string        $saveInSent
20
@@ -36,11 +36,10 @@
21
 
22
     /**
23
      * reply to an email
24
-     * 
25
+     *
26
      * @param  string|array  $source       is either a string(LongId) or an array with following properties collectionId, itemId and instanceId
27
      * @param  string        $inputStream
28
      * @param  string        $saveInSent
29
      */
30
     public function replyEmail($source, $inputStream, $saveInSent, $replaceMime);
31
 }
32
-
33
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Data/Notes.php Changed
13
 
1
@@ -17,8 +17,8 @@
2
  */
3
 class Syncroton_Data_Notes extends Syncroton_Data_AData
4
 {
5
-    protected $_supportedFolderTypes = array(
6
+    protected $_supportedFolderTypes = 
7
         Syncroton_Command_FolderSync::FOLDERTYPE_NOTE,
8
-        Syncroton_Command_FolderSync::FOLDERTYPE_NOTE_USER_CREATED
9
-    );
10
+        Syncroton_Command_FolderSync::FOLDERTYPE_NOTE_USER_CREATED,
11
+    ;
12
 }
13
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Data/Tasks.php Changed
14
 
1
@@ -17,9 +17,8 @@
2
  */
3
 class Syncroton_Data_Tasks extends Syncroton_Data_AData
4
 {
5
-    protected $_supportedFolderTypes = array(
6
+    protected $_supportedFolderTypes = 
7
         Syncroton_Command_FolderSync::FOLDERTYPE_TASK,
8
-        Syncroton_Command_FolderSync::FOLDERTYPE_TASK_USER_CREATED
9
-    );
10
+        Syncroton_Command_FolderSync::FOLDERTYPE_TASK_USER_CREATED,
11
+    ;
12
 }
13
-
14
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Exception/Status.php Changed
197
 
1
@@ -20,87 +20,87 @@
2
 class Syncroton_Exception_Status extends Syncroton_Exception
3
 {
4
     // http://msdn.microsoft.com/en-us/library/ee218647%28v=exchg.80%29
5
-    const INVALID_CONTENT                    = 101;
6
-    const INVALID_WBXML                      = 102;
7
-    const INVALID_XML                        = 103;
8
-    const INVALID_DATE_TIME                  = 104;
9
-    const INVALID_COMBINATION_OF_IDS         = 105;
10
-    const INVALID_IDS                        = 106;
11
-    const INVALID_MIME                       = 107;
12
-    const DEVICE_MISSING_OR_INVALID          = 108;
13
-    const DEVICE_TYPE_MISSING_OR_INVALID     = 109;
14
-    const SERVER_ERROR                       = 110;
15
-    const SERVER_ERROR_RETRY_LATER           = 111;
16
-    const ACTIVE_DIRECTORY_ACCESS_DENIED     = 112;
17
-    const MAILBOX_QUOTA_EXCEEDED             = 113;
18
-    const MAILBOX_SERVER_OFFLINE             = 114;
19
-    const SEND_QUOTA_EXCEEDED                = 115;
20
-    const MESSAGE_RECIPIENT_UNRESOLVED       = 116;
21
-    const MESSAGE_REPLY_NOT_ALLOWED          = 117;
22
-    const MESSAGE_PREVIOUSLY_SENT            = 118;
23
-    const MESSAGE_HAS_NO_RECIPIENT           = 119;
24
-    const MAIL_SUBMISSION_FAILED             = 120;
25
-    const MESSAGE_REPLY_FAILED               = 121;
26
-    const ATTACHMENT_IS_TOO_LARGE            = 122;
27
-    const USER_HAS_NO_MAILBOX                = 123;
28
-    const USER_CANNOT_BE_ANONYMOUS           = 124;
29
-    const USER_PRINCIPAL_COULD_NOT_BE_FOUND  = 125;
30
-    const USER_DISABLED_FOR_SYNC             = 126;
31
-    const USER_ON_NEW_MAILBOX_CANNOT_SYNC    = 127;
32
-    const USER_ON_LEGACY_MAILBOX_CANNOT_SYNC = 128;
33
-    const DEVICE_IS_BLOCKED_FOR_THIS_USER    = 129;
34
-    const ACCESS_DENIED                      = 130;
35
-    const ACCOUNT_DISABLED                   = 131;
36
-    const SYNC_STATE_NOT_FOUND               = 132;
37
-    const SYNC_STATE_LOCKED                  = 133;
38
-    const SYNC_STATE_CORRUPT                 = 134;
39
-    const SYNC_STATE_ALREADY_EXISTS          = 135;
40
-    const SYNC_STATE_VERSION_INVALID         = 136;
41
-    const COMMAND_NOT_SUPPORTED              = 137;
42
-    const VERSION_NOT_SUPPORTED              = 138;
43
-    const DEVICE_NOT_FULLY_PROVISIONABLE     = 139;
44
-    const REMOTE_WIPE_REQUESTED              = 140;
45
-    const LEGACY_DEVICE_ON_STRICT_POLICY     = 141;
46
-    const DEVICE_NOT_PROVISIONED             = 142;
47
-    const POLICY_REFRESH                     = 143;
48
-    const INVALID_POLICY_KEY                 = 144;
49
-    const EXTERNALLY_MANAGED_DEVICES_NOT_ALLOWED = 145;
50
-    const NO_RECURRENCE_IN_CALENDAR          = 146;
51
-    const UNEXPECTED_ITEM_CLASS              = 147;
52
-    const REMOTE_SERVER_HAS_NO_SSL           = 148;
53
-    const INVALID_STORED_REQUEST             = 149;
54
-    const ITEM_NOT_FOUND                     = 150;
55
-    const TOO_MANY_FOLDERS                   = 151;
56
-    const NO_FOLDERS_FOUND                   = 152;
57
-    const ITEMS_LOST_AFTER_MOVE              = 153;
58
-    const FAILURE_IN_MOVE_OPERATION          = 154;
59
-    const MOVE_COMMAND_DISALLOWED            = 155;
60
-    const MOVE_COMMAND_INVALID_DESTINATION   = 156;
61
-    const AVAILABILITY_TO_MANY_RECIPIENTS    = 160;
62
-    const AVAILABILITY_DL_LIMIT_REACHED      = 161;
63
-    const AVAILABILITY_TRANSIENT_FAILURE     = 162;
64
-    const AVAILABILITY_FAILURE               = 163;
65
-    const BODY_PART_PREFERENCE_TYPE_NOT_SUPPORTED = 164;
66
-    const DEVICE_INFORMATION_REQUIRED        = 165;
67
-    const INVALID_ACCOUNT_ID                 = 166;
68
-    const ACCOUNT_SEND_DISABLED              = 167;
69
-    CONST IRM_FEATURE_DISABLED               = 168;
70
-    const IRM_TRANSIENT_ERROR                = 169;
71
-    const IRM_PERMANENT_ERROR                = 170;
72
-    const IRM_INVALID_TEMPLATE_ID            = 171;
73
-    const IRM_OPERATION_NOT_PERMITTED        = 172;
74
-    const NO_PICTURE                         = 173;
75
-    const PICTURE_TO_LARGE                   = 174;
76
-    const PICTURE_LIMIT_REACHED              = 175;
77
-    const BODY_PART_CONVERSATION_TOO_LARGE   = 176;
78
-    const MAXIMUM_DEVICES_REACHED            = 177;
79
+    public const INVALID_CONTENT                    = 101;
80
+    public const INVALID_WBXML                      = 102;
81
+    public const INVALID_XML                        = 103;
82
+    public const INVALID_DATE_TIME                  = 104;
83
+    public const INVALID_COMBINATION_OF_IDS         = 105;
84
+    public const INVALID_IDS                        = 106;
85
+    public const INVALID_MIME                       = 107;
86
+    public const DEVICE_MISSING_OR_INVALID          = 108;
87
+    public const DEVICE_TYPE_MISSING_OR_INVALID     = 109;
88
+    public const SERVER_ERROR                       = 110;
89
+    public const SERVER_ERROR_RETRY_LATER           = 111;
90
+    public const ACTIVE_DIRECTORY_ACCESS_DENIED     = 112;
91
+    public const MAILBOX_QUOTA_EXCEEDED             = 113;
92
+    public const MAILBOX_SERVER_OFFLINE             = 114;
93
+    public const SEND_QUOTA_EXCEEDED                = 115;
94
+    public const MESSAGE_RECIPIENT_UNRESOLVED       = 116;
95
+    public const MESSAGE_REPLY_NOT_ALLOWED          = 117;
96
+    public const MESSAGE_PREVIOUSLY_SENT            = 118;
97
+    public const MESSAGE_HAS_NO_RECIPIENT           = 119;
98
+    public const MAIL_SUBMISSION_FAILED             = 120;
99
+    public const MESSAGE_REPLY_FAILED               = 121;
100
+    public const ATTACHMENT_IS_TOO_LARGE            = 122;
101
+    public const USER_HAS_NO_MAILBOX                = 123;
102
+    public const USER_CANNOT_BE_ANONYMOUS           = 124;
103
+    public const USER_PRINCIPAL_COULD_NOT_BE_FOUND  = 125;
104
+    public const USER_DISABLED_FOR_SYNC             = 126;
105
+    public const USER_ON_NEW_MAILBOX_CANNOT_SYNC    = 127;
106
+    public const USER_ON_LEGACY_MAILBOX_CANNOT_SYNC = 128;
107
+    public const DEVICE_IS_BLOCKED_FOR_THIS_USER    = 129;
108
+    public const ACCESS_DENIED                      = 130;
109
+    public const ACCOUNT_DISABLED                   = 131;
110
+    public const SYNC_STATE_NOT_FOUND               = 132;
111
+    public const SYNC_STATE_LOCKED                  = 133;
112
+    public const SYNC_STATE_CORRUPT                 = 134;
113
+    public const SYNC_STATE_ALREADY_EXISTS          = 135;
114
+    public const SYNC_STATE_VERSION_INVALID         = 136;
115
+    public const COMMAND_NOT_SUPPORTED              = 137;
116
+    public const VERSION_NOT_SUPPORTED              = 138;
117
+    public const DEVICE_NOT_FULLY_PROVISIONABLE     = 139;
118
+    public const REMOTE_WIPE_REQUESTED              = 140;
119
+    public const LEGACY_DEVICE_ON_STRICT_POLICY     = 141;
120
+    public const DEVICE_NOT_PROVISIONED             = 142;
121
+    public const POLICY_REFRESH                     = 143;
122
+    public const INVALID_POLICY_KEY                 = 144;
123
+    public const EXTERNALLY_MANAGED_DEVICES_NOT_ALLOWED = 145;
124
+    public const NO_RECURRENCE_IN_CALENDAR          = 146;
125
+    public const UNEXPECTED_ITEM_CLASS              = 147;
126
+    public const REMOTE_SERVER_HAS_NO_SSL           = 148;
127
+    public const INVALID_STORED_REQUEST             = 149;
128
+    public const ITEM_NOT_FOUND                     = 150;
129
+    public const TOO_MANY_FOLDERS                   = 151;
130
+    public const NO_FOLDERS_FOUND                   = 152;
131
+    public const ITEMS_LOST_AFTER_MOVE              = 153;
132
+    public const FAILURE_IN_MOVE_OPERATION          = 154;
133
+    public const MOVE_COMMAND_DISALLOWED            = 155;
134
+    public const MOVE_COMMAND_INVALID_DESTINATION   = 156;
135
+    public const AVAILABILITY_TO_MANY_RECIPIENTS    = 160;
136
+    public const AVAILABILITY_DL_LIMIT_REACHED      = 161;
137
+    public const AVAILABILITY_TRANSIENT_FAILURE     = 162;
138
+    public const AVAILABILITY_FAILURE               = 163;
139
+    public const BODY_PART_PREFERENCE_TYPE_NOT_SUPPORTED = 164;
140
+    public const DEVICE_INFORMATION_REQUIRED        = 165;
141
+    public const INVALID_ACCOUNT_ID                 = 166;
142
+    public const ACCOUNT_SEND_DISABLED              = 167;
143
+    public const IRM_FEATURE_DISABLED               = 168;
144
+    public const IRM_TRANSIENT_ERROR                = 169;
145
+    public const IRM_PERMANENT_ERROR                = 170;
146
+    public const IRM_INVALID_TEMPLATE_ID            = 171;
147
+    public const IRM_OPERATION_NOT_PERMITTED        = 172;
148
+    public const NO_PICTURE                         = 173;
149
+    public const PICTURE_TO_LARGE                   = 174;
150
+    public const PICTURE_LIMIT_REACHED              = 175;
151
+    public const BODY_PART_CONVERSATION_TOO_LARGE   = 176;
152
+    public const MAXIMUM_DEVICES_REACHED            = 177;
153
 
154
     /**
155
      * Common error messages assigned to error codes
156
      *
157
      * @var array
158
      */
159
-    protected $_commonMessages = array(
160
+    protected $_commonMessages = 
161
         self::INVALID_CONTENT                    => "Invalid request body",
162
         self::INVALID_WBXML                      => "Invalid WBXML request",
163
         self::INVALID_XML                        => "Invalid XML request",
164
@@ -175,20 +175,20 @@
165
         self::PICTURE_LIMIT_REACHED              => "The number of contact photos returned exceeds the size limit set by the MaxPictures element",
166
         self::BODY_PART_CONVERSATION_TOO_LARGE   => "The conversation is too large to compute the body parts",
167
         self::MAXIMUM_DEVICES_REACHED            => "The user's account has too many device partnerships",
168
-    );
169
+    ;
170
 
171
     /**
172
      * Error messages assigned to class-specific error codes
173
      *
174
      * @var array
175
      */
176
-    protected $_errorMessages = array();
177
+    protected $_errorMessages = ;
178
 
179
 
180
     /**
181
      * Constructor
182
      */
183
-    function __construct()
184
+    public function __construct()
185
     {
186
         $args = func_get_args();
187
 
188
@@ -202,7 +202,7 @@
189
             $message = $args0;
190
         }
191
 
192
-        if (!$code) {
193
+        if (empty($code)) {
194
             $code = self::SERVER_ERROR;
195
         }
196
 
197
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Exception/Status/Autodiscover.php Changed
19
 
1
@@ -19,14 +19,14 @@
2
  */
3
 class Syncroton_Exception_Status_Autodiscover extends Syncroton_Exception_Status
4
 {
5
-    const PROTOCOL_ERROR = 2;
6
+    public const PROTOCOL_ERROR = 2;
7
 
8
     /**
9
      * Error messages assigned to error codes
10
      *
11
      * @var array
12
      */
13
-    protected $_errorMessages = array(
14
+    protected $_errorMessages = 
15
         self::PROTOCOL_ERROR => "Protocol error",
16
-    );
17
+    ;
18
 }
19
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Exception/Status/FolderCreate.php Changed
39
 
1
@@ -19,21 +19,21 @@
2
  */
3
 class Syncroton_Exception_Status_FolderCreate extends Syncroton_Exception_Status
4
 {
5
-    const FOLDER_EXISTS       = 2;
6
-    const SPECIAL_FOLDER      = 3;
7
-    const PARENT_NOT_FOUND    = 5;
8
-    const FOLDER_SERVER_ERROR = 6;
9
-    const INVALID_SYNCKEY     = 9;
10
-    const INVALID_REQUEST     = 10;
11
-    const UNKNOWN_ERROR       = 11;
12
-    const UNKNOWN_CODE        = 12;
13
+    public const FOLDER_EXISTS       = 2;
14
+    public const SPECIAL_FOLDER      = 3;
15
+    public const PARENT_NOT_FOUND    = 5;
16
+    public const FOLDER_SERVER_ERROR = 6;
17
+    public const INVALID_SYNCKEY     = 9;
18
+    public const INVALID_REQUEST     = 10;
19
+    public const UNKNOWN_ERROR       = 11;
20
+    public const UNKNOWN_CODE        = 12;
21
 
22
     /**
23
      * Error messages assigned to error codes
24
      *
25
      * @var array
26
      */
27
-    protected $_errorMessages = array(
28
+    protected $_errorMessages = 
29
         self::FOLDER_EXISTS       => "A folder that has this name already exists",
30
         self::SPECIAL_FOLDER      => "The specified folder is a special system folder",
31
         self::PARENT_NOT_FOUND    => "The specified parent folder was not found",
32
@@ -42,5 +42,5 @@
33
         self::INVALID_REQUEST     => "Malformed request",
34
         self::UNKNOWN_ERROR       => "An unknown error occurred",
35
         self::UNKNOWN_CODE        => "Unusual back-end issue",
36
-    );
37
+    ;
38
 }
39
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Exception/Status/FolderDelete.php Changed
34
 
1
@@ -19,24 +19,24 @@
2
  */
3
 class Syncroton_Exception_Status_FolderDelete extends Syncroton_Exception_Status
4
 {
5
-    const SPECIAL_FOLDER      = 3;
6
-    const FOLDER_NOT_FOUND    = 4;
7
-    const FOLDER_SERVER_ERROR = 6;
8
-    const INVALID_SYNCKEY     = 9;
9
-    const INVALID_REQUEST     = 10;
10
-    const UNKNOWN_ERROR       = 11;
11
+    public const SPECIAL_FOLDER      = 3;
12
+    public const FOLDER_NOT_FOUND    = 4;
13
+    public const FOLDER_SERVER_ERROR = 6;
14
+    public const INVALID_SYNCKEY     = 9;
15
+    public const INVALID_REQUEST     = 10;
16
+    public const UNKNOWN_ERROR       = 11;
17
 
18
     /**
19
      * Error messages assigned to error codes
20
      *
21
      * @var array
22
      */
23
-    protected $_errorMessages = array(
24
+    protected $_errorMessages = 
25
         self::SPECIAL_FOLDER      => "The specified folder is a special system folder",
26
         self::FOLDER_NOT_FOUND    => "The specified folder doesn't exist",
27
         self::FOLDER_SERVER_ERROR => "An error occurred on the server",
28
         self::INVALID_SYNCKEY     => "Synchronization key mismatch or invalid synchronization key",
29
         self::INVALID_REQUEST     => "Malformed request",
30
         self::UNKNOWN_ERROR       => "An unknown error occurred",
31
-    );
32
+    ;
33
 }
34
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Exception/Status/FolderSync.php Changed
31
 
1
@@ -19,22 +19,22 @@
2
  */
3
 class Syncroton_Exception_Status_FolderSync extends Syncroton_Exception_Status
4
 {
5
-    const FOLDER_SERVER_ERROR = 6;
6
-    const INVALID_SYNCKEY     = 9;
7
-    const INVALID_REQUEST     = 10;
8
-    const UNKNOWN_ERROR       = 11;
9
-    const UNKNOWN_CODE        = 12;
10
+    public const FOLDER_SERVER_ERROR = 6;
11
+    public const INVALID_SYNCKEY     = 9;
12
+    public const INVALID_REQUEST     = 10;
13
+    public const UNKNOWN_ERROR       = 11;
14
+    public const UNKNOWN_CODE        = 12;
15
 
16
     /**
17
      * Error messages assigned to error codes
18
      *
19
      * @var array
20
      */
21
-    protected $_errorMessages = array(
22
+    protected $_errorMessages = 
23
         self::FOLDER_SERVER_ERROR => "An error occurred on the server",
24
         self::INVALID_SYNCKEY     => "Synchronization key mismatch or invalid synchronization key",
25
         self::INVALID_REQUEST     => "Malformed request",
26
         self::UNKNOWN_ERROR       => "An unknown error occurred",
27
         self::UNKNOWN_CODE        => "Unusual back-end issue",
28
-    );
29
+    ;
30
 }
31
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Exception/Status/FolderUpdate.php Changed
39
 
1
@@ -19,21 +19,21 @@
2
  */
3
 class Syncroton_Exception_Status_FolderUpdate extends Syncroton_Exception_Status
4
 {
5
-    const FOLDER_EXISTS       = 2;
6
-    const SPECIAL_FOLDER      = 3;
7
-    const FOLDER_NOT_FOUND    = 4;
8
-    const PARENT_NOT_FOUND    = 5;
9
-    const FOLDER_SERVER_ERROR = 6;
10
-    const INVALID_SYNCKEY     = 9;
11
-    const INVALID_REQUEST     = 10;
12
-    const UNKNOWN_ERROR       = 11;
13
+    public const FOLDER_EXISTS       = 2;
14
+    public const SPECIAL_FOLDER      = 3;
15
+    public const FOLDER_NOT_FOUND    = 4;
16
+    public const PARENT_NOT_FOUND    = 5;
17
+    public const FOLDER_SERVER_ERROR = 6;
18
+    public const INVALID_SYNCKEY     = 9;
19
+    public const INVALID_REQUEST     = 10;
20
+    public const UNKNOWN_ERROR       = 11;
21
 
22
     /**
23
      * Error messages assigned to error codes
24
      *
25
      * @var array
26
      */
27
-    protected $_errorMessages = array(
28
+    protected $_errorMessages = 
29
         self::FOLDER_EXISTS       => "A folder that has this name already exists or is a special folder",
30
         self::SPECIAL_FOLDER      => "The specified folder is the Recipient information folder which cannot be updated",
31
         self::FOLDER_NOT_FOUND    => "The specified folder doesn't exist",
32
@@ -42,5 +42,5 @@
33
         self::INVALID_SYNCKEY     => "Synchronization key mismatch or invalid synchronization key",
34
         self::INVALID_REQUEST     => "Malformed request",
35
         self::UNKNOWN_ERROR       => "An unknown error occurred",
36
-    );
37
+    ;
38
 }
39
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Exception/Status/GetItemEstimate.php Changed
25
 
1
@@ -19,18 +19,18 @@
2
  */
3
 class Syncroton_Exception_Status_GetItemEstimate extends Syncroton_Exception_Status
4
 {
5
-    const INVALID_COLLECTION   = 2;
6
-    const SYNCSTATE_NOT_PRIMED = 3;
7
-    const INVALID_SYNCKEY      = 4;
8
+    public const INVALID_COLLECTION   = 2;
9
+    public const SYNCSTATE_NOT_PRIMED = 3;
10
+    public const INVALID_SYNCKEY      = 4;
11
 
12
     /**
13
      * Error messages assigned to error codes
14
      *
15
      * @var array
16
      */
17
-    protected $_errorMessages = array(
18
+    protected $_errorMessages = 
19
         self::INVALID_COLLECTION   => "A collection was invalid or one of the specified collection IDs was invalid",
20
         self::SYNCSTATE_NOT_PRIMED => "The synchronization state has not been primed",
21
         self::INVALID_SYNCKEY      => "The specified synchronization key was invalid",
22
-    );
23
+    ;
24
 }
25
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Exception/Status/ItemOperations.php Changed
55
 
1
@@ -19,29 +19,29 @@
2
  */
3
 class Syncroton_Exception_Status_ItemOperations extends Syncroton_Exception_Status
4
 {
5
-    const PROTOCOL_ERROR         = 2;
6
-    const ITEM_SERVER_ERROR      = 3;
7
-    const DOCLIB_INVALID_URI     = 4;
8
-    const DOCLIB_ACCESS_DENIED   = 5;
9
-    const DOCLIB_NOT_FOUND       = 6;
10
-    const DOCLIB_CONN_FAILED     = 7;
11
-    const INVALID_BYTE_RANGE     = 8;
12
-    const UNKNOWN_STORE          = 9;
13
-    const FILE_EMPTY             = 10;
14
-    const DATA_TOO_LARGE         = 11;
15
-    const FILE_IO_ERROR          = 12;
16
-    const CONVERSION_ERROR       = 14;
17
-    const INVALID_ATTACHMENT     = 15;
18
-    const RESOURCE_ACCESS_DENIED = 16;
19
-    const PARTIAL_SUCCESS        = 17;
20
-    const CREDENTIALS_REQUIRED   = 18;
21
+    public const PROTOCOL_ERROR         = 2;
22
+    public const ITEM_SERVER_ERROR      = 3;
23
+    public const DOCLIB_INVALID_URI     = 4;
24
+    public const DOCLIB_ACCESS_DENIED   = 5;
25
+    public const DOCLIB_NOT_FOUND       = 6;
26
+    public const DOCLIB_CONN_FAILED     = 7;
27
+    public const INVALID_BYTE_RANGE     = 8;
28
+    public const UNKNOWN_STORE          = 9;
29
+    public const FILE_EMPTY             = 10;
30
+    public const DATA_TOO_LARGE         = 11;
31
+    public const FILE_IO_ERROR          = 12;
32
+    public const CONVERSION_ERROR       = 14;
33
+    public const INVALID_ATTACHMENT     = 15;
34
+    public const RESOURCE_ACCESS_DENIED = 16;
35
+    public const PARTIAL_SUCCESS        = 17;
36
+    public const CREDENTIALS_REQUIRED   = 18;
37
 
38
     /**
39
      * Error messages assigned to error codes
40
      *
41
      * @var array
42
      */
43
-    protected $_errorMessages = array(
44
+    protected $_errorMessages = 
45
         self::PROTOCOL_ERROR         => "Protocol error - protocol violation/XML validation error",
46
         self::ITEM_SERVER_ERROR      => "Server error",
47
         self::DOCLIB_INVALID_URI     => "Document library access - The specified URI is bad",
48
@@ -58,5 +58,5 @@
49
         self::RESOURCE_ACCESS_DENIED => "Access to the resource is denied",
50
         self::PARTIAL_SUCCESS        => "Partial success; the command completed partially",
51
         self::CREDENTIALS_REQUIRED   => "Credentials required",
52
-    );
53
+    ;
54
 }
55
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Exception/Status/MeetingResponse.php Changed
25
 
1
@@ -19,18 +19,18 @@
2
  */
3
 class Syncroton_Exception_Status_MeetingResponse extends Syncroton_Exception_Status
4
 {
5
-    const INVALID_REQUEST       = 2;
6
-    const MEETING_SERVER_ERROR  = 3;
7
-    const MEETING_ERROR         = 4;
8
+    public const INVALID_REQUEST       = 2;
9
+    public const MEETING_SERVER_ERROR  = 3;
10
+    public const MEETING_ERROR         = 4;
11
 
12
     /**
13
      * Error messages assigned to error codes
14
      *
15
      * @var array
16
      */
17
-    protected $_errorMessages = array(
18
+    protected $_errorMessages = 
19
         self::INVALID_REQUEST       => "Invalid meeting request",
20
         self::MEETING_SERVER_ERROR  => "An error occurred on the server mailbox",
21
         self::MEETING_ERROR         => "An error occurred on the server",
22
-    );
23
+    ;
24
 }
25
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Exception/Status/MoveItems.php Changed
31
 
1
@@ -19,22 +19,22 @@
2
  */
3
 class Syncroton_Exception_Status_MoveItems extends Syncroton_Exception_Status
4
 {
5
-    const INVALID_SOURCE          = 1;
6
-    const INVALID_DESTINATION     = 2;
7
-    const SAME_FOLDER             = 4;
8
-    const ITEM_EXISTS_OR_LOCKED   = 5;
9
-    const FOLDER_LOCKED           = 7;
10
+    public const INVALID_SOURCE          = 1;
11
+    public const INVALID_DESTINATION     = 2;
12
+    public const SAME_FOLDER             = 4;
13
+    public const ITEM_EXISTS_OR_LOCKED   = 5;
14
+    public const FOLDER_LOCKED           = 7;
15
 
16
     /**
17
      * Error messages assigned to error codes
18
      *
19
      * @var array
20
      */
21
-    protected $_errorMessages = array(
22
+    protected $_errorMessages = 
23
         self::INVALID_SOURCE          => "Invalid source collection ID or item ID",
24
         self::INVALID_DESTINATION     => "Invalid destination collection ID",
25
         self::SAME_FOLDER             => "Source and destination collection IDs are the same",
26
         self::ITEM_EXISTS_OR_LOCKED   => "The item cannot be moved to more than one item at a time, or the source or destination item was locked",
27
         self::FOLDER_LOCKED           => "Source or destination item was locked",
28
-    );
29
+    ;
30
 }
31
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Exception/Status/Settings.php Changed
34
 
1
@@ -19,24 +19,24 @@
2
  */
3
 class Syncroton_Exception_Status_Settings extends Syncroton_Exception_Status
4
 {
5
-    const PROTOCOL_ERROR         = 2;
6
-    const ACCESS_DENIED          = 3;
7
-    const SERVICE_UNAVAILABLE    = 4;
8
-    const INVALID_ARGUMENTS      = 5;
9
-    const CONFLICTING_ARGUMENTS  = 6;
10
-    const DENIED_BY_POLICY       = 7;
11
+    public const PROTOCOL_ERROR         = 2;
12
+    public const ACCESS_DENIED          = 3;
13
+    public const SERVICE_UNAVAILABLE    = 4;
14
+    public const INVALID_ARGUMENTS      = 5;
15
+    public const CONFLICTING_ARGUMENTS  = 6;
16
+    public const DENIED_BY_POLICY       = 7;
17
 
18
     /**
19
      * Error messages assigned to error codes
20
      *
21
      * @var array
22
      */
23
-    protected $_errorMessages = array(
24
+    protected $_errorMessages = 
25
         self::PROTOCOL_ERROR        => "Protocol error",
26
         self::ACCESS_DENIED         => "Access denied",
27
         self::SERVICE_UNAVAILABLE   => "Server unavailable",
28
         self::INVALID_ARGUMENTS     => "Invalid arguments",
29
         self::CONFLICTING_ARGUMENTS => "Conflicting arguments",
30
         self::DENIED_BY_POLICY      => "Denied by policy. Disabled by administrator",
31
-    );
32
+    ;
33
 }
34
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Exception/Status/Sync.php Changed
47
 
1
@@ -19,25 +19,25 @@
2
  */
3
 class Syncroton_Exception_Status_Sync extends Syncroton_Exception_Status
4
 {
5
-    const INVALID_SYNCKEY     = 3;
6
-    const PROTOCOL_ERROR      = 4;
7
-    const SYNC_SERVER_ERROR   = 5;
8
-    const INVALID_ITEM        = 6;
9
-    const OBJECT_CONFLICT     = 7;
10
-    const OBJECT_NOT_FOUND    = 8;
11
-    const SYNC_ERROR          = 9;
12
-    const HIERARCHY_CHANGED   = 12;
13
-    const INCOMPLETE_REQUEST  = 13;
14
-    const INVALID_INTERVAL    = 14;
15
-    const INVALID_REQUEST     = 15;
16
-    const SYNC_RETRY          = 16;
17
+    public const INVALID_SYNCKEY     = 3;
18
+    public const PROTOCOL_ERROR      = 4;
19
+    public const SYNC_SERVER_ERROR   = 5;
20
+    public const INVALID_ITEM        = 6;
21
+    public const OBJECT_CONFLICT     = 7;
22
+    public const OBJECT_NOT_FOUND    = 8;
23
+    public const SYNC_ERROR          = 9;
24
+    public const HIERARCHY_CHANGED   = 12;
25
+    public const INCOMPLETE_REQUEST  = 13;
26
+    public const INVALID_INTERVAL    = 14;
27
+    public const INVALID_REQUEST     = 15;
28
+    public const SYNC_RETRY          = 16;
29
 
30
     /**
31
      * Error messages assigned to error codes
32
      *
33
      * @var array
34
      */
35
-    protected $_errorMessages = array(
36
+    protected $_errorMessages = 
37
         self::INVALID_SYNCKEY     => "Invalid synchronization key",
38
         self::PROTOCOL_ERROR      => "Protocol error",
39
         self::SYNC_SERVER_ERROR   => "Server error",
40
@@ -50,5 +50,5 @@
41
         self::INVALID_INTERVAL    => "Invalid Wait or HeartbeatInterval value",
42
         self::INVALID_REQUEST     => "Too many collections are included in the Sync request",
43
         self::SYNC_RETRY          => "Something on the server caused a retriable error",
44
-    );
45
+    ;
46
 }
47
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Model/AEntry.php Changed
118
 
1
@@ -15,13 +15,12 @@
2
  * @package     Syncroton
3
  * @subpackage  Model
4
  */
5
-
6
 abstract class Syncroton_Model_AEntry implements Syncroton_Model_IEntry, IteratorAggregate, Countable
7
 {
8
-    protected $_elements = array();
9
-    
10
+    protected $_elements = ;
11
+
12
     protected $_isDirty;
13
-    
14
+
15
     /**
16
      * (non-PHPdoc)
17
      * @see Syncroton_Model_IEntry::__construct()
18
@@ -31,31 +30,31 @@
19
         if (is_array($properties)) {
20
             $this->setFromArray($properties);
21
         }
22
-        
23
+
24
         $this->_isDirty = false;
25
     }
26
-    
27
-    
28
+
29
+
30
     /**
31
      * (non-PHPdoc)
32
      * @see Countable::count()
33
-     */    
34
+     */
35
     #\ReturnTypeWillChange
36
     public function count()
37
     {
38
         return count($this->_elements);
39
     }
40
-    
41
+
42
     /**
43
      * (non-PHPdoc)
44
      * @see IteratorAggregate::getIterator()
45
      */
46
     #\ReturnTypeWillChange
47
-    public function getIterator() 
48
-    {
49
-        return new ArrayIterator($this->_elements);
50
+    public function getIterator()
51
+    {
52
+        return new ArrayIterator($this->_elements);
53
     }
54
-    
55
+
56
     /**
57
      * (non-PHPdoc)
58
      * @see Syncroton_Model_IEntry::isDirty()
59
@@ -64,7 +63,7 @@
60
     {
61
         return $this->_isDirty;
62
     }
63
-    
64
+
65
     /**
66
      * (non-PHPdoc)
67
      * @see Syncroton_Model_IEntry::setFromArray()
68
@@ -80,28 +79,28 @@
69
             }
70
         }
71
     }
72
-        
73
-    public function &__get($name)
74
-    {
75
-        return $this->_elements$name;
76
-    }
77
-    
78
-    public function __set($name, $value)
79
+
80
+    public function &__get($name)
81
+    {
82
+        return $this->_elements$name;
83
+    }
84
+
85
+    public function __set($name, $value)
86
     {
87
         if (!array_key_exists($name, $this->_elements) || $this->_elements$name != $value) {
88
             $this->_elements$name = $value;
89
-            
90
+
91
             $this->_isDirty = true;
92
-        }
93
-    }
94
-    
95
-    public function __isset($name)
96
-    {
97
-        return isset($this->_elements$name);
98
-    }
99
-    
100
-    public function __unset($name)
101
-    {
102
-        unset($this->_elements$name);
103
+        }
104
+    }
105
+
106
+    public function __isset($name)
107
+    {
108
+        return isset($this->_elements$name);
109
+    }
110
+
111
+    public function __unset($name)
112
+    {
113
+        unset($this->_elements$name);
114
     }
115
-}
116
\ No newline at end of file
117
+}
118
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Model/AXMLEntry.php Changed
201
 
1
@@ -19,11 +19,11 @@
2
 abstract class Syncroton_Model_AXMLEntry extends Syncroton_Model_AEntry implements Syncroton_Model_IXMLEntry
3
 {
4
     protected $_xmlBaseElement;
5
-    
6
-    protected $_properties = array();
7
-    
8
+
9
+    protected $_properties = ;
10
+
11
     protected $_dateTimeFormat = "Y-m-d\TH:i:s.000\Z";
12
-    
13
+
14
     /**
15
      * (non-PHPdoc)
16
      * @see Syncroton_Model_IEntry::__construct()
17
@@ -35,10 +35,10 @@
18
         } elseif (is_array($properties)) {
19
             $this->setFromArray($properties);
20
         }
21
-        
22
+
23
         $this->_isDirty = false;
24
     }
25
-    
26
+
27
     /**
28
      * (non-PHPdoc)
29
      * @see Syncroton_Model_IEntry::appendXML()
30
@@ -46,27 +46,27 @@
31
     public function appendXML(DOMElement $domParrent, Syncroton_Model_IDevice $device)
32
     {
33
         $this->_addXMLNamespaces($domParrent);
34
-        
35
+
36
         foreach($this->_elements as $elementName => $value) {
37
             // skip empty values
38
             if($value === null || $value === '' || (is_array($value) && empty($value))) {
39
                 continue;
40
             }
41
-            
42
-            list ($nameSpace, $elementProperties) = $this->_getElementProperties($elementName);
43
-            
44
-            if ($nameSpace == 'Internal') {
45
-                continue;
46
-            }
47
-            
48
-            $elementVersion = isset($elementProperties'supportedSince') ? $elementProperties'supportedSince' : '12.0';
49
-            
50
+
51
+            $nameSpace, $elementProperties = $this->_getElementProperties($elementName);
52
+
53
+            if ($nameSpace == 'Internal') {
54
+                continue;
55
+            }
56
+
57
+            $elementVersion = $elementProperties'supportedSince' ?? '12.0';
58
+
59
             if (version_compare($device->acsversion, $elementVersion, '<')) {
60
                 continue;
61
             }
62
-            
63
+
64
             $nameSpace = 'uri:' . $nameSpace;
65
-            
66
+
67
             if (isset($elementProperties'childElement')) {
68
                 $element = $domParrent->ownerDocument->createElementNS($nameSpace, ucfirst($elementName));
69
                 foreach($value as $subValue) {
70
@@ -75,13 +75,13 @@
71
                     $element->appendChild($subElement);
72
                 }
73
                 $domParrent->appendChild($element);
74
-            } else if ($elementProperties'type' == 'container' && !empty($elementProperties'multiple')) {
75
+            } elseif ($elementProperties'type' == 'container' && !empty($elementProperties'multiple')) {
76
                 foreach ($value as $element) {
77
                     $container = $domParrent->ownerDocument->createElementNS($nameSpace, ucfirst($elementName));
78
                     $element->appendXML($container, $device);
79
                     $domParrent->appendChild($container);
80
                 }
81
-            } else if ($elementProperties'type' == 'none') {
82
+            } elseif ($elementProperties'type' == 'none') {
83
                 if ($value) {
84
                     $element = $domParrent->ownerDocument->createElementNS($nameSpace, ucfirst($elementName));
85
                     $domParrent->appendChild($element);
86
@@ -93,80 +93,80 @@
87
             }
88
         }
89
     }
90
-    
91
+
92
     /**
93
      * (non-PHPdoc)
94
      * @see Syncroton_Model_IEntry::getProperties()
95
      */
96
     public function getProperties($selectedNamespace = null)
97
     {
98
-        $properties = array();
99
-        
100
+        $properties = ;
101
+
102
         foreach($this->_properties as $namespace => $namespaceProperties) {
103
             if ($selectedNamespace !== null && $namespace != $selectedNamespace) {
104
                 continue;
105
             }
106
-            $properties = array_merge($properties, array_keys($namespaceProperties));
107
+            $properties = array_merge($properties, array_keys($namespaceProperties));
108
         }
109
-        
110
+
111
         return $properties;
112
-        
113
+
114
     }
115
-    
116
-    /**
117
-     * set properties from SimpleXMLElement object
118
-     *
119
-     * @param SimpleXMLElement $xmlCollection
120
-     * @throws InvalidArgumentException
121
-     */
122
-    public function setFromSimpleXMLElement(SimpleXMLElement $properties)
123
-    {
124
+
125
+    /**
126
+     * set properties from SimpleXMLElement object
127
+     *
128
+     * @param SimpleXMLElement $properties
129
+     * @throws InvalidArgumentException
130
+     */
131
+    public function setFromSimpleXMLElement(SimpleXMLElement $properties)
132
+    {
133
         if (!in_array($properties->getName(), (array) $this->_xmlBaseElement)) {
134
-            throw new InvalidArgumentException('Unexpected element name: ' . $properties->getName());
135
-        }
136
-    
137
+            throw new InvalidArgumentException('Unexpected element name: ' . $properties->getName());
138
+        }
139
+
140
         foreach (array_keys($this->_properties) as $namespace) {
141
             if ($namespace == 'Internal') {
142
                 continue;
143
             }
144
-            
145
-            $this->_parseNamespace($namespace, $properties);
146
-        }
147
-    
148
-        return;
149
+
150
+            $this->_parseNamespace($namespace, $properties);
151
+        }
152
+
153
+        return;
154
     }
155
-    
156
+
157
     /**
158
      * add needed xml namespaces to DomDocument
159
-     * 
160
-     * @param unknown_type $domParrent
161
+     *
162
+     * @param DOMElement $domParent
163
      */
164
-    protected function _addXMLNamespaces(DOMElement $domParrent)
165
+    protected function _addXMLNamespaces(DOMElement $domParent)
166
     {
167
-        foreach($this->_properties as $namespace => $namespaceProperties) {
168
+        foreach ($this->_properties as $namespace => $namespaceProperties) {
169
             // don't add default namespace again
170
-            if($domParrent->ownerDocument->documentElement->namespaceURI != 'uri:'.$namespace) {
171
-                $domParrent->ownerDocument->documentElement->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:'.$namespace, 'uri:'.$namespace);
172
-            }
173
+            if ($domParent->ownerDocument->documentElement->namespaceURI != 'uri:' . $namespace) {
174
+                $domParent->ownerDocument->documentElement->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:' . $namespace, 'uri:' . $namespace);
175
+            }
176
         }
177
-    }
178
-    
179
+    }
180
+
181
     protected function _appendXMLElement(Syncroton_Model_IDevice $device, DOMElement $element, $elementProperties, $value)
182
     {
183
-        if ($value instanceof Syncroton_Model_IEntry) {
184
-            $value->appendXML($element, $device);
185
-        } else {
186
-            if ($value instanceof DateTime) {
187
+        if ($value instanceof Syncroton_Model_IEntry) {
188
+            $value->appendXML($element, $device); // @phpstan-ignore-line
189
+        } else {
190
+            if ($value instanceof DateTime) {
191
                 $value = $value->format($this->_dateTimeFormat);
192
-                
193
-            } elseif (isset($elementProperties'encoding') && $elementProperties'encoding' == 'base64') {
194
-                if (is_resource($value)) {
195
+
196
+            } elseif (isset($elementProperties'encoding') && $elementProperties'encoding' == 'base64') {
197
+                if (is_resource($value)) {
198
                     rewind($value);
199
-                    $value = stream_get_contents($value);
200
-                }
201
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Model/Account.php Changed
50
 
1
@@ -14,30 +14,30 @@
2
  *
3
  * @package     Syncroton
4
  * @subpackage  Model
5
- * @property    string  accountId
6
- * @property    string  accountName
7
- * @property    string  userDisplayName
8
- * @property    bool    sendDisabled
9
- * @property    string  primaryAddress
10
- * @property    array   addresses
11
+ * @property    string  $accountId
12
+ * @property    string  $accountName
13
+ * @property    string  $userDisplayName
14
+ * @property    bool    $sendDisabled
15
+ * @property    string  $primaryAddress
16
+ * @property    array   $addresses
17
  */
18
 class Syncroton_Model_Account extends Syncroton_Model_AXMLEntry
19
 {
20
     protected $_xmlBaseElement = 'Account';
21
 
22
-    protected $_properties = array(
23
-        'Settings' => array(
24
-            'accountId'       => array('type' => 'string'),
25
-            'accountName'     => array('type' => 'string'),
26
-            'userDisplayName' => array('type' => 'string'),
27
-            'sendDisabled'    => array('type' => 'number'),
28
+    protected $_properties = 
29
+        'Settings' => 
30
+            'accountId'       => 'type' => 'string',
31
+            'accountName'     => 'type' => 'string',
32
+            'userDisplayName' => 'type' => 'string',
33
+            'sendDisabled'    => 'type' => 'number',
34
 //            'emailAddresses'  => array('type' => 'container'),
35
-        ),
36
-        'Internal' => array(
37
-            'primaryAddress' => array('type' => 'string'),
38
-            'addresses'      => array('type' => 'array'),
39
-        ),
40
-    );
41
+        ,
42
+        'Internal' => 
43
+            'primaryAddress' => 'type' => 'string',
44
+            'addresses'      => 'type' => 'array',
45
+        ,
46
+    ;
47
 
48
     /**
49
      * (non-PHPdoc)
50
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Model/Contact.php Changed
177
 
1
@@ -14,90 +14,91 @@
2
  *
3
  * @package     Syncroton
4
  * @subpackage  Model
5
- * @property    string    Alias
6
- * @property    DateTime  Anniversary
7
- * @property    string    AssistantName
8
- * @property    string    AssistantPhoneNumber
9
- * @property    DateTime  Birthday
10
- * @property    string    Business2PhoneNumber
11
- * @property    string    BusinessAddressCity
12
- * @property    Syncroton_Model_EmailBody  Body
13
+ * @property    string                      $alias
14
+ * @property    DateTime                    $anniversary
15
+ * @property    string                      $assistantName
16
+ * @property    string                      $assistantPhoneNumber
17
+ * @property    DateTime                    $birthday
18
+ * @property    string                      $business2PhoneNumber
19
+ * @property    string                      $businessAddressCity
20
+ * @property    Syncroton_Model_EmailBody   $body
21
+ * @property    string                      $firstName
22
+ * @property    string                      $lastName
23
  */
24
-
25
 class Syncroton_Model_Contact extends Syncroton_Model_AXMLEntry
26
 {
27
     protected $_xmlBaseElement = 'ApplicationData';
28
-    
29
-    protected $_properties = array(
30
-        'AirSyncBase' => array(
31
-            'body'                   => array('type' => 'container', 'class' => 'Syncroton_Model_EmailBody')
32
-        ),
33
-        'Contacts' => array(
34
-            'alias'                  => array('type' => 'string', 'supportedSince' => '14.0'),
35
-            'anniversary'            => array('type' => 'datetime'),
36
-            'assistantName'          => array('type' => 'string'),
37
-            'assistantPhoneNumber'   => array('type' => 'string'),
38
-            'birthday'               => array('type' => 'datetime'),
39
-            'business2PhoneNumber'   => array('type' => 'string'),
40
-            'businessAddressCity'    => array('type' => 'string'),
41
-            'businessAddressCountry' => array('type' => 'string'),
42
-            'businessAddressPostalCode' => array('type' => 'string'),
43
-            'businessAddressState'   => array('type' => 'string'),
44
-            'businessAddressStreet'  => array('type' => 'string'),
45
-            'businessFaxNumber'      => array('type' => 'string'),
46
-            'businessPhoneNumber'    => array('type' => 'string'),
47
-            'carPhoneNumber'         => array('type' => 'string'),
48
-            'categories'             => array('type' => 'container', 'childElement' => 'category'),
49
-            'children'               => array('type' => 'container', 'childElement' => 'child'),
50
-            'companyName'            => array('type' => 'string'),
51
-            'department'             => array('type' => 'string'),
52
-            'email1Address'          => array('type' => 'string'),
53
-            'email2Address'          => array('type' => 'string'),
54
-            'email3Address'          => array('type' => 'string'),
55
-            'fileAs'                 => array('type' => 'string'),
56
-            'firstName'              => array('type' => 'string'),
57
-            'home2PhoneNumber'       => array('type' => 'string'),
58
-            'homeAddressCity'        => array('type' => 'string'),
59
-            'homeAddressCountry'     => array('type' => 'string'),
60
-            'homeAddressPostalCode'  => array('type' => 'string'),
61
-            'homeAddressState'       => array('type' => 'string'),
62
-            'homeAddressStreet'      => array('type' => 'string'),
63
-            'homeFaxNumber'          => array('type' => 'string'),
64
-            'homePhoneNumber'        => array('type' => 'string'),
65
-            'jobTitle'               => array('type' => 'string'),
66
-            'lastName'               => array('type' => 'string'),
67
-            'middleName'             => array('type' => 'string'),
68
-            'mobilePhoneNumber'      => array('type' => 'string'),
69
-            'officeLocation'         => array('type' => 'string'),
70
-            'otherAddressCity'       => array('type' => 'string'),
71
-            'otherAddressCountry'    => array('type' => 'string'),
72
-            'otherAddressPostalCode' => array('type' => 'string'),
73
-            'otherAddressState'      => array('type' => 'string'),
74
-            'otherAddressStreet'     => array('type' => 'string'),
75
-            'pagerNumber'            => array('type' => 'string'),
76
-            'picture'                => array('type' => 'string', 'encoding' => 'base64'),
77
-            'padioPhoneNumber'       => array('type' => 'string'),
78
-            'rtf'                    => array('type' => 'string'),
79
-            'spouse'                 => array('type' => 'string'),
80
-            'suffix'                 => array('type' => 'string'),
81
-            'title'                  => array('type' => 'string'),
82
-            'webPage'                => array('type' => 'string'),
83
-            'weightedRank'           => array('type' => 'string', 'supportedSince' => '14.0'),
84
-            'yomiCompanyName'        => array('type' => 'string'),
85
-            'yomiFirstName'          => array('type' => 'string'),
86
-            'yomiLastName'           => array('type' => 'string'),
87
-        ),
88
-        'Contacts2' => array(
89
-            'accountName'            => array('type' => 'string'),
90
-            'companyMainPhone'       => array('type' => 'string'),
91
-            'customerId'             => array('type' => 'string'),
92
-            'governmentId'           => array('type' => 'string'),
93
-            'iMAddress'              => array('type' => 'string'),
94
-            'iMAddress2'             => array('type' => 'string'),
95
-            'iMAddress3'             => array('type' => 'string'),
96
-            'managerName'            => array('type' => 'string'),
97
-            'mMS'                    => array('type' => 'string'),
98
-            'nickName'               => array('type' => 'string'),
99
-        )
100
-    );
101
-}
102
\ No newline at end of file
103
+
104
+    protected $_properties = 
105
+        'AirSyncBase' => 
106
+            'body'                   => 'type' => 'container', 'class' => 'Syncroton_Model_EmailBody',
107
+        ,
108
+        'Contacts' => 
109
+            'alias'                  => 'type' => 'string', 'supportedSince' => '14.0',
110
+            'anniversary'            => 'type' => 'datetime',
111
+            'assistantName'          => 'type' => 'string',
112
+            'assistantPhoneNumber'   => 'type' => 'string',
113
+            'birthday'               => 'type' => 'datetime',
114
+            'business2PhoneNumber'   => 'type' => 'string',
115
+            'businessAddressCity'    => 'type' => 'string',
116
+            'businessAddressCountry' => 'type' => 'string',
117
+            'businessAddressPostalCode' => 'type' => 'string',
118
+            'businessAddressState'   => 'type' => 'string',
119
+            'businessAddressStreet'  => 'type' => 'string',
120
+            'businessFaxNumber'      => 'type' => 'string',
121
+            'businessPhoneNumber'    => 'type' => 'string',
122
+            'carPhoneNumber'         => 'type' => 'string',
123
+            'categories'             => 'type' => 'container', 'childElement' => 'category',
124
+            'children'               => 'type' => 'container', 'childElement' => 'child',
125
+            'companyName'            => 'type' => 'string',
126
+            'department'             => 'type' => 'string',
127
+            'email1Address'          => 'type' => 'string',
128
+            'email2Address'          => 'type' => 'string',
129
+            'email3Address'          => 'type' => 'string',
130
+            'fileAs'                 => 'type' => 'string',
131
+            'firstName'              => 'type' => 'string',
132
+            'home2PhoneNumber'       => 'type' => 'string',
133
+            'homeAddressCity'        => 'type' => 'string',
134
+            'homeAddressCountry'     => 'type' => 'string',
135
+            'homeAddressPostalCode'  => 'type' => 'string',
136
+            'homeAddressState'       => 'type' => 'string',
137
+            'homeAddressStreet'      => 'type' => 'string',
138
+            'homeFaxNumber'          => 'type' => 'string',
139
+            'homePhoneNumber'        => 'type' => 'string',
140
+            'jobTitle'               => 'type' => 'string',
141
+            'lastName'               => 'type' => 'string',
142
+            'middleName'             => 'type' => 'string',
143
+            'mobilePhoneNumber'      => 'type' => 'string',
144
+            'officeLocation'         => 'type' => 'string',
145
+            'otherAddressCity'       => 'type' => 'string',
146
+            'otherAddressCountry'    => 'type' => 'string',
147
+            'otherAddressPostalCode' => 'type' => 'string',
148
+            'otherAddressState'      => 'type' => 'string',
149
+            'otherAddressStreet'     => 'type' => 'string',
150
+            'pagerNumber'            => 'type' => 'string',
151
+            'picture'                => 'type' => 'string', 'encoding' => 'base64',
152
+            'padioPhoneNumber'       => 'type' => 'string',
153
+            'rtf'                    => 'type' => 'string',
154
+            'spouse'                 => 'type' => 'string',
155
+            'suffix'                 => 'type' => 'string',
156
+            'title'                  => 'type' => 'string',
157
+            'webPage'                => 'type' => 'string',
158
+            'weightedRank'           => 'type' => 'string', 'supportedSince' => '14.0',
159
+            'yomiCompanyName'        => 'type' => 'string',
160
+            'yomiFirstName'          => 'type' => 'string',
161
+            'yomiLastName'           => 'type' => 'string',
162
+        ,
163
+        'Contacts2' => 
164
+            'accountName'            => 'type' => 'string',
165
+            'companyMainPhone'       => 'type' => 'string',
166
+            'customerId'             => 'type' => 'string',
167
+            'governmentId'           => 'type' => 'string',
168
+            'iMAddress'              => 'type' => 'string',
169
+            'iMAddress2'             => 'type' => 'string',
170
+            'iMAddress3'             => 'type' => 'string',
171
+            'managerName'            => 'type' => 'string',
172
+            'mMS'                    => 'type' => 'string',
173
+            'nickName'               => 'type' => 'string',
174
+        ,
175
+    ;
176
+}
177
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Model/Content.php Changed
6
 
1
@@ -18,4 +18,3 @@
2
 class Syncroton_Model_Content extends Syncroton_Model_AEntry implements Syncroton_Model_IContent
3
 {
4
 }
5
-
6
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Model/Device.php Changed
52
 
1
@@ -17,37 +17,36 @@
2
  */
3
 class Syncroton_Model_Device extends Syncroton_Model_AEntry implements Syncroton_Model_IDevice
4
 {
5
-    const TYPE_IPHONE          = 'iphone';
6
-    const TYPE_WEBOS           = 'webos';
7
-    const TYPE_ANDROID         = 'android';
8
-    const TYPE_ANDROID_40      = 'android40';
9
-    const TYPE_SMASUNGGALAXYS2 = 'samsunggti9100'; // Samsung Galaxy S-3
10
-    const TYPE_BLACKBERRY      = 'blackberry';
11
-    
12
+    public const TYPE_IPHONE          = 'iphone';
13
+    public const TYPE_WEBOS           = 'webos';
14
+    public const TYPE_ANDROID         = 'android';
15
+    public const TYPE_ANDROID_40      = 'android40';
16
+    public const TYPE_SMASUNGGALAXYS2 = 'samsunggti9100'; // Samsung Galaxy S-3
17
+    public const TYPE_BLACKBERRY      = 'blackberry';
18
+
19
     /**
20
      * Returns major firmware version of this device
21
-     * 
22
-     * @return int/string
23
+     *
24
+     * @return int|string
25
      */
26
     public function getMajorVersion()
27
     {
28
         switch (strtolower($this->devicetype)) {
29
             case Syncroton_Model_Device::TYPE_BLACKBERRY:
30
                 if (preg_match('/(.+)\/(.+)/', $this->useragent, $matches)) {
31
-                    list(, $name, $version) = $matches;
32
+                    , $name, $version = $matches;
33
                     return $version;
34
                 }
35
                 break;
36
-                
37
+
38
             case Syncroton_Model_Device::TYPE_IPHONE:
39
                 if (preg_match('/(.+)\/(\d+)\.(\d+)/', $this->useragent, $matches)) {
40
-                    list(, $name, $majorVersion, $minorVersion) = $matches;
41
+                    , $name, $majorVersion, $minorVersion = $matches;
42
                     return $majorVersion;
43
                 }
44
                 break;
45
         }
46
-        
47
+
48
         return 0;
49
     }
50
 }
51
-
52
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Model/DeviceInformation.php Changed
53
 
1
@@ -14,29 +14,29 @@
2
  *
3
  * @package     Syncroton
4
  * @subpackage  Model
5
- * @property    string  friendlyName
6
- * @property    string  iMEI
7
- * @property    string  mobileOperator
8
- * @property    string  model
9
- * @property    string  oS
10
- * @property    string  oSLanguage
11
- * @property    string  phoneNumber
12
+ * @property    string  $friendlyName
13
+ * @property    string  $iMEI
14
+ * @property    string  $mobileOperator
15
+ * @property    string  $model
16
+ * @property    string  $oS
17
+ * @property    string  $oSLanguage
18
+ * @property    string  $phoneNumber
19
  */
20
 
21
 class Syncroton_Model_DeviceInformation extends Syncroton_Model_AXMLEntry
22
 {
23
     protected $_xmlBaseElement = 'Set';
24
-    
25
-    protected $_properties = array(
26
-        'Settings' => array(
27
-            'enableOutboundSMS' => array('type' => 'number'),
28
-            'friendlyName'      => array('type' => 'string'),
29
-            'iMEI'              => array('type' => 'string'),
30
-            'mobileOperator'    => array('type' => 'string'),
31
-            'model'             => array('type' => 'string'),
32
-            'oS'                => array('type' => 'string'),
33
-            'oSLanguage'        => array('type' => 'string'),
34
-            'phoneNumber'       => array('type' => 'string')
35
-        ),
36
-    );
37
-}
38
\ No newline at end of file
39
+
40
+    protected $_properties = 
41
+        'Settings' => 
42
+            'enableOutboundSMS' => 'type' => 'number',
43
+            'friendlyName'      => 'type' => 'string',
44
+            'iMEI'              => 'type' => 'string',
45
+            'mobileOperator'    => 'type' => 'string',
46
+            'model'             => 'type' => 'string',
47
+            'oS'                => 'type' => 'string',
48
+            'oSLanguage'        => 'type' => 'string',
49
+            'phoneNumber'       => 'type' => 'string',
50
+        ,
51
+    ;
52
+}
53
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Model/Email.php Changed
148
 
1
@@ -14,77 +14,77 @@
2
  *
3
  * @package     Syncroton
4
  * @subpackage  Model
5
- * @property    array     attachments
6
- * @property    string    contentType
7
- * @property    array     flag
8
- * @property    Syncroton_Model_EmailBody    body
9
- * @property    array     cc
10
- * @property    array     to
11
- * @property    int       lastVerbExecuted
12
- * @property    DateTime  lastVerbExecutionTime
13
- * @property    int       read
14
+ * @property    array                       $attachments
15
+ * @property    string                      $contentType
16
+ * @property    array                       $flag
17
+ * @property    Syncroton_Model_EmailBody   $body
18
+ * @property    array                       $cc
19
+ * @property    array                       $to
20
+ * @property    int                         $lastVerbExecuted
21
+ * @property    DateTime                    $lastVerbExecutionTime
22
+ * @property    int                         $read
23
  */
24
 class Syncroton_Model_Email extends Syncroton_Model_AXMLEntry
25
 {
26
-    const LASTVERB_UNKNOWN       = 0;
27
-    const LASTVERB_REPLYTOSENDER = 1;
28
-    const LASTVERB_REPLYTOALL    = 2;
29
-    const LASTVERB_FORWARD       = 3;
30
-    
31
+    public const LASTVERB_UNKNOWN       = 0;
32
+    public const LASTVERB_REPLYTOSENDER = 1;
33
+    public const LASTVERB_REPLYTOALL    = 2;
34
+    public const LASTVERB_FORWARD       = 3;
35
+
36
     protected $_xmlBaseElement = 'ApplicationData';
37
-    
38
-    protected $_properties = array(
39
-        'AirSyncBase' => array(
40
-            'attachments'             => array('type' => 'container', 'childElement' => 'attachment', 'class' => 'Syncroton_Model_EmailAttachment'),
41
-            'contentType'             => array('type' => 'string'),
42
-            'body'                    => array('type' => 'container', 'class' => 'Syncroton_Model_EmailBody'),
43
-            'nativeBodyType'          => array('type' => 'number'),
44
-        ),
45
-        'Email' => array(
46
-            'busyStatus'              => array('type' => 'number'),
47
-            'categories'              => array('type' => 'container', 'childElement' => 'category', 'supportedSince' => '14.0'),
48
-            'cc'                      => array('type' => 'string'),
49
-            'completeTime'            => array('type' => 'datetime'),
50
-            'contentClass'            => array('type' => 'string'),
51
-            'dateReceived'            => array('type' => 'datetime'),
52
-            'disallowNewTimeProposal' => array('type' => 'number'),
53
-            'displayTo'               => array('type' => 'string'),
54
-            'dTStamp'                 => array('type' => 'datetime'),
55
-            'endTime'                 => array('type' => 'datetime'),
56
-            'flag'                    => array('type' => 'container', 'class' => 'Syncroton_Model_EmailFlag'),
57
-            'from'                    => array('type' => 'string'),
58
-            'globalObjId'             => array('type' => 'string'),
59
-            'importance'              => array('type' => 'number'),
60
-            'instanceType'            => array('type' => 'number'),
61
-            'internetCPID'            => array('type' => 'string'),
62
-            'location'                => array('type' => 'string'),
63
-            'meetingRequest'          => array('type' => 'container', 'class' => 'Syncroton_Model_EmailMeetingRequest'),
64
-            'messageClass'            => array('type' => 'string'),
65
-            'organizer'               => array('type' => 'string'),
66
-            'read'                    => array('type' => 'number'),
67
-            'recurrences'             => array('type' => 'container'),
68
-            'reminder'                => array('type' => 'number'),
69
-            'replyTo'                 => array('type' => 'string'),
70
-            'responseRequested'       => array('type' => 'number'),
71
-            'sensitivity'             => array('type' => 'number'),
72
-            'startTime'               => array('type' => 'datetime'),
73
-            'status'                  => array('type' => 'number'),
74
-            'subject'                 => array('type' => 'string'),
75
-            'threadTopic'             => array('type' => 'string'),
76
-            'timeZone'                => array('type' => 'timezone'),
77
-            'to'                      => array('type' => 'string'),
78
-        ),
79
-        'Email2' => array(
80
-            'accountId'             => array('type' => 'string', 'supportedSince' => '14.1'),
81
-            'conversationId'        => array('type' => 'byteArray', 'supportedSince' => '14.0'),
82
-            'conversationIndex'     => array('type' => 'byteArray', 'supportedSince' => '14.0'),
83
-            'lastVerbExecuted'      => array('type' => 'number', 'supportedSince' => '14.0'),
84
-            'lastVerbExecutionTime' => array('type' => 'datetime', 'supportedSince' => '14.0'),
85
-            'meetingMessageType'    => array('type' => 'number', 'supportedSince' => '14.1'),
86
-            'receivedAsBcc'         => array('type' => 'number', 'supportedSince' => '14.0'),
87
-            'sender'                => array('type' => 'string', 'supportedSince' => '14.0'),
88
-            'umCallerID'            => array('type' => 'string', 'supportedSince' => '14.0'),
89
-            'umUserNotes'           => array('type' => 'string', 'supportedSince' => '14.0'),
90
-        ),
91
-    );
92
+
93
+    protected $_properties = 
94
+        'AirSyncBase' => 
95
+            'attachments'             => 'type' => 'container', 'childElement' => 'attachment', 'class' => 'Syncroton_Model_EmailAttachment',
96
+            'contentType'             => 'type' => 'string',
97
+            'body'                    => 'type' => 'container', 'class' => 'Syncroton_Model_EmailBody',
98
+            'nativeBodyType'          => 'type' => 'number',
99
+        ,
100
+        'Email' => 
101
+            'busyStatus'              => 'type' => 'number',
102
+            'categories'              => 'type' => 'container', 'childElement' => 'category', 'supportedSince' => '14.0',
103
+            'cc'                      => 'type' => 'string',
104
+            'completeTime'            => 'type' => 'datetime',
105
+            'contentClass'            => 'type' => 'string',
106
+            'dateReceived'            => 'type' => 'datetime',
107
+            'disallowNewTimeProposal' => 'type' => 'number',
108
+            'displayTo'               => 'type' => 'string',
109
+            'dTStamp'                 => 'type' => 'datetime',
110
+            'endTime'                 => 'type' => 'datetime',
111
+            'flag'                    => 'type' => 'container', 'class' => 'Syncroton_Model_EmailFlag',
112
+            'from'                    => 'type' => 'string',
113
+            'globalObjId'             => 'type' => 'string',
114
+            'importance'              => 'type' => 'number',
115
+            'instanceType'            => 'type' => 'number',
116
+            'internetCPID'            => 'type' => 'string',
117
+            'location'                => 'type' => 'string',
118
+            'meetingRequest'          => 'type' => 'container', 'class' => 'Syncroton_Model_EmailMeetingRequest',
119
+            'messageClass'            => 'type' => 'string',
120
+            'organizer'               => 'type' => 'string',
121
+            'read'                    => 'type' => 'number',
122
+            'recurrences'             => 'type' => 'container',
123
+            'reminder'                => 'type' => 'number',
124
+            'replyTo'                 => 'type' => 'string',
125
+            'responseRequested'       => 'type' => 'number',
126
+            'sensitivity'             => 'type' => 'number',
127
+            'startTime'               => 'type' => 'datetime',
128
+            'status'                  => 'type' => 'number',
129
+            'subject'                 => 'type' => 'string',
130
+            'threadTopic'             => 'type' => 'string',
131
+            'timeZone'                => 'type' => 'timezone',
132
+            'to'                      => 'type' => 'string',
133
+        ,
134
+        'Email2' => 
135
+            'accountId'             => 'type' => 'string', 'supportedSince' => '14.1',
136
+            'conversationId'        => 'type' => 'byteArray', 'supportedSince' => '14.0',
137
+            'conversationIndex'     => 'type' => 'byteArray', 'supportedSince' => '14.0',
138
+            'lastVerbExecuted'      => 'type' => 'number', 'supportedSince' => '14.0',
139
+            'lastVerbExecutionTime' => 'type' => 'datetime', 'supportedSince' => '14.0',
140
+            'meetingMessageType'    => 'type' => 'number', 'supportedSince' => '14.1',
141
+            'receivedAsBcc'         => 'type' => 'number', 'supportedSince' => '14.0',
142
+            'sender'                => 'type' => 'string', 'supportedSince' => '14.0',
143
+            'umCallerID'            => 'type' => 'string', 'supportedSince' => '14.0',
144
+            'umUserNotes'           => 'type' => 'string', 'supportedSince' => '14.0',
145
+        ,
146
+    ;
147
 }
148
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Model/EmailAttachment.php Changed
56
 
1
@@ -14,30 +14,30 @@
2
  *
3
  * @package     Syncroton
4
  * @subpackage  Model
5
- * @property    string  class
6
- * @property    string  collectionId
7
- * @property    bool    deletesAsMoves
8
- * @property    bool    getChanges
9
- * @property    string  syncKey
10
- * @property    int     windowSize
11
+ * @property    string  $class
12
+ * @property    string  $collectionId
13
+ * @property    bool    $deletesAsMoves
14
+ * @property    bool    $getChanges
15
+ * @property    string  $syncKey
16
+ * @property    int     $windowSize
17
  */
18
 class Syncroton_Model_EmailAttachment extends Syncroton_Model_AXMLEntry
19
 {
20
     protected $_xmlBaseElement = 'Attachment';
21
-    
22
-    protected $_properties = array(
23
-        'AirSyncBase' => array(
24
-            'contentId'               => array('type' => 'string'),
25
-            'contentLocation'         => array('type' => 'string'),
26
-            'displayName'             => array('type' => 'string'),
27
-            'estimatedDataSize'       => array('type' => 'string'),
28
-            'fileReference'           => array('type' => 'string'),
29
-            'isInline'                => array('type' => 'number'),
30
-            'method'                  => array('type' => 'string'),
31
-        ),
32
-        'Email2' => array(
33
-            'umAttDuration'         => array('type' => 'number', 'supportedSince' => '14.0'),
34
-            'umAttOrder'            => array('type' => 'number', 'supportedSince' => '14.0'),
35
-        ),
36
-    );
37
-}
38
\ No newline at end of file
39
+
40
+    protected $_properties = 
41
+        'AirSyncBase' => 
42
+            'contentId'               => 'type' => 'string',
43
+            'contentLocation'         => 'type' => 'string',
44
+            'displayName'             => 'type' => 'string',
45
+            'estimatedDataSize'       => 'type' => 'string',
46
+            'fileReference'           => 'type' => 'string',
47
+            'isInline'                => 'type' => 'number',
48
+            'method'                  => 'type' => 'string',
49
+        ,
50
+        'Email2' => 
51
+            'umAttDuration'         => 'type' => 'number', 'supportedSince' => '14.0',
52
+            'umAttOrder'            => 'type' => 'number', 'supportedSince' => '14.0',
53
+        ,
54
+    ;
55
+}
56
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Model/EmailBody.php Changed
57
 
1
@@ -14,31 +14,31 @@
2
  *
3
  * @package     Syncroton
4
  * @subpackage  Model
5
- * @property   int     EstimatedDataSize
6
- * @property   string  Data
7
- * @property   string  Part
8
- * @property   string  Preview
9
- * @property   bool    Truncated
10
- * @property   string  Type
11
+ * @property   int     $estimatedDataSize
12
+ * @property   string  $data
13
+ * @property   string  $part
14
+ * @property   string  $preview
15
+ * @property   bool    $truncated
16
+ * @property   string  $type
17
  */
18
 
19
 class Syncroton_Model_EmailBody extends Syncroton_Model_AXMLEntry
20
 {
21
-    const TYPE_PLAINTEXT = 1;
22
-    const TYPE_HTML      = 2;
23
-    const TYPE_RTF       = 3;
24
-    const TYPE_MIME      = 4;
25
-    
26
+    public const TYPE_PLAINTEXT = 1;
27
+    public const TYPE_HTML      = 2;
28
+    public const TYPE_RTF       = 3;
29
+    public const TYPE_MIME      = 4;
30
+
31
     protected $_xmlBaseElement = 'Body';
32
-    
33
-    protected $_properties = array(
34
-        'AirSyncBase' => array(
35
-            'type'              => array('type' => 'string'),
36
-            'estimatedDataSize' => array('type' => 'string'),
37
-            'data'              => array('type' => 'string'),
38
-            'truncated'         => array('type' => 'number'),
39
-            'part'              => array('type' => 'number'),
40
-            'preview'           => array('type' => 'string', 'supportedSince' => '14.0'),
41
-        ),
42
-    );
43
-}
44
\ No newline at end of file
45
+
46
+    protected $_properties = 
47
+        'AirSyncBase' => 
48
+            'type'              => 'type' => 'string',
49
+            'estimatedDataSize' => 'type' => 'string',
50
+            'data'              => 'type' => 'string',
51
+            'truncated'         => 'type' => 'number',
52
+            'part'              => 'type' => 'number',
53
+            'preview'           => 'type' => 'string', 'supportedSince' => '14.0',
54
+        ,
55
+    ;
56
+}
57
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Model/EmailFlag.php Changed
82
 
1
@@ -16,45 +16,45 @@
2
  *
3
  * @package     Syncroton
4
  * @subpackage  Model
5
- * @property    DateTime  CompleteTime
6
- * @property    DateTime  DateCompleted
7
- * @property    DateTime  DueDate
8
- * @property    string    FlagType
9
- * @property    DateTime  OrdinalDate
10
- * @property    int       ReminderSet
11
- * @property    DateTime  ReminderTime
12
- * @property    DateTime  StartDate
13
- * @property    string    Status
14
- * @property    string    Subject
15
- * @property    string    SubOrdinalDate
16
- * @property    DateTime  UtcDueDate
17
- * @property    DateTime  UtcStartDate
18
+ * @property    DateTime  $completeTime
19
+ * @property    DateTime  $dateCompleted
20
+ * @property    DateTime  $dueDate
21
+ * @property    string    $flagType
22
+ * @property    DateTime  $ordinalDate
23
+ * @property    int       $reminderSet
24
+ * @property    DateTime  $reminderTime
25
+ * @property    DateTime  $startDate
26
+ * @property    string    $status
27
+ * @property    string    $subject
28
+ * @property    string    $subOrdinalDate
29
+ * @property    DateTime  $utcDueDate
30
+ * @property    DateTime  $utcStartDate
31
  */
32
 class Syncroton_Model_EmailFlag extends Syncroton_Model_AXMLEntry
33
 {
34
-    const STATUS_CLEARED  = 0;
35
-    const STATUS_COMPLETE = 1;
36
-    const STATUS_ACTIVE   = 2;
37
+    public const STATUS_CLEARED  = 0;
38
+    public const STATUS_COMPLETE = 1;
39
+    public const STATUS_ACTIVE   = 2;
40
 
41
     protected $_xmlBaseElement = 'Flag';
42
 
43
-    protected $_properties = array(
44
-        'Email' => array(
45
-            'completeTime'       => array('type' => 'datetime'),
46
-            'flagType'           => array('type' => 'string'),
47
-            'status'             => array('type' => 'number'),
48
-        ),
49
-        'Tasks' => array(
50
-            'dateCompleted'      => array('type' => 'datetime'),
51
-            'dueDate'            => array('type' => 'datetime'),
52
-            'ordinalDate'        => array('type' => 'datetime'),
53
-            'reminderSet'        => array('type' => 'number'),
54
-            'reminderTime'       => array('type' => 'datetime'),
55
-            'startDate'          => array('type' => 'datetime'),
56
-            'subject'            => array('type' => 'string'),
57
-            'subOrdinalDate'     => array('type' => 'string'),
58
-            'utcStartDate'       => array('type' => 'datetime'),
59
-            'utcDueDate'         => array('type' => 'datetime'),
60
-        ),
61
-    );
62
+    protected $_properties = 
63
+        'Email' => 
64
+            'completeTime'       => 'type' => 'datetime',
65
+            'flagType'           => 'type' => 'string',
66
+            'status'             => 'type' => 'number',
67
+        ,
68
+        'Tasks' => 
69
+            'dateCompleted'      => 'type' => 'datetime',
70
+            'dueDate'            => 'type' => 'datetime',
71
+            'ordinalDate'        => 'type' => 'datetime',
72
+            'reminderSet'        => 'type' => 'number',
73
+            'reminderTime'       => 'type' => 'datetime',
74
+            'startDate'          => 'type' => 'datetime',
75
+            'subject'            => 'type' => 'string',
76
+            'subOrdinalDate'     => 'type' => 'string',
77
+            'utcStartDate'       => 'type' => 'datetime',
78
+            'utcDueDate'         => 'type' => 'datetime',
79
+        ,
80
+    ;
81
 }
82
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Model/EmailMeetingRequest.php Changed
143
 
1
@@ -14,83 +14,83 @@
2
  *
3
  * @package     Syncroton
4
  * @subpackage  Model
5
- * @property    bool     AllDayEvent
6
- * @property    int      BusyStatus
7
- * @property    int      DisallowNewTimeProposal
8
- * @property    DateTime DtStamp
9
- * @property    DateTime EndTime
10
- * @property    string   GlobalObjId
11
- * @property    int      InstanceType
12
- * @property    int      MeetingMessageType
13
- * @property    string   Organizer
14
- * @property    string   RecurrenceId
15
- * @property    array    Recurrences
16
- * @property    int      Reminder
17
- * @property    int      ResponseRequested
18
- * @property    int      Sensitivity
19
- * @property    DateTime StartTime
20
- * @property    string   Timezone
21
+ * @property    bool     $allDayEvent
22
+ * @property    int      $busyStatus
23
+ * @property    int      $disallowNewTimeProposal
24
+ * @property    DateTime $dtStamp
25
+ * @property    DateTime $endTime
26
+ * @property    string   $globalObjId
27
+ * @property    int      $instanceType
28
+ * @property    int      $meetingMessageType
29
+ * @property    string   $organizer
30
+ * @property    string   $recurrenceId
31
+ * @property    array    $recurrences
32
+ * @property    int      $reminder
33
+ * @property    int      $responseRequested
34
+ * @property    int      $sensitivity
35
+ * @property    DateTime $startTime
36
+ * @property    string   $timezone
37
  */
38
 class Syncroton_Model_EmailMeetingRequest extends Syncroton_Model_AXMLEntry
39
 {
40
     /**
41
      * busy status constants
42
      */
43
-    const BUSY_STATUS_FREE      = 0;
44
-    const BUSY_STATUS_TENATTIVE = 1;
45
-    const BUSY_STATUS_BUSY      = 2;
46
-    const BUSY_STATUS_OUT       = 3;
47
+    public const BUSY_STATUS_FREE      = 0;
48
+    public const BUSY_STATUS_TENATTIVE = 1;
49
+    public const BUSY_STATUS_BUSY      = 2;
50
+    public const BUSY_STATUS_OUT       = 3;
51
 
52
     /**
53
      * sensitivity constants
54
      */
55
-    const SENSITIVITY_NORMAL       = 0;
56
-    const SENSITIVITY_PERSONAL     = 1;
57
-    const SENSITIVITY_PRIVATE      = 2;
58
-    const SENSITIVITY_CONFIDENTIAL = 3;
59
+    public const SENSITIVITY_NORMAL       = 0;
60
+    public const SENSITIVITY_PERSONAL     = 1;
61
+    public const SENSITIVITY_PRIVATE      = 2;
62
+    public const SENSITIVITY_CONFIDENTIAL = 3;
63
 
64
     /**
65
      * instanceType constants
66
      */
67
-    const TYPE_NORMAL              = 0;
68
-    const TYPE_RECURRING_MASTER    = 1;
69
-    const TYPE_RECURRING_SINGLE    = 2;
70
-    const TYPE_RECURRING_EXCEPTION = 3;
71
+    public const TYPE_NORMAL              = 0;
72
+    public const TYPE_RECURRING_MASTER    = 1;
73
+    public const TYPE_RECURRING_SINGLE    = 2;
74
+    public const TYPE_RECURRING_EXCEPTION = 3;
75
 
76
     /**
77
      * messageType constants
78
      */
79
-    const MESSAGE_TYPE_NORMAL      = 0;
80
-    const MESSAGE_TYPE_REQUEST     = 1;
81
-    const MESSAGE_TYPE_FULL_UPDATE = 2;
82
-    const MESSAGE_TYPE_INFO_UPDATE = 3;
83
-    const MESSAGE_TYPE_OUTDATED    = 4;
84
-    const MESSAGE_TYPE_COPY        = 5;
85
-    const MESSAGE_TYPE_DELEGATED   = 6;
86
+    public const MESSAGE_TYPE_NORMAL      = 0;
87
+    public const MESSAGE_TYPE_REQUEST     = 1;
88
+    public const MESSAGE_TYPE_FULL_UPDATE = 2;
89
+    public const MESSAGE_TYPE_INFO_UPDATE = 3;
90
+    public const MESSAGE_TYPE_OUTDATED    = 4;
91
+    public const MESSAGE_TYPE_COPY        = 5;
92
+    public const MESSAGE_TYPE_DELEGATED   = 6;
93
 
94
     protected $_xmlBaseElement = 'MeetingRequest';
95
 
96
-    protected $_properties = array(
97
-        'Email' => array(
98
-            'allDayEvent'               => array('type' => 'number'),
99
-            'busyStatus'                => array('type' => 'number'),
100
-            'disallowNewTimeProposal'   => array('type' => 'number'),
101
-            'dtStamp'                   => array('type' => 'datetime'),
102
-            'endTime'                   => array('type' => 'datetime'),
103
-            'globalObjId'               => array('type' => 'string'),
104
-            'instanceType'              => array('type' => 'number'),
105
-            'location'                  => array('type' => 'string'),
106
-            'organizer'                 => array('type' => 'string'), //e-mail address
107
-            'recurrenceId'              => array('type' => 'datetime'),
108
-            'recurrences'               => array('type' => 'container'),
109
-            'reminder'                  => array('type' => 'number'),
110
-            'responseRequested'         => array('type' => 'number'),
111
-            'sensitivity'               => array('type' => 'number'),
112
-            'startTime'                 => array('type' => 'datetime'),
113
-            'timeZone'                  => array('type' => 'timezone'),
114
-        ),
115
-        'Email2' => array(
116
-            'meetingMessageType'        => array('type' => 'number'),
117
-        ),
118
-    );
119
+    protected $_properties = 
120
+        'Email' => 
121
+            'allDayEvent'               => 'type' => 'number',
122
+            'busyStatus'                => 'type' => 'number',
123
+            'disallowNewTimeProposal'   => 'type' => 'number',
124
+            'dtStamp'                   => 'type' => 'datetime',
125
+            'endTime'                   => 'type' => 'datetime',
126
+            'globalObjId'               => 'type' => 'string',
127
+            'instanceType'              => 'type' => 'number',
128
+            'location'                  => 'type' => 'string',
129
+            'organizer'                 => 'type' => 'string', //e-mail address
130
+            'recurrenceId'              => 'type' => 'datetime',
131
+            'recurrences'               => 'type' => 'container',
132
+            'reminder'                  => 'type' => 'number',
133
+            'responseRequested'         => 'type' => 'number',
134
+            'sensitivity'               => 'type' => 'number',
135
+            'startTime'                 => 'type' => 'datetime',
136
+            'timeZone'                  => 'type' => 'timezone',
137
+        ,
138
+        'Email2' => 
139
+            'meetingMessageType'        => 'type' => 'number',
140
+        ,
141
+    ;
142
 }
143
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Model/EmailRecurrence.php Changed
104
 
1
@@ -14,19 +14,18 @@
2
  *
3
  * @package     Syncroton
4
  * @subpackage  Model
5
- * @property    int       CalendarType
6
- * @property    int       DayOfMonth
7
- * @property    int       DayOfWeek
8
- * @property    int       FirstDayOfWeek
9
- * @property    int       Interval
10
- * @property    int       IsLeapMonth
11
- * @property    int       MonthOfYear
12
- * @property    int       Occurrences
13
- * @property    int       Type
14
- * @property    DateTime  Until
15
- * @property    int       WeekOfMonth
16
+ * @property    int       $calendarType
17
+ * @property    int       $dayOfMonth
18
+ * @property    int       $dayOfWeek
19
+ * @property    int       $firstDayOfWeek
20
+ * @property    int       $interval
21
+ * @property    int       $isLeapMonth
22
+ * @property    int       $monthOfYear
23
+ * @property    int       $occurrences
24
+ * @property    int       $type
25
+ * @property    DateTime  $until
26
+ * @property    int       $weekOfMonth
27
  */
28
-
29
 class Syncroton_Model_EmailRecurrence extends Syncroton_Model_AXMLEntry
30
 {
31
     protected $_xmlBaseElement = 'Recurrence';
32
@@ -34,41 +33,41 @@
33
     /**
34
      * recur types
35
      */
36
-    const TYPE_DAILY          = 0;     // Recurs daily
37
-    const TYPE_WEEKLY         = 1;     // Recurs weekly
38
-    const TYPE_MONTHLY        = 3;     // Recurs monthly
39
-    const TYPE_MONTHLY_DAYN   = 2;     // Recurs monthly on the nth day
40
-    const TYPE_YEARLY         = 5;     // Recurs yearly on the nth day of the nth month each year
41
-    const TYPE_YEARLY_DAYN    = 6;     // Recurs yearly on the nth day of the week of the nth month
42
+    public const TYPE_DAILY          = 0;     // Recurs daily
43
+    public const TYPE_WEEKLY         = 1;     // Recurs weekly
44
+    public const TYPE_MONTHLY        = 3;     // Recurs monthly
45
+    public const TYPE_MONTHLY_DAYN   = 2;     // Recurs monthly on the nth day
46
+    public const TYPE_YEARLY         = 5;     // Recurs yearly on the nth day of the nth month each year
47
+    public const TYPE_YEARLY_DAYN    = 6;     // Recurs yearly on the nth day of the week of the nth month
48
 
49
     /**
50
      * day of week constants
51
      */
52
-    const RECUR_DOW_SUNDAY      = 1;
53
-    const RECUR_DOW_MONDAY      = 2;
54
-    const RECUR_DOW_TUESDAY     = 4;
55
-    const RECUR_DOW_WEDNESDAY   = 8;
56
-    const RECUR_DOW_THURSDAY    = 16;
57
-    const RECUR_DOW_FRIDAY      = 32;
58
-    const RECUR_DOW_SATURDAY    = 64;
59
+    public const RECUR_DOW_SUNDAY      = 1;
60
+    public const RECUR_DOW_MONDAY      = 2;
61
+    public const RECUR_DOW_TUESDAY     = 4;
62
+    public const RECUR_DOW_WEDNESDAY   = 8;
63
+    public const RECUR_DOW_THURSDAY    = 16;
64
+    public const RECUR_DOW_FRIDAY      = 32;
65
+    public const RECUR_DOW_SATURDAY    = 64;
66
 
67
     protected $_dateTimeFormat = "Ymd\THis\Z";
68
 
69
-    protected $_properties = array(
70
-        'Email' => array(
71
-            'dayOfMonth'     => array('type' => 'number'),
72
-            'dayOfWeek'      => array('type' => 'number'),
73
-            'interval'       => array('type' => 'number'), // 1 or 2
74
-            'monthOfYear'    => array('type' => 'number'),
75
-            'occurrences'    => array('type' => 'number'),
76
-            'type'           => array('type' => 'number'),
77
-            'until'          => array('type' => 'datetime'),
78
-            'weekOfMonth'    => array('type' => 'number'),
79
-        ),
80
-        'Email2' => array(
81
-            'calendarType'   => array('type' => 'number'),
82
-            'firstDayOfWeek' => array('type' => 'number'),
83
-            'isLeapMonth'    => array('type' => 'number'),
84
-        )
85
-    );
86
+    protected $_properties = 
87
+        'Email' => 
88
+            'dayOfMonth'     => 'type' => 'number',
89
+            'dayOfWeek'      => 'type' => 'number',
90
+            'interval'       => 'type' => 'number', // 1 or 2
91
+            'monthOfYear'    => 'type' => 'number',
92
+            'occurrences'    => 'type' => 'number',
93
+            'type'           => 'type' => 'number',
94
+            'until'          => 'type' => 'datetime',
95
+            'weekOfMonth'    => 'type' => 'number',
96
+        ,
97
+        'Email2' => 
98
+            'calendarType'   => 'type' => 'number',
99
+            'firstDayOfWeek' => 'type' => 'number',
100
+            'isLeapMonth'    => 'type' => 'number',
101
+        ,
102
+    ;
103
 }
104
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Model/Event.php Changed
175
 
1
@@ -14,59 +14,62 @@
2
  *
3
  * @package     Syncroton
4
  * @subpackage  Model
5
- * @property    string  class
6
- * @property    string  collectionId
7
- * @property    bool    deletesAsMoves
8
- * @property    bool    getChanges
9
- * @property    string  syncKey
10
- * @property    int     windowSize
11
+ *
12
+ * @property  bool     $allDayEvent
13
+ * @property  string   $class
14
+ * @property  string   $collectionId
15
+ * @property  bool     $deletesAsMoves
16
+ * @property  DateTime $endTime
17
+ * @property  bool     $getChanges
18
+ * @property  DateTime $startTime
19
+ * @property  string   $syncKey
20
+ * @property  int      $windowSize
21
  */
22
-
23
 class Syncroton_Model_Event extends Syncroton_Model_AXMLEntry
24
 {
25
-    /**
26
-     * busy status constants
27
-     */
28
-    const BUSY_STATUS_FREE      = 0;
29
-    const BUSY_STATUS_TENATTIVE = 1;
30
-    const BUSY_STATUS_BUSY      = 2;
31
-    
32
-    protected $_dateTimeFormat = "Ymd\THis\Z";
33
-    
34
+    /**
35
+     * busy status constants
36
+     */
37
+    public const BUSY_STATUS_FREE      = 0;
38
+    public const BUSY_STATUS_TENATTIVE = 1;
39
+    public const BUSY_STATUS_BUSY      = 2;
40
+
41
+    protected $_dateTimeFormat = "Ymd\THis\Z";
42
+
43
     protected $_xmlBaseElement = 'ApplicationData';
44
-    
45
-    protected $_properties = array(
46
-        'AirSyncBase' => array(
47
-            'body'                      => array('type' => 'container', 'class' => 'Syncroton_Model_EmailBody')
48
-        ),
49
-        'Calendar' => array(
50
-            'allDayEvent'               => array('type' => 'number'),
51
-            'appointmentReplyTime'      => array('type' => 'datetime'),
52
-            'attendees'                 => array('type' => 'container', 'childElement' => 'attendee', 'class' => 'Syncroton_Model_EventAttendee'),
53
-            'busyStatus'                => array('type' => 'number'),
54
-            'categories'                => array('type' => 'container', 'childElement' => 'category'),
55
-            'disallowNewTimeProposal'   => array('type' => 'number'),
56
-            'dtStamp'                   => array('type' => 'datetime'),
57
-            'endTime'                   => array('type' => 'datetime'),
58
-            'exceptions'                => array('type' => 'container', 'childElement' => 'exception', 'class' => 'Syncroton_Model_EventException'),
59
-            'location'                  => array('type' => 'string'),
60
-            'meetingStatus'             => array('type' => 'number'),
61
-            'onlineMeetingConfLink'     => array('type' => 'string'),
62
-            'onlineMeetingExternalLink' => array('type' => 'string'),
63
-            'organizerEmail'            => array('type' => 'string'),
64
-            'organizerName'             => array('type' => 'string'),
65
-            'recurrence'                => array('type' => 'container'),
66
-            'reminder'                  => array('type' => 'number'),
67
-            'responseRequested'         => array('type' => 'number'),
68
-            'responseType'              => array('type' => 'number'),
69
-            'sensitivity'               => array('type' => 'number'),
70
-            'startTime'                 => array('type' => 'datetime'),
71
-            'subject'                   => array('type' => 'string'),
72
-            'timezone'                  => array('type' => 'timezone'),
73
-            'uID'                       => array('type' => 'string'),
74
-        )
75
-    );
76
-    
77
+
78
+    protected $_properties = 
79
+        'AirSyncBase' => 
80
+            'body'                      => 'type' => 'container', 'class' => 'Syncroton_Model_EmailBody',
81
+        ,
82
+        'Calendar' => 
83
+            'allDayEvent'               => 'type' => 'number',
84
+            'appointmentReplyTime'      => 'type' => 'datetime',
85
+            'attendees'                 => 'type' => 'container', 'childElement' => 'attendee', 'class' => 'Syncroton_Model_EventAttendee',
86
+            'busyStatus'                => 'type' => 'number',
87
+            'categories'                => 'type' => 'container', 'childElement' => 'category',
88
+            'disallowNewTimeProposal'   => 'type' => 'number',
89
+            'dtStamp'                   => 'type' => 'datetime',
90
+            'endTime'                   => 'type' => 'datetime',
91
+            'exceptions'                => 'type' => 'container', 'childElement' => 'exception', 'class' => 'Syncroton_Model_EventException',
92
+            'location'                  => 'type' => 'string',
93
+            'meetingStatus'             => 'type' => 'number',
94
+            'onlineMeetingConfLink'     => 'type' => 'string',
95
+            'onlineMeetingExternalLink' => 'type' => 'string',
96
+            'organizerEmail'            => 'type' => 'string',
97
+            'organizerName'             => 'type' => 'string',
98
+            'recurrence'                => 'type' => 'container',
99
+            'reminder'                  => 'type' => 'number',
100
+            'responseRequested'         => 'type' => 'number',
101
+            'responseType'              => 'type' => 'number',
102
+            'sensitivity'               => 'type' => 'number',
103
+            'startTime'                 => 'type' => 'datetime',
104
+            'subject'                   => 'type' => 'string',
105
+            'timezone'                  => 'type' => 'timezone',
106
+            'uID'                       => 'type' => 'string',
107
+        ,
108
+    ;
109
+
110
     /**
111
      * (non-PHPdoc)
112
      * @see Syncroton_Model_IEntry::appendXML()
113
@@ -77,7 +80,7 @@
114
         parent::appendXML($domParrent, $device);
115
 
116
         $exceptionElements = $domParrent->getElementsByTagName('Exception');
117
-        $parentFields      = array('AllDayEvent'/*, 'Attendees'*/, 'Body', 'BusyStatus'/*, 'Categories'*/, 'DtStamp', 'EndTime', 'Location', 'MeetingStatus', 'Reminder', 'ResponseType', 'Sensitivity', 'StartTime', 'Subject');
118
+        $parentFields      = 'AllDayEvent'/*, 'Attendees'*/, 'Body', 'BusyStatus'/*, 'Categories'*/, 'DtStamp', 'EndTime', 'Location', 'MeetingStatus', 'Reminder', 'ResponseType', 'Sensitivity', 'StartTime', 'Subject';
119
 
120
         if ($exceptionElements->length > 0) {
121
             $mainEventElement = $exceptionElements->item(0)->parentNode->parentNode;
122
@@ -97,31 +100,31 @@
123
             }
124
         }
125
     }
126
-    
127
+
128
     /**
129
-     * some elements of an exception can be left out, if they have the same value 
130
+     * some elements of an exception can be left out, if they have the same value
131
      * like the main event
132
-     * 
133
+     *
134
      * this function copies these elements to the exception for backends which need
135
      * this elements in the exceptions too. Tine 2.0 needs this for example.
136
      */
137
     public function copyFieldsFromParent()
138
     {
139
-        if (isset($this->_elements'exceptions') && is_array($this->_elements'exceptions')) {
140
-            foreach ($this->_elements'exceptions' as $exception) {
141
-                // no need to update deleted exceptions
142
-                if ($exception->deleted == 1) {
143
-                    continue;
144
-                }
145
-        
146
-                $parentFields = array('allDayEvent', 'attendees', 'body', 'busyStatus', 'categories', 'dtStamp', 'endTime', 'location', 'meetingStatus', 'reminder', 'responseType', 'sensitivity', 'startTime', 'subject');
147
-        
148
-                foreach ($parentFields as $field) {
149
-                    if (!isset($exception->$field) && isset($this->_elements$field)) {
150
-                        $exception->$field = $this->_elements$field;
151
-                    }
152
-                }
153
-            }
154
-        }
155
+        if (isset($this->_elements'exceptions') && is_array($this->_elements'exceptions')) {
156
+            foreach ($this->_elements'exceptions' as $exception) {
157
+                // no need to update deleted exceptions
158
+                if ($exception->deleted == 1) {
159
+                    continue;
160
+                }
161
+
162
+                $parentFields = 'allDayEvent', 'attendees', 'body', 'busyStatus', 'categories', 'dtStamp', 'endTime', 'location', 'meetingStatus', 'reminder', 'responseType', 'sensitivity', 'startTime', 'subject';
163
+
164
+                foreach ($parentFields as $field) {
165
+                    if (!isset($exception->$field) && isset($this->_elements$field)) {
166
+                        $exception->$field = $this->_elements$field;
167
+                    }
168
+                }
169
+            }
170
+        }
171
     }
172
-}
173
\ No newline at end of file
174
+}
175
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Model/EventAttendee.php Changed
75
 
1
@@ -14,40 +14,39 @@
2
  *
3
  * @package     Syncroton
4
  * @subpackage  Model
5
- * @property    string  class
6
- * @property    string  collectionId
7
- * @property    bool    deletesAsMoves
8
- * @property    bool    getChanges
9
- * @property    string  syncKey
10
- * @property    int     windowSize
11
+ * @property    string  $class
12
+ * @property    string  $collectionId
13
+ * @property    bool    $deletesAsMoves
14
+ * @property    bool    $getChanges
15
+ * @property    string  $syncKey
16
+ * @property    int     $windowSize
17
  */
18
-
19
 class Syncroton_Model_EventAttendee extends Syncroton_Model_AXMLEntry
20
 {
21
     protected $_xmlBaseElement = 'Attendee';
22
-    
23
-    /**
24
-     * attendee status
25
-     */
26
-    const ATTENDEE_STATUS_UNKNOWN       = 0;
27
-    const ATTENDEE_STATUS_TENTATIVE     = 2;
28
-    const ATTENDEE_STATUS_ACCEPTED      = 3;
29
-    const ATTENDEE_STATUS_DECLINED      = 4;
30
-    const ATTENDEE_STATUS_NOTRESPONDED  = 5;
31
-    
32
-    /**
33
-     * attendee types
34
-     */
35
-    const ATTENDEE_TYPE_REQUIRED = 1;
36
-    const ATTENDEE_TYPE_OPTIONAL = 2;
37
-    const ATTENDEE_TYPE_RESOURCE = 3;
38
-    
39
-    protected $_properties = array(
40
-        'Calendar' => array(
41
-            'attendeeStatus'          => array('type' => 'number'),
42
-            'attendeeType'            => array('type' => 'number'),
43
-            'email'                   => array('type' => 'string'),
44
-            'name'                    => array('type' => 'string'),
45
-        )
46
-    );
47
-}
48
\ No newline at end of file
49
+
50
+    /**
51
+     * attendee status
52
+     */
53
+    public const ATTENDEE_STATUS_UNKNOWN       = 0;
54
+    public const ATTENDEE_STATUS_TENTATIVE     = 2;
55
+    public const ATTENDEE_STATUS_ACCEPTED      = 3;
56
+    public const ATTENDEE_STATUS_DECLINED      = 4;
57
+    public const ATTENDEE_STATUS_NOTRESPONDED  = 5;
58
+
59
+    /**
60
+     * attendee types
61
+     */
62
+    public const ATTENDEE_TYPE_REQUIRED = 1;
63
+    public const ATTENDEE_TYPE_OPTIONAL = 2;
64
+    public const ATTENDEE_TYPE_RESOURCE = 3;
65
+
66
+    protected $_properties = 
67
+        'Calendar' => 
68
+            'attendeeStatus'          => 'type' => 'number',
69
+            'attendeeType'            => 'type' => 'number',
70
+            'email'                   => 'type' => 'string',
71
+            'name'                    => 'type' => 'string',
72
+        ,
73
+    ;
74
+}
75
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Model/EventException.php Changed
81
 
1
@@ -14,41 +14,44 @@
2
  *
3
  * @package     Syncroton
4
  * @subpackage  Model
5
- * @property    string  class
6
- * @property    string  collectionId
7
- * @property    bool    deletesAsMoves
8
- * @property    bool    getChanges
9
- * @property    string  syncKey
10
- * @property    int     windowSize
11
+ *
12
+ * @property bool     $allDayEvent
13
+ * @property string   $class
14
+ * @property string   $collectionId
15
+ * @property bool     $deletesAsMoves
16
+ * @property DateTime $endTime
17
+ * @property bool     $getChanges
18
+ * @property DateTime $startTime
19
+ * @property string   $syncKey
20
+ * @property int      $windowSize
21
  */
22
-
23
 class Syncroton_Model_EventException extends Syncroton_Model_AXMLEntry
24
-{    
25
+{
26
     protected $_xmlBaseElement = 'Exception';
27
-    
28
+
29
     protected $_dateTimeFormat = "Ymd\THis\Z";
30
-    
31
-    protected $_properties = array(
32
-        'AirSyncBase' => array(
33
-            'body'                    => array('type' => 'container', 'class' => 'Syncroton_Model_EmailBody')
34
-        ),
35
-        'Calendar' => array(
36
-            'allDayEvent'             => array('type' => 'number'),
37
-            'appointmentReplyTime'    => array('type' => 'datetime'),
38
-            'attendees'               => array('type' => 'container', 'childElement' => 'attendee', 'class' => 'Syncroton_Model_EventAttendee'),
39
-            'busyStatus'              => array('type' => 'number'),
40
-            'categories'              => array('type' => 'container', 'childElement' => 'category'),
41
-            'deleted'                 => array('type' => 'number'),
42
-            'dtStamp'                 => array('type' => 'datetime'),
43
-            'endTime'                 => array('type' => 'datetime'),
44
-            'exceptionStartTime'      => array('type' => 'datetime'),
45
-            'location'                => array('type' => 'string'),
46
-            'meetingStatus'           => array('type' => 'number'),
47
-            'reminder'                => array('type' => 'number'),
48
-            'responseType'            => array('type' => 'number'),
49
-            'sensitivity'             => array('type' => 'number'),
50
-            'startTime'               => array('type' => 'datetime'),
51
-            'subject'                 => array('type' => 'string'),
52
-        )
53
-    );    
54
-}
55
\ No newline at end of file
56
+
57
+    protected $_properties = 
58
+        'AirSyncBase' => 
59
+            'body'                    => 'type' => 'container', 'class' => 'Syncroton_Model_EmailBody',
60
+        ,
61
+        'Calendar' => 
62
+            'allDayEvent'             => 'type' => 'number',
63
+            'appointmentReplyTime'    => 'type' => 'datetime',
64
+            'attendees'               => 'type' => 'container', 'childElement' => 'attendee', 'class' => 'Syncroton_Model_EventAttendee',
65
+            'busyStatus'              => 'type' => 'number',
66
+            'categories'              => 'type' => 'container', 'childElement' => 'category',
67
+            'deleted'                 => 'type' => 'number',
68
+            'dtStamp'                 => 'type' => 'datetime',
69
+            'endTime'                 => 'type' => 'datetime',
70
+            'exceptionStartTime'      => 'type' => 'datetime',
71
+            'location'                => 'type' => 'string',
72
+            'meetingStatus'           => 'type' => 'number',
73
+            'reminder'                => 'type' => 'number',
74
+            'responseType'            => 'type' => 'number',
75
+            'sensitivity'             => 'type' => 'number',
76
+            'startTime'               => 'type' => 'datetime',
77
+            'subject'                 => 'type' => 'string',
78
+        ,
79
+    ;
80
+}
81
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Model/EventRecurrence.php Changed
112
 
1
@@ -14,59 +14,58 @@
2
  *
3
  * @package     Syncroton
4
  * @subpackage  Model
5
- * @property    int       CalendarType
6
- * @property    int       DayOfMonth
7
- * @property    int       DayOfWeek
8
- * @property    int       FirstDayOfWeek
9
- * @property    int       Interval
10
- * @property    int       IsLeapMonth
11
- * @property    int       MonthOfYear
12
- * @property    int       Occurrences
13
- * @property    int       Type
14
- * @property    DateTime  Until
15
- * @property    int       WeekOfMonth
16
+ * @property    int       $calendarType
17
+ * @property    int       $dayOfMonth
18
+ * @property    int       $dayOfWeek
19
+ * @property    int       $firstDayOfWeek
20
+ * @property    int       $interval
21
+ * @property    int       $isLeapMonth
22
+ * @property    int       $monthOfYear
23
+ * @property    int       $occurrences
24
+ * @property    int       $type
25
+ * @property    DateTime  $until
26
+ * @property    int       $weekOfMonth
27
  */
28
-
29
 class Syncroton_Model_EventRecurrence extends Syncroton_Model_AXMLEntry
30
 {
31
     protected $_xmlBaseElement = 'Recurrence';
32
-    
33
-    /**
34
-     * recur types
35
-     */
36
-    const TYPE_DAILY          = 0;     // Recurs daily.
37
-    const TYPE_WEEKLY         = 1;     // Recurs weekly
38
-    const TYPE_MONTHLY        = 2;     // Recurs monthly
39
-    const TYPE_MONTHLY_DAYN   = 3;     // Recurs monthly on the nth day
40
-    const TYPE_YEARLY         = 5;     // Recurs yearly
41
-    const TYPE_YEARLY_DAYN    = 6;     // Recurs yearly on the nth day
42
-    
43
-    /**
44
-     * day of week constants
45
-     */
46
-    const RECUR_DOW_SUNDAY      = 1;
47
-    const RECUR_DOW_MONDAY      = 2;
48
-    const RECUR_DOW_TUESDAY     = 4;
49
-    const RECUR_DOW_WEDNESDAY   = 8;
50
-    const RECUR_DOW_THURSDAY    = 16;
51
-    const RECUR_DOW_FRIDAY      = 32;
52
-    const RECUR_DOW_SATURDAY    = 64;
53
-    
54
+
55
+    /**
56
+     * recur types
57
+     */
58
+    public const TYPE_DAILY          = 0;     // Recurs daily.
59
+    public const TYPE_WEEKLY         = 1;     // Recurs weekly
60
+    public const TYPE_MONTHLY        = 2;     // Recurs monthly
61
+    public const TYPE_MONTHLY_DAYN   = 3;     // Recurs monthly on the nth day
62
+    public const TYPE_YEARLY         = 5;     // Recurs yearly
63
+    public const TYPE_YEARLY_DAYN    = 6;     // Recurs yearly on the nth day
64
+
65
+    /**
66
+     * day of week constants
67
+     */
68
+    public const RECUR_DOW_SUNDAY      = 1;
69
+    public const RECUR_DOW_MONDAY      = 2;
70
+    public const RECUR_DOW_TUESDAY     = 4;
71
+    public const RECUR_DOW_WEDNESDAY   = 8;
72
+    public const RECUR_DOW_THURSDAY    = 16;
73
+    public const RECUR_DOW_FRIDAY      = 32;
74
+    public const RECUR_DOW_SATURDAY    = 64;
75
+
76
     protected $_dateTimeFormat = "Ymd\THis\Z";
77
-    
78
-    protected $_properties = array(
79
-        'Calendar' => array(
80
-            'calendarType'            => array('type' => 'number'),
81
-            'dayOfMonth'              => array('type' => 'number'),
82
-            'dayOfWeek'               => array('type' => 'number'),
83
-            'firstDayOfWeek'          => array('type' => 'number'),
84
-            'interval'                => array('type' => 'number'),
85
-            'isLeapMonth'             => array('type' => 'number'),
86
-            'monthOfYear'             => array('type' => 'number'),
87
-            'occurrences'             => array('type' => 'number'),
88
-            'type'                    => array('type' => 'number'),
89
-            'until'                   => array('type' => 'datetime'),
90
-            'weekOfMonth'             => array('type' => 'number'),
91
-        )
92
-    );
93
-}
94
\ No newline at end of file
95
+
96
+    protected $_properties = 
97
+        'Calendar' => 
98
+            'calendarType'            => 'type' => 'number',
99
+            'dayOfMonth'              => 'type' => 'number',
100
+            'dayOfWeek'               => 'type' => 'number',
101
+            'firstDayOfWeek'          => 'type' => 'number',
102
+            'interval'                => 'type' => 'number',
103
+            'isLeapMonth'             => 'type' => 'number',
104
+            'monthOfYear'             => 'type' => 'number',
105
+            'occurrences'             => 'type' => 'number',
106
+            'type'                    => 'type' => 'number',
107
+            'until'                   => 'type' => 'datetime',
108
+            'weekOfMonth'             => 'type' => 'number',
109
+        ,
110
+    ;
111
+}
112
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Model/FileReference.php Changed
54
 
1
@@ -14,33 +14,32 @@
2
  *
3
  * @package     Syncroton
4
  * @subpackage  Model
5
- * @property    string  ContentType
6
- * @property    string  Data
7
+ * @property    string   $contentType
8
+ * @property    string   $data
9
+ * @property    int      $part
10
  */
11
-
12
 class Syncroton_Model_FileReference extends Syncroton_Model_AXMLEntry
13
 {
14
     protected $_xmlBaseElement = 'ApplicationData';
15
-    
16
-    protected $_properties = array(
17
-        'AirSyncBase' => array(
18
-            'contentType' => array('type' => 'string'),
19
-        ),
20
-        'ItemOperations' => array(
21
-            'data'        => array('type' => 'string', 'encoding' => 'base64'),
22
-            'part'        => array('type' => 'number')
23
-        )
24
-    );
25
-        
26
+
27
+    protected $_properties = 
28
+        'AirSyncBase' => 
29
+            'contentType' => 'type' => 'string',
30
+        ,
31
+        'ItemOperations' => 
32
+            'data'        => 'type' => 'string', 'encoding' => 'base64',
33
+            'part'        => 'type' => 'number',
34
+        ,
35
+    ;
36
+
37
     /**
38
-     * 
39
-     * @param SimpleXMLElement $xmlCollection
40
+     *
41
+     * @param SimpleXMLElement $properties
42
      * @throws InvalidArgumentException
43
      */
44
     public function setFromSimpleXMLElement(SimpleXMLElement $properties)
45
     {
46
-        //do nothing
47
-                
48
+        // do nothing
49
         return;
50
     }
51
-}
52
\ No newline at end of file
53
+}
54
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Model/Folder.php Changed
42
 
1
@@ -18,22 +18,22 @@
2
  */
3
 class Syncroton_Model_Folder extends Syncroton_Model_AXMLEntry implements Syncroton_Model_IFolder
4
 {
5
-    protected $_xmlBaseElement = array('FolderUpdate', 'FolderCreate');
6
-    
7
-    protected $_properties = array(
8
-        'FolderHierarchy' => array(
9
-            'parentId'     => array('type' => 'string'),
10
-            'serverId'     => array('type' => 'string'),
11
-            'displayName'  => array('type' => 'string'),
12
-            'type'         => array('type' => 'number')
13
-        ),
14
-        'Internal' => array(
15
-            'id'             => array('type' => 'string'),
16
-            'deviceId'       => array('type' => 'string'),
17
-            'ownerId'        => array('type' => 'string'),
18
-            'class'          => array('type' => 'string'),
19
-            'creationTime'   => array('type' => 'datetime'),
20
-            'lastfiltertype' => array('type' => 'number')
21
-        ),
22
-    );
23
+    protected $_xmlBaseElement = 'FolderUpdate', 'FolderCreate';
24
+
25
+    protected $_properties = 
26
+        'FolderHierarchy' => 
27
+            'parentId'     => 'type' => 'string',
28
+            'serverId'     => 'type' => 'string',
29
+            'displayName'  => 'type' => 'string',
30
+            'type'         => 'type' => 'number',
31
+        ,
32
+        'Internal' => 
33
+            'id'             => 'type' => 'string',
34
+            'deviceId'       => 'type' => 'string',
35
+            'ownerId'        => 'type' => 'string',
36
+            'class'          => 'type' => 'string',
37
+            'creationTime'   => 'type' => 'datetime',
38
+            'lastfiltertype' => 'type' => 'number',
39
+        ,
40
+    ;
41
 }
42
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Model/GAL.php Changed
63
 
1
@@ -17,35 +17,35 @@
2
  * @package     Syncroton
3
  * @subpackage  Model
4
  *
5
- * @property    string    Alias
6
- * @property    string    Company
7
- * @property    string    DisplayName
8
- * @property    string    EmailAddress
9
- * @property    string    FirstName
10
- * @property    string    LastName
11
- * @property    string    MobilePhone
12
- * @property    string    Office
13
- * @property    string    Phone
14
- * @property    string    Picture
15
- * @property    string    Title
16
+ * @property    string    $alias
17
+ * @property    string    $company
18
+ * @property    string    $displayName
19
+ * @property    string    $emailAddress
20
+ * @property    string    $firstName
21
+ * @property    string    $lastName
22
+ * @property    string    $mobilePhone
23
+ * @property    string    $office
24
+ * @property    string    $phone
25
+ * @property    string    $picture
26
+ * @property    string    $title
27
  */
28
 class Syncroton_Model_GAL extends Syncroton_Model_AXMLEntry
29
 {
30
     protected $_xmlBaseElement = 'ApplicationData';
31
 
32
-    protected $_properties = array(
33
-        'GAL' => array(
34
-            'alias'         => array('type' => 'string', 'supportedSince' => '2.5'),
35
-            'company'       => array('type' => 'string', 'supportedSince' => '2.5'),
36
-            'displayName'   => array('type' => 'string', 'supportedSince' => '2.5'),
37
-            'emailAddress'  => array('type' => 'string', 'supportedSince' => '2.5'),
38
-            'firstName'     => array('type' => 'string', 'supportedSince' => '2.5'),
39
-            'lastName'      => array('type' => 'string', 'supportedSince' => '2.5'),
40
-            'mobilePhone'   => array('type' => 'string', 'supportedSince' => '2.5'),
41
-            'office'        => array('type' => 'string', 'supportedSince' => '2.5'),
42
-            'phone'         => array('type' => 'string', 'supportedSince' => '2.5'),
43
-            'picture'       => array('type' => 'container', 'supportedSince' => '14.0'),
44
-            'title'         => array('type' => 'string', 'supportedSince' => '2.5'),
45
-        )
46
-    );
47
+    protected $_properties = 
48
+        'GAL' => 
49
+            'alias'         => 'type' => 'string', 'supportedSince' => '2.5',
50
+            'company'       => 'type' => 'string', 'supportedSince' => '2.5',
51
+            'displayName'   => 'type' => 'string', 'supportedSince' => '2.5',
52
+            'emailAddress'  => 'type' => 'string', 'supportedSince' => '2.5',
53
+            'firstName'     => 'type' => 'string', 'supportedSince' => '2.5',
54
+            'lastName'      => 'type' => 'string', 'supportedSince' => '2.5',
55
+            'mobilePhone'   => 'type' => 'string', 'supportedSince' => '2.5',
56
+            'office'        => 'type' => 'string', 'supportedSince' => '2.5',
57
+            'phone'         => 'type' => 'string', 'supportedSince' => '2.5',
58
+            'picture'       => 'type' => 'container', 'supportedSince' => '14.0',
59
+            'title'         => 'type' => 'string', 'supportedSince' => '2.5',
60
+        ,
61
+    ;
62
 }
63
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Model/GALPicture.php Changed
40
 
1
@@ -17,24 +17,24 @@
2
  * @package     Syncroton
3
  * @subpackage  Model
4
  *
5
- * @property    string    Status
6
- * @property    string    Data
7
+ * @property    string    $status
8
+ * @property    string    $data
9
  */
10
 class Syncroton_Model_GALPicture extends Syncroton_Model_AXMLEntry
11
 {
12
-    const STATUS_SUCCESS   = 1;
13
-    const STATUS_NOPHOTO   = 173;
14
-    const STATUS_TOOLARGE  = 174;
15
-    const STATUS_OVERLIMIT = 175;
16
+    public const STATUS_SUCCESS   = 1;
17
+    public const STATUS_NOPHOTO   = 173;
18
+    public const STATUS_TOOLARGE  = 174;
19
+    public const STATUS_OVERLIMIT = 175;
20
 
21
     protected $_xmlBaseElement = 'ApplicationData';
22
 
23
-    protected $_properties = array(
24
-        'AirSync' => array(
25
-            'status'       => array('type' => 'number'),
26
-        ),
27
-        'GAL' => array(
28
-            'data'         => array('type' => 'byteArray'),
29
-        ),
30
-    );
31
+    protected $_properties = 
32
+        'AirSync' => 
33
+            'status'       => 'type' => 'number',
34
+        ,
35
+        'GAL' => 
36
+            'data'         => 'type' => 'byteArray',
37
+        ,
38
+    ;
39
 }
40
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Model/IContent.php Changed
24
 
1
@@ -14,15 +14,14 @@
2
  *
3
  * @package     Syncroton
4
  * @subpackage  Model
5
- * @property    string    id
6
- * @property    string    device_id
7
- * @property    string    folder_id
8
- * @property    string    contentid
9
- * @property    DateTime  creation_time
10
- * @property    string    creation_synckey
11
- * @property    string    is_deleted
12
+ * @property    string    $id
13
+ * @property    string    $device_id
14
+ * @property    string    $folder_id
15
+ * @property    string    $contentid
16
+ * @property    DateTime  $creation_time
17
+ * @property    string    $creation_synckey
18
+ * @property    string    $is_deleted
19
  */
20
 interface Syncroton_Model_IContent
21
 {
22
 }
23
-
24
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Model/IDevice.php Changed
77
 
1
@@ -1,12 +1,13 @@
2
 <?php
3
+
4
 /**
5
  * Syncroton
6
  *
7
  * @package     Syncroton
8
  * @subpackage  Model
9
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
10
- * @copyright   Copyright (c) 2009-2012 Metaways Infosystems GmbH (http://www.metaways.de)
11
- * @author      Lars Kneschke <l.kneschke@metaways.de>
12
+ * @copyright   Copyright (c) 2012-2014 Kolab Systems AG
13
+ * @author      Aleksander Machniak <machniak@kolabsys.com>
14
  */
15
 
16
 /**
17
@@ -14,31 +15,29 @@
18
  *
19
  * @package     Syncroton
20
  * @subpackage  Model
21
- * @property    string   id
22
- * @property    string   deviceid
23
- * @property    string   devicetype
24
- * @property    string   policykey
25
- * @property    string   policyId
26
- * @property    string   ownerId
27
- * @property    string   acsversion
28
- * @property    string   pingfolder
29
- * @property    string   pinglifetime
30
- * @property    string   remotewipe
31
- * @property    string   useragent
32
- * @property    string   imei
33
- * @property    string   model
34
- * @property    string   friendlyname
35
- * @property    string   os
36
- * @property    string   oslanguage
37
- * @property    string   phonenumber
38
- * @property    string   pinglifetime
39
- * @property    string   pingfolder
40
- * @property    string   contactsfilter_id
41
- * @property    string   calendarfilter_id
42
- * @property    string   tasksfilter_id
43
- * @property    string   emailfilter_id
44
- * @property    string   lastsynccollection
45
- * @property    DateTime lastping
46
+ * @property    string   $acsversion
47
+ * @property    string   $deviceid
48
+ * @property    string   $devicetype
49
+ * @property    string   $friendlyname
50
+ * @property    string   $id
51
+ * @property    string   $imei
52
+ * @property    string   $model
53
+ * @property    string   $os
54
+ * @property    string   $oslanguage
55
+ * @property    string   $ownerId
56
+ * @property    string   $phonenumber
57
+ * @property    string   $pingfolder
58
+ * @property    int      $pinglifetime
59
+ * @property    string   $policykey
60
+ * @property    string   $policyId
61
+ * @property    int      $remotewipe
62
+ * @property    string   $useragent
63
+ * @property    string   $contactsfilter_id
64
+ * @property    string   $calendarfilter_id
65
+ * @property    string   $tasksfilter_id
66
+ * @property    string   $emailfilter_id
67
+ * @property    string   $lastsynccollection
68
+ * @property    DateTime $lastping
69
  */
70
 interface Syncroton_Model_IDevice extends Syncroton_Model_IEntry
71
 {
72
@@ -49,4 +48,3 @@
73
      */
74
     public function getMajorVersion();
75
 }
76
-
77
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Model/IEntry.php Changed
58
 
1
@@ -1,5 +1,5 @@
2
 <?php
3
-/**
4
+/*
5
  * Syncroton
6
  *
7
  * @package     Syncroton
8
@@ -10,33 +10,33 @@
9
  */
10
 
11
 /**
12
- * class to handle ActiveSync contact
13
+ * class to handle ActiveSync entry
14
  *
15
  * @package     Syncroton
16
  * @subpackage  Model
17
- * @property    string  class
18
- * @property    string  collectionId
19
- * @property    bool    deletesAsMoves
20
- * @property    bool    getChanges
21
- * @property    string  syncKey
22
- * @property    int     windowSize
23
+ * @property    string  $class
24
+ * @property    string  $collectionId
25
+ * @property    bool    $deletesAsMoves
26
+ * @property    bool    $getChanges
27
+ * @property    string  $syncKey
28
+ * @property    int     $windowSize
29
  */
30
 interface Syncroton_Model_IEntry
31
 {
32
     /**
33
-     * 
34
-     * @param unknown_type $properties
35
+     *
36
+     * @param SimpleXMLElement|array|null $properties
37
      */
38
     public function __construct($properties = null);
39
-    
40
+
41
     /**
42
      * return true if data have got changed after initial data got loaded via constructor
43
      */
44
     public function isDirty();
45
-    
46
+
47
     /**
48
-     * 
49
+     *
50
      * @param array $properties
51
-     */
52
-    public function setFromArray(array $properties);    
53
-}
54
\ No newline at end of file
55
+     */
56
+    public function setFromArray(array $properties);
57
+}
58
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Model/IFolder.php Changed
28
 
1
@@ -14,17 +14,16 @@
2
  *
3
  * @package     Syncroton
4
  * @subpackage  Model
5
- * @property    string   id
6
- * @property    string   deviceId
7
- * @property    string   class
8
- * @property    string   serverId
9
- * @property    string   parentId
10
- * @property    string   displayName
11
- * @property    string   creationTime
12
- * @property    string   lastfiltertype
13
- * @property    string   type
14
+ * @property    string   $id
15
+ * @property    string   $deviceId
16
+ * @property    string   $class
17
+ * @property    string   $serverId
18
+ * @property    string   $parentId
19
+ * @property    string   $displayName
20
+ * @property    DateTime $creationTime
21
+ * @property    int      $lastfiltertype
22
+ * @property    int      $type
23
  */
24
 interface Syncroton_Model_IFolder
25
 {
26
 }
27
-
28
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Model/IPolicy.php Changed
32
 
1
@@ -14,19 +14,18 @@
2
  *
3
  * @package     Syncroton
4
  * @subpackage  Model
5
- * @property    string   id
6
- * @property    string   deviceid
7
- * @property    string   devicetype
8
- * @property    string   policyKey
9
- * @property    string   policyId
10
- * @property    string   ownerId
11
- * @property    string   acsversion
12
- * @property    string   pingfolder
13
- * @property    string   pinglifetime
14
- * @property    string   remotewipe
15
- * @property    string   useragent
16
+ * @property    string   $id
17
+ * @property    string   $deviceid
18
+ * @property    string   $devicetype
19
+ * @property    string   $policyKey
20
+ * @property    string   $policyId
21
+ * @property    string   $ownerId
22
+ * @property    string   $acsversion
23
+ * @property    string   $pingfolder
24
+ * @property    string   $pinglifetime
25
+ * @property    string   $remotewipe
26
+ * @property    string   $useragent
27
  */
28
 interface Syncroton_Model_IPolicy
29
 {
30
 }
31
-
32
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Model/ISyncState.php Changed
25
 
1
@@ -14,15 +14,15 @@
2
  *
3
  * @package     Syncroton
4
  * @subpackage  Model
5
- * @property    string    device_id
6
- * @property    string    type
7
- * @property    string    counter
8
- * @property    DateTime  lastsync
9
- * @property    string    pendingdata
10
- * @property    string    client_id_map
11
- * @property    string    extraData
12
+ * @property    string    $deviceId
13
+ * @property    string    $type
14
+ * @property    int       $counter
15
+ * @property    DateTime  $lastsync
16
+ * @property    string    $id
17
+ * @property    ?array    $pendingdata
18
+ * @property    string    $clientIdMap JSON-encoded array
19
+ * @property    string    $extraData   JSON-encoded array
20
  */
21
 interface Syncroton_Model_ISyncState
22
 {
23
 }
24
-
25
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Model/IXMLEntry.php Changed
36
 
1
@@ -18,23 +18,23 @@
2
 interface Syncroton_Model_IXMLEntry extends Syncroton_Model_IEntry
3
 {
4
     /**
5
-     * 
6
-     * @param DOMElement $_domParrent
7
+     *
8
+     * @param DOMElement $_domParent
9
      * @param Syncroton_Model_IDevice $device
10
      */
11
-    public function appendXML(DOMElement $_domParrent, Syncroton_Model_IDevice $device);
12
-    
13
+    public function appendXML(DOMElement $_domParent, Syncroton_Model_IDevice $device);
14
+
15
     /**
16
      * return array of valid properties
17
-     *  
18
+     *
19
      * @return array
20
      */
21
-    public function getProperties();
22
-    
23
+    public function getProperties($selectedNamespace = null);
24
+
25
     /**
26
-     * 
27
-     * @param SimpleXMLElement $xmlCollection
28
+     *
29
+     * @param SimpleXMLElement $properties
30
      * @throws InvalidArgumentException
31
      */
32
     public function setFromSimpleXMLElement(SimpleXMLElement $properties);
33
-}
34
\ No newline at end of file
35
+}
36
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Model/MeetingResponse.php Changed
64
 
1
@@ -14,34 +14,34 @@
2
  *
3
  * @package     Syncroton
4
  * @subpackage  Model
5
- * @property    int     userResponse
6
- * @property    string  collectionId
7
- * @property    string  calendarId
8
- * @property    string  requestId
9
- * @property    string  instanceId
10
- * @property    string  longId
11
+ * @property    int     $userResponse
12
+ * @property    string  $collectionId
13
+ * @property    string  $calendarId
14
+ * @property    string  $requestId
15
+ * @property    string  $instanceId
16
+ * @property    string  $longId
17
  */
18
 class Syncroton_Model_MeetingResponse extends Syncroton_Model_AXMLEntry
19
 {
20
     protected $_xmlBaseElement = 'Request';
21
-    
22
-    /**
23
-     * attendee status
24
-     */
25
-    const RESPONSE_ACCEPTED  = 1;
26
-    const RESPONSE_TENTATIVE = 2;
27
-    const RESPONSE_DECLINED  = 3;
28
-    
29
-    protected $_properties = array(
30
-        'MeetingResponse' => array(
31
-            'userResponse'  => array('type' => 'number'),
32
-            'collectionId'  => array('type' => 'string'),
33
-            'calendarId'    => array('type' => 'string'),
34
-            'requestId'     => array('type' => 'string'),
35
-            'instanceId'    => array('type' => 'datetime'),
36
-        ),
37
-        'Search' => array(
38
-            'longId'        => array('type' => 'string')
39
-        )
40
-    );
41
-}
42
\ No newline at end of file
43
+
44
+    /**
45
+     * attendee status
46
+     */
47
+    public const RESPONSE_ACCEPTED  = 1;
48
+    public const RESPONSE_TENTATIVE = 2;
49
+    public const RESPONSE_DECLINED  = 3;
50
+
51
+    protected $_properties = 
52
+        'MeetingResponse' => 
53
+            'userResponse'  => 'type' => 'number',
54
+            'collectionId'  => 'type' => 'string',
55
+            'calendarId'    => 'type' => 'string',
56
+            'requestId'     => 'type' => 'string',
57
+            'instanceId'    => 'type' => 'datetime',
58
+        ,
59
+        'Search' => 
60
+            'longId'        => 'type' => 'string',
61
+        ,
62
+    ;
63
+}
64
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Model/Note.php Changed
45
 
1
@@ -14,25 +14,25 @@
2
  *
3
  * @package     Syncroton
4
  * @subpackage  Model
5
- * @property    Syncroton_Model_EmailBody body
6
- * @property    array                     categories
7
- * @property    DateTime                  lastModifiedDate
8
- * @property    string                    messageClass
9
- * @property    string                    subject
10
+ * @property    Syncroton_Model_EmailBody $body
11
+ * @property    array                     $categories
12
+ * @property    DateTime                  $lastModifiedDate
13
+ * @property    string                    $messageClass
14
+ * @property    string                    $subject
15
  */
16
 class Syncroton_Model_Note extends Syncroton_Model_AXMLEntry
17
 {
18
     protected $_xmlBaseElement = 'ApplicationData';
19
 
20
-    protected $_properties = array(
21
-        'AirSyncBase' => array(
22
-            'body'             => array('type' => 'container', 'class' => 'Syncroton_Model_EmailBody')
23
-        ),
24
-        'Notes' => array(
25
-            'categories'       => array('type' => 'container', 'childElement' => 'category'),
26
-            'lastModifiedDate' => array('type' => 'datetime'),
27
-            'messageClass'     => array('type' => 'string'),
28
-            'subject'          => array('type' => 'string'),
29
-        )
30
-    );
31
-}
32
\ No newline at end of file
33
+    protected $_properties = 
34
+        'AirSyncBase' => 
35
+            'body'             => 'type' => 'container', 'class' => 'Syncroton_Model_EmailBody',
36
+        ,
37
+        'Notes' => 
38
+            'categories'       => 'type' => 'container', 'childElement' => 'category',
39
+            'lastModifiedDate' => 'type' => 'datetime',
40
+            'messageClass'     => 'type' => 'string',
41
+            'subject'          => 'type' => 'string',
42
+        ,
43
+    ;
44
+}
45
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Model/Oof.php Changed
40
 
1
@@ -15,21 +15,26 @@
2
  *
3
  * @package     Syncroton
4
  * @subpackage  Model
5
+ *
6
+ * @property DateTime                   $endTime
7
+ * @property Syncroton_Model_OofMessage $oofMessage
8
+ * @property int                        $oofState
9
+ * @property DateTime                   $startTime
10
  */
11
 class Syncroton_Model_Oof extends Syncroton_Model_AXMLEntry
12
 {
13
-    const STATUS_DISABLED   = 0;
14
-    const STATUS_GLOBAL     = 1;
15
-    const STATUS_TIME_BASED = 2;
16
+    public const STATUS_DISABLED   = 0;
17
+    public const STATUS_GLOBAL     = 1;
18
+    public const STATUS_TIME_BASED = 2;
19
 
20
-    protected $_xmlBaseElement = array('Get', 'Set');
21
+    protected $_xmlBaseElement = 'Get', 'Set';
22
 
23
-    protected $_properties = array(
24
-        'Settings' => array(
25
-            'endTime'    => array('type' => 'datetime'),
26
-            'oofMessage' => array('type' => 'container', 'multiple' => true, 'class' => 'Syncroton_Model_OofMessage'),
27
-            'oofState'   => array('type' => 'number'),
28
-            'startTime'  => array('type' => 'datetime'),
29
-        )
30
-    );
31
+    protected $_properties = 
32
+        'Settings' => 
33
+            'endTime'    => 'type' => 'datetime',
34
+            'oofMessage' => 'type' => 'container', 'multiple' => true, 'class' => 'Syncroton_Model_OofMessage',
35
+            'oofState'   => 'type' => 'number',
36
+            'startTime'  => 'type' => 'datetime',
37
+        ,
38
+    ;
39
 }
40
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Model/OofMessage.php Changed
29
 
1
@@ -18,16 +18,16 @@
2
  */
3
 class Syncroton_Model_OofMessage extends Syncroton_Model_AXMLEntry
4
 {
5
-    protected $_xmlBaseElement = array('OofMessage');
6
+    protected $_xmlBaseElement = 'OofMessage';
7
 
8
-    protected $_properties = array(
9
-        'Settings' => array(
10
-            'appliesToInternal'        => array('type' => 'none'),
11
-            'appliesToExternalKnown'   => array('type' => 'none'),
12
-            'appliesToExternalUnknown' => array('type' => 'none'),
13
-            'bodyType'                 => array('type' => 'string'),
14
-            'enabled'                  => array('type' => 'string'),
15
-            'replyMessage'             => array('type' => 'string'),
16
-        )
17
-    );
18
+    protected $_properties = 
19
+        'Settings' => 
20
+            'appliesToInternal'        => 'type' => 'none',
21
+            'appliesToExternalKnown'   => 'type' => 'none',
22
+            'appliesToExternalUnknown' => 'type' => 'none',
23
+            'bodyType'                 => 'type' => 'string',
24
+            'enabled'                  => 'type' => 'string',
25
+            'replyMessage'             => 'type' => 'string',
26
+        ,
27
+    ;
28
 }
29
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Model/Policy.php Changed
114
 
1
@@ -18,59 +18,57 @@
2
 class Syncroton_Model_Policy extends Syncroton_Model_AXMLEntry implements Syncroton_Model_IPolicy
3
 {
4
     protected $_xmlBaseElement = 'EASProvisionDoc';
5
-    
6
-    protected $_properties = array(
7
-        'Internal' => array(
8
-            'id'                                   => array('type' => 'string'),
9
-            'description'                          => array('type' => 'string'),
10
-            'name'                                 => array('type' => 'string'),
11
-            'policyKey'                            => array('type' => 'string'),
12
-        ),
13
-        'Provision' => array(
14
-            'allowBluetooth'                       => array('type' => 'number'),
15
-            'allowSMIMEEncryptionAlgorithmNegotiation' => array('type' => 'number'),
16
-            'allowBrowser'                         => array('type' => 'number'),
17
-            'allowCamera'                          => array('type' => 'number'),
18
-            'allowConsumerEmail'                   => array('type' => 'number'),
19
-            'allowDesktopSync'                     => array('type' => 'number'),
20
-            'allowHTMLEmail'                       => array('type' => 'number'),
21
-            'allowInternetSharing'                 => array('type' => 'number'),
22
-            'allowIrDA'                            => array('type' => 'number'),
23
-            'allowPOPIMAPEmail'                    => array('type' => 'number'),
24
-            'allowRemoteDesktop'                   => array('type' => 'number'),
25
-            'allowSimpleDevicePassword'            => array('type' => 'number'),
26
-            'allowSMIMEEncryptionAlgorithmNegotiation' => array('type' => 'number'),
27
-            'allowSMIMESoftCerts'                  => array('type' => 'number'),
28
-            'allowStorageCard'                     => array('type' => 'number'),
29
-            'allowTextMessaging'                   => array('type' => 'number'),
30
-            'allowUnsignedApplications'            => array('type' => 'number'),
31
-            'allowUnsignedInstallationPackages'    => array('type' => 'number'),
32
-            'allowWifi'                            => array('type' => 'number'),
33
-            'alphanumericDevicePasswordRequired'   => array('type' => 'number'),
34
-            'approvedApplicationList'              => array('type' => 'container', 'childName' => 'Hash'),
35
-            'attachmentsEnabled'                   => array('type' => 'number'),
36
-            'devicePasswordEnabled'                => array('type' => 'number'),
37
-            'devicePasswordExpiration'             => array('type' => 'number'),
38
-            'devicePasswordHistory'                => array('type' => 'number'),
39
-            'maxAttachmentSize'                    => array('type' => 'number'),
40
-            'maxCalendarAgeFilter'                 => array('type' => 'number'),
41
-            'maxDevicePasswordFailedAttempts'      => array('type' => 'number'),
42
-            'maxEmailAgeFilter'                    => array('type' => 'number'),
43
-            'maxEmailBodyTruncationSize'           => array('type' => 'number'),
44
-            'maxEmailHTMLBodyTruncationSize'       => array('type' => 'number'),
45
-            'maxInactivityTimeDeviceLock'          => array('type' => 'number'),
46
-            'minDevicePasswordComplexCharacters'   => array('type' => 'number'),
47
-            'minDevicePasswordLength'              => array('type' => 'number'),
48
-            'passwordRecoveryEnabled'              => array('type' => 'number'),
49
-            'requireDeviceEncryption'              => array('type' => 'number'),
50
-            'requireEncryptedSMIMEMessages'        => array('type' => 'number'),
51
-            'requireEncryptionSMIMEAlgorithm'      => array('type' => 'number'),
52
-            'requireManualSyncWhenRoaming'         => array('type' => 'number'),
53
-            'requireSignedSMIMEAlgorithm'          => array('type' => 'number'),
54
-            'requireSignedSMIMEMessages'           => array('type' => 'number'),
55
-            'requireStorageCardEncryption'         => array('type' => 'number'),
56
-            'unapprovedInROMApplicationList'       => array('type' => 'container', 'childName' => 'ApplicationName')
57
-        )
58
-    );
59
-}
60
 
61
+    protected $_properties = 
62
+        'Internal' => 
63
+            'id'                                   => 'type' => 'string',
64
+            'description'                          => 'type' => 'string',
65
+            'name'                                 => 'type' => 'string',
66
+            'policyKey'                            => 'type' => 'string',
67
+        ,
68
+        'Provision' => 
69
+            'allowBluetooth'                       => 'type' => 'number',
70
+            'allowBrowser'                         => 'type' => 'number',
71
+            'allowCamera'                          => 'type' => 'number',
72
+            'allowConsumerEmail'                   => 'type' => 'number',
73
+            'allowDesktopSync'                     => 'type' => 'number',
74
+            'allowHTMLEmail'                       => 'type' => 'number',
75
+            'allowInternetSharing'                 => 'type' => 'number',
76
+            'allowIrDA'                            => 'type' => 'number',
77
+            'allowPOPIMAPEmail'                    => 'type' => 'number',
78
+            'allowRemoteDesktop'                   => 'type' => 'number',
79
+            'allowSimpleDevicePassword'            => 'type' => 'number',
80
+            'allowSMIMEEncryptionAlgorithmNegotiation' => 'type' => 'number',
81
+            'allowSMIMESoftCerts'                  => 'type' => 'number',
82
+            'allowStorageCard'                     => 'type' => 'number',
83
+            'allowTextMessaging'                   => 'type' => 'number',
84
+            'allowUnsignedApplications'            => 'type' => 'number',
85
+            'allowUnsignedInstallationPackages'    => 'type' => 'number',
86
+            'allowWifi'                            => 'type' => 'number',
87
+            'alphanumericDevicePasswordRequired'   => 'type' => 'number',
88
+            'approvedApplicationList'              => 'type' => 'container', 'childName' => 'Hash',
89
+            'attachmentsEnabled'                   => 'type' => 'number',
90
+            'devicePasswordEnabled'                => 'type' => 'number',
91
+            'devicePasswordExpiration'             => 'type' => 'number',
92
+            'devicePasswordHistory'                => 'type' => 'number',
93
+            'maxAttachmentSize'                    => 'type' => 'number',
94
+            'maxCalendarAgeFilter'                 => 'type' => 'number',
95
+            'maxDevicePasswordFailedAttempts'      => 'type' => 'number',
96
+            'maxEmailAgeFilter'                    => 'type' => 'number',
97
+            'maxEmailBodyTruncationSize'           => 'type' => 'number',
98
+            'maxEmailHTMLBodyTruncationSize'       => 'type' => 'number',
99
+            'maxInactivityTimeDeviceLock'          => 'type' => 'number',
100
+            'minDevicePasswordComplexCharacters'   => 'type' => 'number',
101
+            'minDevicePasswordLength'              => 'type' => 'number',
102
+            'passwordRecoveryEnabled'              => 'type' => 'number',
103
+            'requireDeviceEncryption'              => 'type' => 'number',
104
+            'requireEncryptedSMIMEMessages'        => 'type' => 'number',
105
+            'requireEncryptionSMIMEAlgorithm'      => 'type' => 'number',
106
+            'requireManualSyncWhenRoaming'         => 'type' => 'number',
107
+            'requireSignedSMIMEAlgorithm'          => 'type' => 'number',
108
+            'requireSignedSMIMEMessages'           => 'type' => 'number',
109
+            'requireStorageCardEncryption'         => 'type' => 'number',
110
+            'unapprovedInROMApplicationList'       => 'type' => 'container', 'childName' => 'ApplicationName',
111
+        ,
112
+    ;
113
+}
114
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Model/SendMail.php Changed
30
 
1
@@ -19,16 +19,16 @@
2
  */
3
 class Syncroton_Model_SendMail extends Syncroton_Model_AXMLEntry
4
 {
5
-    protected $_properties = array(
6
-        'ComposeMail' => array(
7
-            'accountId'       => array('type' => 'string'),
8
-            'clientId'        => array('type' => 'string'),
9
-            'mime'            => array('type' => 'byteArray'),
10
-            'saveInSentItems' => array('type' => 'string'),
11
-            'status'          => array('type' => 'number'),
12
-        ),
13
-        'RightsManagement' => array(
14
-            'templateID'      => array('type' => 'string'),
15
-        )
16
-    );
17
+    protected $_properties = 
18
+        'ComposeMail' => 
19
+            'accountId'       => 'type' => 'string',
20
+            'clientId'        => 'type' => 'string',
21
+            'mime'            => 'type' => 'byteArray',
22
+            'saveInSentItems' => 'type' => 'string',
23
+            'status'          => 'type' => 'number',
24
+        ,
25
+        'RightsManagement' => 
26
+            'templateID'      => 'type' => 'string',
27
+        ,
28
+    ;
29
 }
30
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Model/SmartForward.php Changed
34
 
1
@@ -19,18 +19,18 @@
2
  */
3
 class Syncroton_Model_SmartForward extends Syncroton_Model_AXMLEntry
4
 {
5
-    protected $_properties = array(
6
-        'ComposeMail' => array(
7
-            'accountId'       => array('type' => 'string'),
8
-            'clientId'        => array('type' => 'string'),
9
-            'mime'            => array('type' => 'byteArray'),
10
-            'replaceMime'     => array('type' => 'string'),
11
-            'saveInSentItems' => array('type' => 'string'),
12
-            'source'          => array('type' => 'container'), // or string
13
-            'status'          => array('type' => 'number'),
14
-        ),
15
-        'RightsManagement' => array(
16
-            'templateID'      => array('type' => 'string'),
17
-        )
18
-    );
19
+    protected $_properties = 
20
+        'ComposeMail' => 
21
+            'accountId'       => 'type' => 'string',
22
+            'clientId'        => 'type' => 'string',
23
+            'mime'            => 'type' => 'byteArray',
24
+            'replaceMime'     => 'type' => 'string',
25
+            'saveInSentItems' => 'type' => 'string',
26
+            'source'          => 'type' => 'container', // or string
27
+            'status'          => 'type' => 'number',
28
+        ,
29
+        'RightsManagement' => 
30
+            'templateID'      => 'type' => 'string',
31
+        ,
32
+    ;
33
 }
34
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Model/SmartReply.php Changed
34
 
1
@@ -19,18 +19,18 @@
2
  */
3
 class Syncroton_Model_SmartReply extends Syncroton_Model_AXMLEntry
4
 {
5
-    protected $_properties = array(
6
-        'ComposeMail' => array(
7
-            'accountId'       => array('type' => 'string'),
8
-            'clientId'        => array('type' => 'string'),
9
-            'mime'            => array('type' => 'byteArray'),
10
-            'replaceMime'     => array('type' => 'string'),
11
-            'saveInSentItems' => array('type' => 'string'),
12
-            'source'          => array('type' => 'container'), // or string
13
-            'status'          => array('type' => 'number'),
14
-        ),
15
-        'RightsManagement' => array(
16
-            'templateID'      => array('type' => 'string'),
17
-        )
18
-    );
19
+    protected $_properties = 
20
+        'ComposeMail' => 
21
+            'accountId'       => 'type' => 'string',
22
+            'clientId'        => 'type' => 'string',
23
+            'mime'            => 'type' => 'byteArray',
24
+            'replaceMime'     => 'type' => 'string',
25
+            'saveInSentItems' => 'type' => 'string',
26
+            'source'          => 'type' => 'container', // or string
27
+            'status'          => 'type' => 'number',
28
+        ,
29
+        'RightsManagement' => 
30
+            'templateID'      => 'type' => 'string',
31
+        ,
32
+    ;
33
 }
34
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Model/StoreRequest.php Changed
117
 
1
@@ -16,13 +16,13 @@
2
  *
3
  * @package     Syncroton
4
  * @subpackage  Model
5
- * @property    string  name
6
- * @property    array   options
7
- * @property    array   query
8
+ * @property    string  $name
9
+ * @property    array   $options
10
+ * @property    array   $query
11
  */
12
 class Syncroton_Model_StoreRequest
13
 {
14
-    protected $_store = array();
15
+    protected $_store = ;
16
 
17
     protected $_xmlStore;
18
 
19
@@ -37,12 +37,12 @@
20
 
21
     public function setFromArray(array $properties)
22
     {
23
-        $this->_store = array(
24
-            'options' => array(
25
+        $this->_store = 
26
+            'options' => 
27
                 'mimeSupport'     => Syncroton_Command_Sync::MIMESUPPORT_DONT_SEND_MIME,
28
-                'bodyPreferences' => array()
29
-            ),
30
-        );
31
+                'bodyPreferences' => ,
32
+            ,
33
+        ;
34
 
35
         foreach ($properties as $key => $value) {
36
             try {
37
@@ -67,13 +67,13 @@
38
 
39
         $this->_xmlStore = $xmlStore;
40
 
41
-        $this->_store = array(
42
+        $this->_store = 
43
             'name'             => (string) $xmlStore->Name,
44
-            'options'          => array(
45
+            'options'          => 
46
                 'mimeSupport'     => Syncroton_Command_Sync::MIMESUPPORT_DONT_SEND_MIME,
47
-                'bodyPreferences' => array(),
48
-            ),
49
-        );
50
+                'bodyPreferences' => ,
51
+            ,
52
+        ;
53
 
54
         // Process Query
55
         if ($this->_store'name' == 'GAL') {
56
@@ -176,15 +176,15 @@
57
                 $this->_store'options''range' = (string) $xmlStore->Options->Range;
58
             } else {
59
                 switch ($this->_store'name') {
60
-                case 'DocumentLibrary':
61
-                case 'Document Library': //?
62
-                    $this->_store'options''range' = '0-999';
63
-                    break;
64
-                case 'Mailbox':
65
-                case 'GAL':
66
-                default:
67
-                    $this->_store'options''range' = '0-99';
68
-                    break;
69
+                    case 'DocumentLibrary':
70
+                    case 'Document Library': //?
71
+                        $this->_store'options''range' = '0-999';
72
+                        break;
73
+                    case 'Mailbox':
74
+                    case 'GAL':
75
+                    default:
76
+                        $this->_store'options''range' = '0-99';
77
+                        break;
78
                 }
79
             }
80
 
81
@@ -193,20 +193,20 @@
82
             if (isset($xmlStore->Options->MIMESupport)) {
83
                 $this->_store'options''mimeSupport' = (int) $xmlStore->Options->MIMESupport;
84
             }
85
-/*
86
-            if (isset($xmlStore->Options->MIMETruncation)) {
87
-                $this->_store'options''mimeTruncation' = (int)$xmlStore->Options->MIMETruncation;
88
-            }
89
-*/
90
+            /*
91
+                        if (isset($xmlStore->Options->MIMETruncation)) {
92
+                            $this->_store'options''mimeTruncation' = (int)$xmlStore->Options->MIMETruncation;
93
+                        }
94
+            */
95
             // try to fetch element from AirSyncBase:BodyPreference
96
             $airSyncBase = $xmlStore->Options->children('uri:AirSyncBase');
97
 
98
             if (isset($airSyncBase->BodyPreference)) {
99
                 foreach ($airSyncBase->BodyPreference as $bodyPreference) {
100
                     $type = (int) $bodyPreference->Type;
101
-                    $this->_store'options''bodyPreferences'$type = array(
102
-                        'type' => $type
103
-                    );
104
+                    $this->_store'options''bodyPreferences'$type = 
105
+                        'type' => $type,
106
+                    ;
107
 
108
                     // optional
109
                     if (isset($bodyPreference->TruncationSize)) {
110
@@ -244,4 +244,4 @@
111
     {
112
         unset($this->_store$name);
113
     }
114
-}
115
\ No newline at end of file
116
+}
117
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Model/StoreResponse.php Changed
101
 
1
@@ -1,12 +1,13 @@
2
 <?php
3
+
4
 /**
5
  * Syncroton
6
  *
7
  * @package     Syncroton
8
  * @subpackage  Model
9
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
10
- * @copyright   Copyright (c) 2012-2012 Metaways Infosystems GmbH (http://www.metaways.de)
11
- * @author      Lars Kneschke <l.kneschke@metaways.de>
12
+ * @copyright   Copyright (c) 2012-2014 Kolab Systems AG
13
+ * @author      Aleksander Machniak <machniak@kolabsys.com>
14
  */
15
 
16
 /**
17
@@ -14,40 +15,41 @@
18
  *
19
  * @package    Syncroton
20
  * @subpackage Model
21
- * @property  string  status
22
- * @property  array   result
23
- * @property  array   range
24
- * @property  int     total
25
+ *
26
+ * @property  int     $status
27
+ * @property  array   $result
28
+ * @property  array   $range
29
+ * @property  int     $total
30
  */
31
 class Syncroton_Model_StoreResponse extends Syncroton_Model_AXMLEntry
32
 {
33
     /**
34
      * status constants
35
      */
36
-    const STATUS_SUCCESS            = 1;
37
-    const STATUS_INVALIDREQUEST     = 2;
38
-    const STATUS_SERVERERROR        = 3;
39
-    const STATUS_BADLINK            = 4;
40
-    const STATUS_ACCESSDENIED       = 5;
41
-    const STATUS_NOTFOUND           = 6;
42
-    const STATUS_CONNECTIONFAILED   = 7;
43
-    const STATUS_TOOCOMPLEX         = 8;
44
-    const STATUS_TIMEDOUT           = 10;
45
-    const STATUS_FOLDERSYNCREQUIRED = 11;
46
-    const STATUS_ENDOFRANGE         = 12;
47
-    const STATUS_ACCESSBLOCKED      = 13;
48
-    const STATUS_CREDENTIALSREQUIRED = 14;
49
+    public const STATUS_SUCCESS            = 1;
50
+    public const STATUS_INVALIDREQUEST     = 2;
51
+    public const STATUS_SERVERERROR        = 3;
52
+    public const STATUS_BADLINK            = 4;
53
+    public const STATUS_ACCESSDENIED       = 5;
54
+    public const STATUS_NOTFOUND           = 6;
55
+    public const STATUS_CONNECTIONFAILED   = 7;
56
+    public const STATUS_TOOCOMPLEX         = 8;
57
+    public const STATUS_TIMEDOUT           = 10;
58
+    public const STATUS_FOLDERSYNCREQUIRED = 11;
59
+    public const STATUS_ENDOFRANGE         = 12;
60
+    public const STATUS_ACCESSBLOCKED      = 13;
61
+    public const STATUS_CREDENTIALSREQUIRED = 14;
62
 
63
     protected $_xmlBaseElement = 'Store';
64
 
65
-    protected $_properties = array(
66
-        'Search' => array(
67
-            'status'    => array('type' => 'number'),
68
-            'result'    => array('type' => 'container', 'multiple' => true),
69
-            'range'     => array('type' => 'string'),
70
-            'total'     => array('type' => 'number'),
71
-        )
72
-    );
73
+    protected $_properties = 
74
+        'Search' => 
75
+            'status'    => 'type' => 'number',
76
+            'result'    => 'type' => 'container', 'multiple' => true,
77
+            'range'     => 'type' => 'string',
78
+            'total'     => 'type' => 'number',
79
+        ,
80
+    ;
81
 
82
     /**
83
      * (non-PHPdoc)
84
@@ -63,7 +65,7 @@
85
                 continue;
86
             }
87
 
88
-            list ($nameSpace, $elementProperties) = $this->_getElementProperties($elementName);
89
+            $nameSpace, $elementProperties = $this->_getElementProperties($elementName);
90
 
91
             $nameSpace = 'uri:' . $nameSpace;
92
 
93
@@ -81,6 +83,7 @@
94
                         $value = implode('-', $value);
95
                     }
96
 
97
+                    // no break
98
                 default:
99
                     $element = $_domParrent->ownerDocument->createElementNS($nameSpace, ucfirst($elementName));
100
                     $element->appendChild($_domParrent->ownerDocument->createTextNode($value));
101
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Model/StoreResponseResult.php Changed
26
 
1
@@ -19,14 +19,14 @@
2
 {
3
     protected $_xmlBaseElement = 'Result';
4
 
5
-    protected $_properties = array(
6
-        'AirSync' => array(
7
-            'class'        => array('type' => 'string'),
8
-            'collectionId' => array('type' => 'string'),
9
-        ),
10
-        'Search' => array(
11
-            'longId'     => array('type' => 'string', 'supportedSince' => '2.5'),
12
-            'properties' => array('type' => 'container', 'supportedSince' => '2.5'),
13
-        )
14
-    );
15
+    protected $_properties = 
16
+        'AirSync' => 
17
+            'class'        => 'type' => 'string',
18
+            'collectionId' => 'type' => 'string',
19
+        ,
20
+        'Search' => 
21
+            'longId'     => 'type' => 'string', 'supportedSince' => '2.5',
22
+            'properties' => 'type' => 'container', 'supportedSince' => '2.5',
23
+        ,
24
+    ;
25
 }
26
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Model/SyncCollection.php Changed
201
 
1
@@ -14,35 +14,39 @@
2
  *
3
  * @package     Syncroton
4
  * @subpackage  Model
5
- * @property    string  class
6
- * @property    string  collectionId
7
- * @property    bool    deletesAsMoves
8
- * @property    bool    getChanges
9
- * @property    string  syncKey
10
- * @property    int     windowSize
11
+ *
12
+ * @property string                      $class
13
+ * @property string                      $collectionId
14
+ * @property bool                        $deletesAsMoves
15
+ * @property Syncroton_Model_IFolder     $folder
16
+ * @property bool                        $getChanges
17
+ * @property array                       $options
18
+ * @property int                         $syncKey
19
+ * @property ?Syncroton_Model_ISyncState $syncState
20
+ * @property array                       $toBeFetched
21
+ * @property int                         $windowSize
22
  */
23
-
24
 class Syncroton_Model_SyncCollection extends Syncroton_Model_AXMLEntry
25
 {
26
-    protected $_elements = array(
27
+    protected $_elements = 
28
         'syncState' => null,
29
-        'folder'    => null
30
-    );
31
-    
32
+        'folder'    => null,
33
+    ;
34
+
35
     protected $_xmlCollection;
36
-    
37
+
38
     protected $_xmlBaseElement = 'Collection';
39
-    
40
-    public function __construct($properties = null)
41
-    {
42
-        if ($properties instanceof SimpleXMLElement) {
43
-            $this->setFromSimpleXMLElement($properties);
44
-        } elseif (is_array($properties)) {
45
-            $this->setFromArray($properties);
46
+
47
+    public function __construct($properties = null)
48
+    {
49
+        if ($properties instanceof SimpleXMLElement) {
50
+            $this->setFromSimpleXMLElement($properties);
51
+        } elseif (is_array($properties)) {
52
+            $this->setFromArray($properties);
53
         }
54
-        
55
+
56
         if (!isset($this->_elements'options')) {
57
-            $this->_elements'options' = array();
58
+            $this->_elements'options' = ;
59
         }
60
         if (!isset($this->_elements'options''filterType')) {
61
             $this->_elements'options''filterType' = Syncroton_Command_Sync::FILTER_NOTHING;
62
@@ -53,14 +57,14 @@
63
         if (!isset($this->_elements'options''mimeTruncation')) {
64
             $this->_elements'options''mimeTruncation' = Syncroton_Command_Sync::TRUNCATE_NOTHING;
65
         }
66
-            if (!isset($this->_elements'options''bodyPreferences')) {
67
-            $this->_elements'options''bodyPreferences' = array();
68
+        if (!isset($this->_elements'options''bodyPreferences')) {
69
+            $this->_elements'options''bodyPreferences' = ;
70
         }
71
-    }
72
-    
73
+    }
74
+
75
     /**
76
      * return XML element which holds all client Add commands
77
-     * 
78
+     *
79
      * @return SimpleXMLElement
80
      */
81
     public function getClientAdds()
82
@@ -68,13 +72,13 @@
83
         if (! $this->_xmlCollection instanceof SimpleXMLElement) {
84
             throw new InvalidArgumentException('no collection xml element set');
85
         }
86
-        
87
+
88
         return $this->_xmlCollection->Commands->Add;
89
     }
90
-    
91
+
92
     /**
93
      * return XML element which holds all client Change commands
94
-     * 
95
+     *
96
      * @return SimpleXMLElement
97
      */
98
     public function getClientChanges()
99
@@ -82,13 +86,13 @@
100
         if (! $this->_xmlCollection instanceof SimpleXMLElement) {
101
             throw new InvalidArgumentException('no collection xml element set');
102
         }
103
-        
104
+
105
         return $this->_xmlCollection->Commands->Change;
106
     }
107
-    
108
+
109
     /**
110
      * return XML element which holds all client Delete commands
111
-     * 
112
+     *
113
      * @return SimpleXMLElement
114
      */
115
     public function getClientDeletes()
116
@@ -96,13 +100,13 @@
117
         if (! $this->_xmlCollection instanceof SimpleXMLElement) {
118
             throw new InvalidArgumentException('no collection xml element set');
119
         }
120
-        
121
+
122
         return $this->_xmlCollection->Commands->Delete;
123
     }
124
-    
125
+
126
     /**
127
      * return XML element which holds all client Fetch commands
128
-     * 
129
+     *
130
      * @return SimpleXMLElement
131
      */
132
     public function getClientFetches()
133
@@ -110,13 +114,13 @@
134
         if (! $this->_xmlCollection instanceof SimpleXMLElement) {
135
             throw new InvalidArgumentException('no collection xml element set');
136
         }
137
-        
138
+
139
         return $this->_xmlCollection->Commands->Fetch;
140
     }
141
-    
142
+
143
     /**
144
      * check if client sent a Add command
145
-     * 
146
+     *
147
      * @throws InvalidArgumentException
148
      * @return bool
149
      */
150
@@ -125,13 +129,13 @@
151
         if (! $this->_xmlCollection instanceof SimpleXMLElement) {
152
             return false;
153
         }
154
-        
155
+
156
         return isset($this->_xmlCollection->Commands->Add);
157
     }
158
-    
159
+
160
     /**
161
      * check if client sent a Change command
162
-     * 
163
+     *
164
      * @throws InvalidArgumentException
165
      * @return bool
166
      */
167
@@ -140,13 +144,13 @@
168
         if (! $this->_xmlCollection instanceof SimpleXMLElement) {
169
             return false;
170
         }
171
-        
172
+
173
         return isset($this->_xmlCollection->Commands->Change);
174
     }
175
-    
176
+
177
     /**
178
      * check if client sent a Delete command
179
-     * 
180
+     *
181
      * @throws InvalidArgumentException
182
      * @return bool
183
      */
184
@@ -155,13 +159,13 @@
185
         if (! $this->_xmlCollection instanceof SimpleXMLElement) {
186
             return false;
187
         }
188
-        
189
+
190
         return isset($this->_xmlCollection->Commands->Delete);
191
     }
192
-    
193
+
194
     /**
195
      * check if client sent a Fetch command
196
-     * 
197
+     *
198
      * @throws InvalidArgumentException
199
      * @return bool
200
      */
201
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Model/SyncState.php Changed
6
 
1
@@ -18,4 +18,3 @@
2
 class Syncroton_Model_SyncState extends Syncroton_Model_AEntry implements Syncroton_Model_ISyncState
3
 {
4
 }
5
-
6
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Model/Task.php Changed
68
 
1
@@ -14,35 +14,37 @@
2
  *
3
  * @package     Syncroton
4
  * @subpackage  Model
5
- * @property    string  class
6
- * @property    string  collectionId
7
- * @property    bool    deletesAsMoves
8
- * @property    bool    getChanges
9
- * @property    string  syncKey
10
- * @property    int     windowSize
11
+ * @property    string   $class
12
+ * @property    string   $collectionId
13
+ * @property    bool     $deletesAsMoves
14
+ * @property    bool     $getChanges
15
+ * @property    string   $syncKey
16
+ * @property    DateTime $utcDueDate
17
+ * @property    DateTime $utcStartDate
18
+ * @property    int      $windowSize
19
  */
20
 class Syncroton_Model_Task extends Syncroton_Model_AXMLEntry
21
 {
22
     protected $_xmlBaseElement = 'ApplicationData';
23
-    
24
-    protected $_properties = array(
25
-        'AirSyncBase' => array(
26
-            'body'                   => array('type' => 'container', 'class' => 'Syncroton_Model_EmailBody')
27
-        ),
28
-        'Tasks' => array(
29
-            'categories'              => array('type' => 'container', 'childElement' => 'category'),
30
-            'complete'                => array('type' => 'number'),
31
-            'dateCompleted'           => array('type' => 'datetime'),
32
-            'dueDate'                 => array('type' => 'datetime'),
33
-            'importance'              => array('type' => 'number'),
34
-            'recurrence'              => array('type' => 'container'),
35
-            'reminderSet'             => array('type' => 'number'),
36
-            'reminderTime'            => array('type' => 'datetime'),
37
-            'sensitivity'             => array('type' => 'number'),
38
-            'startDate'               => array('type' => 'datetime'),
39
-            'subject'                 => array('type' => 'string'),
40
-            'utcDueDate'              => array('type' => 'datetime'),
41
-            'utcStartDate'            => array('type' => 'datetime'),
42
-        )
43
-    );
44
-}
45
\ No newline at end of file
46
+
47
+    protected $_properties = 
48
+        'AirSyncBase' => 
49
+            'body'                   => 'type' => 'container', 'class' => 'Syncroton_Model_EmailBody',
50
+        ,
51
+        'Tasks' => 
52
+            'categories'              => 'type' => 'container', 'childElement' => 'category',
53
+            'complete'                => 'type' => 'number',
54
+            'dateCompleted'           => 'type' => 'datetime',
55
+            'dueDate'                 => 'type' => 'datetime',
56
+            'importance'              => 'type' => 'number',
57
+            'recurrence'              => 'type' => 'container',
58
+            'reminderSet'             => 'type' => 'number',
59
+            'reminderTime'            => 'type' => 'datetime',
60
+            'sensitivity'             => 'type' => 'number',
61
+            'startDate'               => 'type' => 'datetime',
62
+            'subject'                 => 'type' => 'string',
63
+            'utcDueDate'              => 'type' => 'datetime',
64
+            'utcStartDate'            => 'type' => 'datetime',
65
+        ,
66
+    ;
67
+}
68
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Model/TaskRecurrence.php Changed
98
 
1
@@ -14,54 +14,54 @@
2
  *
3
  * @package     Syncroton
4
  * @subpackage  Model
5
- * @property    string  class
6
- * @property    string  collectionId
7
- * @property    bool    deletesAsMoves
8
- * @property    bool    getChanges
9
- * @property    string  syncKey
10
- * @property    int     windowSize
11
+ * @property    string  $class
12
+ * @property    string  $collectionId
13
+ * @property    bool    $deletesAsMoves
14
+ * @property    bool    $getChanges
15
+ * @property    string  $syncKey
16
+ * @property    int     $windowSize
17
  */
18
 class Syncroton_Model_TaskRecurrence extends Syncroton_Model_AXMLEntry
19
 {
20
     protected $_xmlBaseElement = 'Recurrence';
21
-    
22
+
23
     /**
24
      * recur types
25
      */
26
-    const TYPE_DAILY          = 0;     // Recurs daily.
27
-    const TYPE_WEEKLY         = 1;     // Recurs weekly
28
-    const TYPE_MONTHLY        = 2;     // Recurs monthly
29
-    const TYPE_MONTHLY_DAYN   = 3;     // Recurs monthly on the nth day
30
-    const TYPE_YEARLY         = 5;     // Recurs yearly
31
-    const TYPE_YEARLY_DAYN    = 6;     // Recurs yearly on the nth day
32
-    
33
+    public const TYPE_DAILY          = 0;     // Recurs daily.
34
+    public const TYPE_WEEKLY         = 1;     // Recurs weekly
35
+    public const TYPE_MONTHLY        = 2;     // Recurs monthly
36
+    public const TYPE_MONTHLY_DAYN   = 3;     // Recurs monthly on the nth day
37
+    public const TYPE_YEARLY         = 5;     // Recurs yearly
38
+    public const TYPE_YEARLY_DAYN    = 6;     // Recurs yearly on the nth day
39
+
40
     /**
41
      * day of week constants
42
      */
43
-    const RECUR_DOW_SUNDAY      = 1;
44
-    const RECUR_DOW_MONDAY      = 2;
45
-    const RECUR_DOW_TUESDAY     = 4;
46
-    const RECUR_DOW_WEDNESDAY   = 8;
47
-    const RECUR_DOW_THURSDAY    = 16;
48
-    const RECUR_DOW_FRIDAY      = 32;
49
-    const RECUR_DOW_SATURDAY    = 64;
50
-        
51
-    protected $_properties = array(
52
-        'Tasks' => array(
53
-            'calendarType'            => array('type' => 'number'),
54
-            'dayOfMonth'              => array('type' => 'number'),
55
-            'dayOfWeek'               => array('type' => 'number'),
56
-            'deadOccur'               => array('type' => 'number'),
57
-            'firstDayOfWeek'          => array('type' => 'number'),
58
-            'interval'                => array('type' => 'number'),
59
-            'isLeapMonth'             => array('type' => 'number'),
60
-            'monthOfYear'             => array('type' => 'number'),
61
-            'occurrences'             => array('type' => 'number'),
62
-            'regenerate'              => array('type' => 'number'),
63
-            'start'                   => array('type' => 'datetime'),
64
-            'type'                    => array('type' => 'number'),
65
-            'until'                   => array('type' => 'datetime'),
66
-            'weekOfMonth'             => array('type' => 'number'),
67
-        )
68
-    );
69
-}
70
\ No newline at end of file
71
+    public const RECUR_DOW_SUNDAY      = 1;
72
+    public const RECUR_DOW_MONDAY      = 2;
73
+    public const RECUR_DOW_TUESDAY     = 4;
74
+    public const RECUR_DOW_WEDNESDAY   = 8;
75
+    public const RECUR_DOW_THURSDAY    = 16;
76
+    public const RECUR_DOW_FRIDAY      = 32;
77
+    public const RECUR_DOW_SATURDAY    = 64;
78
+
79
+    protected $_properties = 
80
+        'Tasks' => 
81
+            'calendarType'            => 'type' => 'number',
82
+            'dayOfMonth'              => 'type' => 'number',
83
+            'dayOfWeek'               => 'type' => 'number',
84
+            'deadOccur'               => 'type' => 'number',
85
+            'firstDayOfWeek'          => 'type' => 'number',
86
+            'interval'                => 'type' => 'number',
87
+            'isLeapMonth'             => 'type' => 'number',
88
+            'monthOfYear'             => 'type' => 'number',
89
+            'occurrences'             => 'type' => 'number',
90
+            'regenerate'              => 'type' => 'number',
91
+            'start'                   => 'type' => 'datetime',
92
+            'type'                    => 'type' => 'number',
93
+            'until'                   => 'type' => 'datetime',
94
+            'weekOfMonth'             => 'type' => 'number',
95
+        ,
96
+    ;
97
+}
98
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Registry.php Changed
201
 
1
@@ -27,33 +27,34 @@
2
  */
3
 class Syncroton_Registry extends ArrayObject
4
 {
5
-    const CALENDAR_DATA_CLASS = 'calendar_data_class';
6
-    const CONTACTS_DATA_CLASS = 'contacts_data_class';
7
-    const EMAIL_DATA_CLASS    = 'email_data_class';
8
-    const NOTES_DATA_CLASS    = 'notes_data_class';
9
-    const TASKS_DATA_CLASS    = 'tasks_data_class';
10
-    const GAL_DATA_CLASS      = 'gal_data_class';
11
-    
12
-    const DEFAULT_POLICY      = 'default_policy';
13
-    const PING_TIMEOUT        = 'ping_timeout';
14
-    const PING_INTERVAL       = 'ping_interval';
15
-    const QUIET_TIME          = 'quiet_time';
16
-    const SESSION_VALIDATOR   = 'session_validator';
17
-    const MAX_COLLECTIONS     = 'max_collections';
18
-    
19
-    const DATABASE            = 'database';
20
-    const TRANSACTIONMANAGER  = 'transactionmanager';
21
-    
22
-    const CONTENTSTATEBACKEND = 'contentstatebackend';
23
-    const DEVICEBACKEND       = 'devicebackend';
24
-    const FOLDERBACKEND       = 'folderbackend';
25
-    const POLICYBACKEND       = 'policybackend';
26
-    const SYNCSTATEBACKEND    = 'syncstatebackend';
27
-    const LOGGERBACKEND       = 'loggerBackend';
28
-
29
-    const SLEEP_CALLBACK      = 'sleep_callback';
30
-    const WAKEUP_CALLBACK     = 'wakeup_callback';
31
-    
32
+    public const CALENDAR_DATA_CLASS = 'calendar_data_class';
33
+    public const CONTACTS_DATA_CLASS = 'contacts_data_class';
34
+    public const EMAIL_DATA_CLASS    = 'email_data_class';
35
+    public const NOTES_DATA_CLASS    = 'notes_data_class';
36
+    public const TASKS_DATA_CLASS    = 'tasks_data_class';
37
+    public const GAL_DATA_CLASS      = 'gal_data_class';
38
+
39
+    public const DEFAULT_POLICY      = 'default_policy';
40
+    public const PING_TIMEOUT        = 'ping_timeout';
41
+    public const PING_INTERVAL       = 'ping_interval';
42
+    public const QUIET_TIME          = 'quiet_time';
43
+    public const SESSION_VALIDATOR   = 'session_validator';
44
+    public const MAX_COLLECTIONS     = 'max_collections';
45
+    public const MAX_PING_INTERVAL   = 'max_ping_interval';
46
+
47
+    public const DATABASE            = 'database';
48
+    public const TRANSACTIONMANAGER  = 'transactionmanager';
49
+
50
+    public const CONTENTSTATEBACKEND = 'contentstatebackend';
51
+    public const DEVICEBACKEND       = 'devicebackend';
52
+    public const FOLDERBACKEND       = 'folderbackend';
53
+    public const POLICYBACKEND       = 'policybackend';
54
+    public const SYNCSTATEBACKEND    = 'syncstatebackend';
55
+    public const LOGGERBACKEND       = 'loggerBackend';
56
+
57
+    public const SLEEP_CALLBACK      = 'sleep_callback';
58
+    public const WAKEUP_CALLBACK     = 'wakeup_callback';
59
+
60
     /**
61
      * Class name of the singleton registry object.
62
      * @var string
63
@@ -62,7 +63,7 @@
64
 
65
     /**
66
      * Registry object provides storage for shared objects.
67
-     * @var Syncroton_Registry
68
+     * @var Syncroton_Registry|null
69
      */
70
     private static $_registry = null;
71
 
72
@@ -87,10 +88,10 @@
73
     {
74
         return self::get(self::DATABASE);
75
     }
76
-    
77
+
78
     /**
79
-     * return transaction manager class 
80
-     * 
81
+     * return transaction manager class
82
+     *
83
      * @return Syncroton_TransactionManagerInterface
84
      */
85
     public static function getTransactionManager()
86
@@ -98,10 +99,10 @@
87
         if (!self::isRegistered(self::TRANSACTIONMANAGER)) {
88
             self::set(self::TRANSACTIONMANAGER, Syncroton_TransactionManager::getInstance());
89
         }
90
-        
91
+
92
         return self::get(self::TRANSACTIONMANAGER);
93
-    } 
94
-    
95
+    }
96
+
97
     /**
98
      * Set the default registry instance to a specified instance.
99
      *
100
@@ -196,13 +197,13 @@
101
 
102
         return $instance->offsetGet($index);
103
     }
104
-    
105
+
106
     /**
107
      * returns content state backend
108
-     * 
109
+     *
110
      * creates Syncroton_Backend_Content on the fly if not before via
111
      * Syncroton_Registry::set(self::CONTENTSTATEBACKEND, $backend);
112
-     * 
113
+     *
114
      * @return Syncroton_Backend_IContent
115
      */
116
     public static function getContentStateBackend()
117
@@ -210,16 +211,16 @@
118
         if (!self::isRegistered(self::CONTENTSTATEBACKEND)) {
119
             self::set(self::CONTENTSTATEBACKEND, new Syncroton_Backend_Content(self::getDatabase()));
120
         }
121
-        
122
+
123
         return self::get(self::CONTENTSTATEBACKEND);
124
     }
125
 
126
     /**
127
      * returns device backend
128
-     * 
129
+     *
130
      * creates Syncroton_Backend_Device on the fly if not before via
131
      * Syncroton_Registry::set(self::DEVICEBACKEND, $backend);
132
-     * 
133
+     *
134
      * @return Syncroton_Backend_IDevice
135
      */
136
     public static function getDeviceBackend()
137
@@ -227,16 +228,16 @@
138
         if (!self::isRegistered(self::DEVICEBACKEND)) {
139
             self::set(self::DEVICEBACKEND, new Syncroton_Backend_Device(self::getDatabase()));
140
         }
141
-        
142
+
143
         return self::get(self::DEVICEBACKEND);
144
     }
145
 
146
     /**
147
      * returns folder backend
148
-     * 
149
+     *
150
      * creates Syncroton_Backend_Folder on the fly if not before via
151
      * Syncroton_Registry::set(self::FOLDERBACKEND, $backend);
152
-     * 
153
+     *
154
      * @return Syncroton_Backend_IFolder
155
      */
156
     public static function getFolderBackend()
157
@@ -244,10 +245,10 @@
158
         if (!self::isRegistered(self::FOLDERBACKEND)) {
159
             self::set(self::FOLDERBACKEND, new Syncroton_Backend_Folder(self::getDatabase()));
160
         }
161
-        
162
+
163
         return self::get(self::FOLDERBACKEND);
164
     }
165
-    
166
+
167
     /**
168
      * Return maximum ping interval (HeartbeatInterval) value (in seconds)
169
      *
170
@@ -261,7 +262,7 @@
171
 
172
         return self::get(self::PING_INTERVAL);
173
     }
174
-    
175
+
176
     /**
177
     /**
178
      * Return maximum ping interval (HeartbeatInterval) value (in seconds)
179
@@ -278,10 +279,10 @@
180
     }
181
 
182
     /**
183
-     * return ping timeout 
184
-     * 
185
-     * sleep "ping timeout" seconds between folder checks in Ping and Sync command 
186
-     * 
187
+     * return ping timeout
188
+     *
189
+     * sleep "ping timeout" seconds between folder checks in Ping and Sync command
190
+     *
191
      * @return int
192
      */
193
     public static function getPingTimeout()
194
@@ -289,10 +290,10 @@
195
         if (!self::isRegistered(self::PING_TIMEOUT)) {
196
             return 60;
197
         }
198
-        
199
+
200
         return self::get(self::PING_TIMEOUT);
201
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Server.php Changed
201
 
1
@@ -10,113 +10,116 @@
2
 
3
 /**
4
  * class to handle incoming http ActiveSync requests
5
- * 
6
+ *
7
  * @package     Syncroton
8
  */
9
 class Syncroton_Server
10
 {
11
-    const PARAMETER_ATTACHMENTNAME = 0;
12
-    const PARAMETER_COLLECTIONID   = 1;
13
-    const PARAMETER_ITEMID         = 3;
14
-    const PARAMETER_OPTIONS        = 7;
15
-    const MAX_HEARTBEAT_INTERVAL   = 3540; // 59 minutes
16
-    
17
+    public const PARAMETER_ATTACHMENTNAME = 0;
18
+    public const PARAMETER_COLLECTIONID   = 1;
19
+    public const PARAMETER_ITEMID         = 3;
20
+    public const PARAMETER_OPTIONS        = 7;
21
+    public const MAX_HEARTBEAT_INTERVAL   = 3540; // 59 minutes
22
+
23
     protected $_body;
24
-    
25
+
26
     /**
27
      * informations about the currently device
28
      *
29
      * @var Syncroton_Backend_IDevice
30
      */
31
     protected $_deviceBackend;
32
-    
33
+
34
     /**
35
      * @var Zend_Log
36
      */
37
     protected $_logger;
38
-    
39
+
40
     /**
41
      * @var Zend_Controller_Request_Http
42
      */
43
     protected $_request;
44
-    
45
+
46
     protected $_userId;
47
-    
48
+
49
     public function __construct($userId, Zend_Controller_Request_Http $request = null, $body = null)
50
     {
51
         if (Syncroton_Registry::isRegistered('loggerBackend')) {
52
             $this->_logger = Syncroton_Registry::get('loggerBackend');
53
         }
54
-        
55
+
56
         $this->_userId  = $userId;
57
         $this->_request = $request instanceof Zend_Controller_Request_Http ? $request : new Zend_Controller_Request_Http();
58
         $this->_body    = $body !== null ? $body : fopen('php://input', 'r');
59
-        
60
+
61
         $this->_deviceBackend = Syncroton_Registry::getDeviceBackend();
62
-        
63
+
64
     }
65
-        
66
+
67
     public function handle()
68
     {
69
-        if ($this->_logger instanceof Zend_Log)
70
+        if ($this->_logger instanceof Zend_Log) {
71
             $this->_logger->debug(__METHOD__ . '::' . __LINE__ . ' REQUEST METHOD: ' . $this->_request->getMethod());
72
-        
73
+        }
74
+
75
         switch($this->_request->getMethod()) {
76
             case 'OPTIONS':
77
                 $this->_handleOptions();
78
                 break;
79
-        
80
+
81
             case 'POST':
82
                 $this->_handlePost();
83
                 break;
84
-        
85
+
86
             case 'GET':
87
                 echo "It works!<br>Your userid is: {$this->_userId} and your IP address is: {$_SERVER'REMOTE_ADDR'}.";
88
                 break;
89
         }
90
     }
91
-    
92
+
93
     /**
94
      * handle options request
95
      */
96
     protected function _handleOptions()
97
     {
98
         $command = new Syncroton_Command_Options();
99
-    
100
+
101
         $this->_sendHeaders($command->getHeaders());
102
     }
103
-    
104
+
105
     protected function _sendHeaders(array $headers)
106
     {
107
         foreach ($headers as $name => $value) {
108
             header($name . ': ' . $value);
109
         }
110
-    } 
111
-    
112
+    }
113
+
114
     /**
115
      * handle post request
116
      */
117
     protected function _handlePost()
118
     {
119
         $requestParameters = $this->_getRequestParameters($this->_request);
120
-        
121
-        if ($this->_logger instanceof Zend_Log) 
122
+
123
+        if ($this->_logger instanceof Zend_Log) {
124
             $this->_logger->debug(__METHOD__ . '::' . __LINE__ . ' REQUEST ' . print_r($requestParameters, true));
125
-        
126
+        }
127
+
128
         $className = 'Syncroton_Command_' . $requestParameters'command';
129
-        
130
+
131
         if (!class_exists($className)) {
132
-            if ($this->_logger instanceof Zend_Log)
133
+            if ($this->_logger instanceof Zend_Log) {
134
                 $this->_logger->notice(__METHOD__ . '::' . __LINE__ . " command not supported: " . $requestParameters'command');
135
-            
136
+            }
137
+
138
             header("HTTP/1.1 501 not implemented");
139
-            
140
+
141
             return;
142
         }
143
-        
144
+
145
         // get user device
146
         $device = $this->_getUserDevice($this->_userId, $requestParameters);
147
-        
148
+
149
         if ($requestParameters'contentType' == 'application/vnd.ms-sync.wbxml' || $requestParameters'contentType' == 'application/vnd.ms-sync') {
150
             // decode wbxml request
151
             try {
152
@@ -126,112 +129,117 @@
153
                     $this->_logDomDocument($requestBody, 'request', __METHOD__, __LINE__);
154
                 }
155
             } catch(Syncroton_Wbxml_Exception_UnexpectedEndOfFile $e) {
156
-                if ($this->_logger instanceof Zend_Log)
157
+                if ($this->_logger instanceof Zend_Log) {
158
                     $this->_logger->warn(__METHOD__ . '::' . __LINE__ . " unexpected end of file.");
159
-                $requestBody = NULL;
160
+                }
161
+                $requestBody = null;
162
             }
163
         } else {
164
             $requestBody = $this->_body;
165
         }
166
-        
167
+
168
         header("MS-Server-ActiveSync: 14.00.0536.000");
169
 
170
         // avoid sending HTTP header "Content-Type: text/html" for empty sync responses
171
         ini_set('default_mimetype', 'application/vnd.ms-sync.wbxml');
172
-        
173
+
174
         try {
175
             $command = new $className($requestBody, $device, $requestParameters);
176
-        
177
+
178
             $response = $command->handle();
179
 
180
             if (!$response) {
181
                 $response = $command->getResponse();
182
             }
183
         } catch (Syncroton_Exception_ProvisioningNeeded $sepn) {
184
-            if ($this->_logger instanceof Zend_Log) 
185
+            if ($this->_logger instanceof Zend_Log) {
186
                 $this->_logger->info(__METHOD__ . '::' . __LINE__ . " provisioning needed");
187
-            
188
+            }
189
+
190
             header("HTTP/1.1 449 Retry after sending a PROVISION command");
191
-            
192
+
193
             if (version_compare($device->acsversion, '14.0', '>=')) {
194
                 $response = $sepn->domDocument;
195
             } else {
196
                 // pre 14.0 method
197
                 return;
198
             }
199
-            
200
+
201
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/TransactionManager.php Changed
201
 
1
@@ -1,7 +1,7 @@
2
 <?php
3
 /**
4
  * Syncroton
5
- * 
6
+ *
7
  * @package     Syncroton
8
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
9
  * @copyright   Copyright (c) 2008-2012 Metaways Infosystems GmbH (http://www.metaways.de)
10
@@ -10,17 +10,17 @@
11
 
12
 /**
13
  * Transaction Manger for Syncroton
14
- * 
15
+ *
16
  * This is the central class, all transactions within Syncroton must be handled with.
17
- * For each supported transactionable (backend) this class start a real transaction on 
18
+ * For each supported transactionable (backend) this class start a real transaction on
19
  * the first startTransaction request.
20
- * 
21
+ *
22
  * Transactions of all transactionable will be commited at once when all requested transactions
23
  * are being commited using this class.
24
- * 
25
+ *
26
  * Transactions of all transactionable will be roll back when one rollBack is requested
27
  * using this class.
28
- * 
29
+ *
30
  * @package     Syncroton
31
  */
32
 class Syncroton_TransactionManager implements Syncroton_TransactionManagerInterface
33
@@ -28,30 +28,30 @@
34
     /**
35
      * @var array holds all transactionables with open transactions
36
      */
37
-    protected $_openTransactionables = array();
38
-    
39
+    protected $_openTransactionables = ;
40
+
41
     /**
42
      * @var array list of all open (not commited) transactions
43
      */
44
-    protected $_openTransactions = array();
45
+    protected $_openTransactions = ;
46
     /**
47
-     * @var Syncroton_TransactionManager
48
+     * @var ?Syncroton_TransactionManager
49
      */
50
-    private static $_instance = NULL;
51
-    
52
+    private static $_instance = null;
53
+
54
     /**
55
      * @var Zend_Log
56
      */
57
     protected $_logger;
58
-    
59
+
60
     /**
61
      * don't clone. Use the singleton.
62
      */
63
     private function __clone()
64
     {
65
-        
66
+
67
     }
68
-    
69
+
70
     /**
71
      * constructor
72
      */
73
@@ -61,35 +61,37 @@
74
             $this->_logger = Syncroton_Registry::get('loggerBackend');
75
         }
76
     }
77
-    
78
+
79
     /**
80
-     * @return Tinebase_TransactionManager
81
+     * @return Syncroton_TransactionManager
82
      */
83
-    public static function getInstance() 
84
+    public static function getInstance()
85
     {
86
-        if (self::$_instance === NULL) {
87
-            self::$_instance = new Syncroton_TransactionManager;
88
+        if (self::$_instance === null) {
89
+            self::$_instance = new Syncroton_TransactionManager();
90
         }
91
-        
92
+
93
         return self::$_instance;
94
     }
95
-    
96
+
97
     /**
98
      * starts a transaction
99
      *
100
      * @param   mixed $_transactionable
101
      * @return  string transactionId
102
-     * @throws  Tinebase_Exception_UnexpectedValue
103
+     * @throws  Exception
104
      */
105
     public function startTransaction($_transactionable)
106
     {
107
-        if ($this->_logger instanceof Zend_Log) 
108
+        if ($this->_logger instanceof Zend_Log) {
109
             $this->_logger->debug(__METHOD__ . '::' . __LINE__ . "  startTransaction request");
110
-        
111
+        }
112
+
113
         if (! in_array($_transactionable, $this->_openTransactionables)) {
114
-            if ($this->_logger instanceof Zend_Log) 
115
+            if ($this->_logger instanceof Zend_Log) {
116
                 $this->_logger->debug(__METHOD__ . '::' . __LINE__ . "  new transactionable. Starting transaction on this resource");
117
-            
118
+            }
119
+
120
             if ($_transactionable instanceof Zend_Db_Adapter_Abstract) {
121
                 #Tinebase_Backend_Sql_Command::setAutocommit($_transactionable,false);
122
                 $_transactionable->beginTransaction();
123
@@ -97,19 +99,20 @@
124
                 $this->rollBack();
125
                 throw new Syncroton_Exception_UnexpectedValue('Unsupported transactionable!');
126
             }
127
-            
128
+
129
             array_push($this->_openTransactionables, $_transactionable);
130
         }
131
-        
132
-        $transactionId = sha1(mt_rand(). microtime());
133
+
134
+        $transactionId = sha1(mt_rand() . microtime());
135
         array_push($this->_openTransactions, $transactionId);
136
-        
137
-        if ($this->_logger instanceof Zend_Log) 
138
+
139
+        if ($this->_logger instanceof Zend_Log) {
140
             $this->_logger->debug(__METHOD__ . '::' . __LINE__ . "  queued transaction with id $transactionId");
141
-        
142
+        }
143
+
144
         return $transactionId;
145
     }
146
-    
147
+
148
     /**
149
      * commits a transaction
150
      *
151
@@ -118,51 +121,55 @@
152
      */
153
     public function commitTransaction($_transactionId)
154
     {
155
-        if ($this->_logger instanceof Zend_Log) 
156
+        if ($this->_logger instanceof Zend_Log) {
157
             $this->_logger->debug(__METHOD__ . '::' . __LINE__ . "  commitTransaction request for $_transactionId");
158
-        
159
+        }
160
+
161
         $transactionIdx = array_search($_transactionId, $this->_openTransactions);
162
         if ($transactionIdx !== false) {
163
             unset($this->_openTransactions$transactionIdx);
164
         }
165
-        
166
+
167
         $numOpenTransactions = count($this->_openTransactions);
168
-        
169
+
170
         if ($numOpenTransactions === 0) {
171
-            if ($this->_logger instanceof Zend_Log) 
172
+            if ($this->_logger instanceof Zend_Log) {
173
                 $this->_logger->debug(__METHOD__ . '::' . __LINE__ . "  no more open transactions in queue commiting all transactionables");
174
+            }
175
             foreach ($this->_openTransactionables as $transactionableIdx => $transactionable) {
176
                 if ($transactionable instanceof Zend_Db_Adapter_Abstract) {
177
                     $transactionable->commit();
178
                     #Tinebase_Backend_Sql_Command::setAutocommit($transactionable,true);
179
                 }
180
             }
181
-            $this->_openTransactionables = array();
182
-            $this->_openTransactions = array();
183
+            $this->_openTransactionables = ;
184
+            $this->_openTransactions = ;
185
         } else {
186
-            if ($this->_logger instanceof Zend_Log) 
187
+            if ($this->_logger instanceof Zend_Log) {
188
                 $this->_logger->debug(__METHOD__ . '::' . __LINE__ . "  commiting defered, as there are still $numOpenTransactions in the queue");
189
+            }
190
         }
191
     }
192
-    
193
+
194
     /**
195
      * perform rollBack on all transactionables with open transactions
196
-     * 
197
+     *
198
      * @return void
199
      */
200
     public function rollBack()
201
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/TransactionManagerInterface.php Changed
68
 
1
@@ -1,7 +1,7 @@
2
 <?php
3
 /**
4
  * Syncroton
5
- * 
6
+ *
7
  * @package     Syncroton
8
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
9
  * @copyright   Copyright (c) 2008-2012 Metaways Infosystems GmbH (http://www.metaways.de)
10
@@ -10,35 +10,35 @@
11
 
12
 /**
13
  * Transaction Manger for Syncroton
14
- * 
15
+ *
16
  * This is the central class, all transactions within Syncroton must be handled with.
17
- * For each supported transactionable (backend) this class start a real transaction on 
18
+ * For each supported transactionable (backend) this class start a real transaction on
19
  * the first startTransaction request.
20
- * 
21
+ *
22
  * Transactions of all transactionable will be commited at once when all requested transactions
23
  * are being commited using this class.
24
- * 
25
+ *
26
  * Transactions of all transactionable will be roll back when one rollBack is requested
27
  * using this class.
28
- * 
29
+ *
30
  * @package     Syncroton
31
  */
32
 interface Syncroton_TransactionManagerInterface
33
 {
34
     /**
35
-     * @return Tinebase_TransactionManager
36
+     * @return mixed
37
      */
38
     public static function getInstance();
39
-    
40
+
41
     /**
42
      * starts a transaction
43
      *
44
      * @param   mixed $_transactionable
45
      * @return  string transactionId
46
-     * @throws  Tinebase_Exception_UnexpectedValue
47
+     * @throws  Exception
48
      */
49
     public function startTransaction($_transactionable);
50
-    
51
+
52
     /**
53
      * commits a transaction
54
      *
55
@@ -46,10 +46,10 @@
56
      * @return void
57
      */
58
     public function commitTransaction($_transactionId);
59
-    
60
+
61
     /**
62
      * perform rollBack on all transactionables with open transactions
63
-     * 
64
+     *
65
      * @return void
66
      */
67
     public function rollBack();
68
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Wbxml/Abstract.php Changed
201
 
1
@@ -16,7 +16,7 @@
2
  * @package     Wbxml
3
  * @subpackage  Wbxml
4
  */
5
- 
6
+
7
 abstract class Syncroton_Wbxml_Abstract
8
 {
9
     /**
10
@@ -25,83 +25,83 @@
11
      * @var resource
12
      */
13
     protected $_stream;
14
-    
15
+
16
     /**
17
      * the wbxml version
18
      *
19
-     * @var string
20
+     * @var int
21
      */
22
     protected $_version;
23
-    
24
+
25
     /**
26
-     * the Document Public Identifier 
27
+     * the Document Public Identifier
28
      *
29
      * @var string
30
      */
31
     protected $_dpi;
32
-    
33
+
34
     /**
35
      * the current active dtd
36
      *
37
-     * @var Syncroton_Wbxml_Dtd_Syncml_Abstract
38
+     * @var Syncroton_Wbxml_Dtd_ActiveSync
39
      */
40
     protected $_dtd;
41
-    
42
+
43
     /**
44
      * the charSet used in the wbxml file
45
      *
46
      * @var string
47
      */
48
     protected $_charSet;
49
-    
50
+
51
     /**
52
      * currently active code page
53
      *
54
-     * @var array
55
+     * @var Syncroton_Wbxml_Dtd_ActiveSync_Abstract
56
      */
57
     protected $_codePage;
58
-    
59
+
60
     /**
61
      * see section 5.5
62
      *
63
      */
64
-    const DPI_WELLKNOWN = 'WELLKNOWN';
65
-    
66
+    public const DPI_WELLKNOWN = 'WELLKNOWN';
67
+
68
     /**
69
      * see section 5.5
70
      *
71
      */
72
-    const DPI_STRINGTABLE = 'STRINGTABLE';
73
-    
74
-    const SWITCH_PAGE   = 0x00;
75
-    const END           = 0x01;
76
-    const ENTITY        = 0x02;
77
-    const STR_I         = 0x03;
78
-    const LITERAL       = 0x04;
79
-    const EXT_I_0       = 0x40;
80
-    const EXT_I_1       = 0x41;
81
-    const EXT_I_2       = 0x42;
82
-    const PI            = 0x43;
83
-    const LITERAL_C     = 0x44;
84
-    const EXT_T_0       = 0x80;
85
-    const EXT_T_1       = 0x81;
86
-    const EXT_T_2       = 0x82;
87
-    const STR_T         = 0x83;
88
-    const LITERAL_A     = 0x84;
89
-    const EXT_0         = 0xC0;
90
-    const EXT_1         = 0xC1;
91
-    const EXT_2         = 0xC2;
92
-    const OPAQUE        = 0xC3;
93
-    const LITERAL_AC    = 0xC4;
94
-    
95
+    public const DPI_STRINGTABLE = 'STRINGTABLE';
96
+
97
+    public const SWITCH_PAGE   = 0x00;
98
+    public const END           = 0x01;
99
+    public const ENTITY        = 0x02;
100
+    public const STR_I         = 0x03;
101
+    public const LITERAL       = 0x04;
102
+    public const EXT_I_0       = 0x40;
103
+    public const EXT_I_1       = 0x41;
104
+    public const EXT_I_2       = 0x42;
105
+    public const PI            = 0x43;
106
+    public const LITERAL_C     = 0x44;
107
+    public const EXT_T_0       = 0x80;
108
+    public const EXT_T_1       = 0x81;
109
+    public const EXT_T_2       = 0x82;
110
+    public const STR_T         = 0x83;
111
+    public const LITERAL_A     = 0x84;
112
+    public const EXT_0         = 0xC0;
113
+    public const EXT_1         = 0xC1;
114
+    public const EXT_2         = 0xC2;
115
+    public const OPAQUE        = 0xC3;
116
+    public const LITERAL_AC    = 0xC4;
117
+
118
     /**
119
      * the real name for this DPI is "unknown"
120
      * But Microsoft is using them for their ActiveSync stuff
121
      * instead defining their own DPI like the sycnml creators did
122
      *
123
      */
124
-    const DPI_1         = '-//AIRSYNC//DTD AirSync//EN';
125
-    
126
+    public const DPI_1         = '-//AIRSYNC//DTD AirSync//EN';
127
+
128
     /**
129
      * return wellknown identifiers
130
      *
131
@@ -114,12 +114,12 @@
132
         if(!defined('Syncroton_Wbxml_Abstract::DPI_' . $_uInt)) {
133
             throw new Syncroton_Wbxml_Exception('unknown wellknown identifier: ' . $_uInt);
134
         }
135
-        
136
+
137
         $dpi = constant('Syncroton_Wbxml_Abstract::DPI_' . $_uInt);
138
-        
139
+
140
         return $dpi;
141
     }
142
-    
143
+
144
     /**
145
      * return multibyte integer
146
      *
147
@@ -128,27 +128,27 @@
148
     protected function _getMultibyteUInt()
149
     {
150
         $uInt = 0;
151
-        
152
+
153
         do {
154
             $byte = $this->_getByte();
155
             $uInt <<= 7;
156
             $uInt += ($byte & 127);
157
         } while (($byte & 128) != 0);
158
-         
159
+
160
         return $uInt;
161
     }
162
-        
163
+
164
     protected function _getByte()
165
     {
166
         $byte = fread($this->_stream, 1);
167
-        
168
+
169
         if($byte === false) {
170
             throw new Syncroton_Wbxml_Exception("failed reading one byte");
171
         }
172
-        
173
+
174
         return ord($byte);
175
     }
176
-    
177
+
178
     protected function _getOpaque($_length)
179
     {
180
         $string = '';
181
@@ -166,7 +166,7 @@
182
                 $string .= $chunk;
183
                 $_length -= $len;
184
             }
185
-            
186
+
187
             if (feof($this->_stream)) {
188
                 break;
189
             }
190
@@ -174,7 +174,7 @@
191
 
192
         return $string;
193
     }
194
-    
195
+
196
     /**
197
      * get a 0 terminated string
198
      *
199
@@ -183,28 +183,28 @@
200
     protected function _getTerminatedString()
201
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Wbxml/Decoder.php Changed
201
 
1
@@ -16,30 +16,30 @@
2
  * @package     Wbxml
3
  * @subpackage  Wbxml
4
  */
5
- 
6
+
7
 class Syncroton_Wbxml_Decoder extends Syncroton_Wbxml_Abstract
8
 {
9
     /**
10
-     * type of Document Public Identifier 
11
+     * type of Document Public Identifier
12
      *
13
      * @var string the type can be Syncroton_Wbxml_Abstract::DPI_STRINGTABLE or Syncroton_Wbxml_Abstract::DPI_WELLKNOWN
14
      */
15
     protected $_dpiType;
16
-    
17
+
18
     /**
19
      * the string table
20
      *
21
      * @var array
22
      */
23
-    protected $_stringTable = array();
24
-    
25
+    protected $_stringTable = ;
26
+
27
     /**
28
      * the xml document
29
      *
30
      * @var DOMDocument
31
      */
32
     protected $_dom;
33
-    
34
+
35
     /**
36
      * the main name space / aka the namespace of first tag
37
      *
38
@@ -52,39 +52,39 @@
39
      *
40
      * @param resource $_stream
41
      */
42
-    public function __construct($_stream, $_dpi = NULL)
43
+    public function __construct($_stream, $_dpi = null)
44
     {
45
         if(!is_resource($_stream) || get_resource_type($_stream) != 'stream') {
46
             throw new Syncroton_Wbxml_Exception('$_stream must be a stream');
47
         }
48
-        if($_dpi !== NULL) {
49
+        if($_dpi !== null) {
50
             $this->_dpi = $_dpi;
51
         }
52
-        
53
+
54
         $this->_stream = $_stream;
55
-        
56
+
57
         $this->_version = $this->_getByte();
58
-        
59
+
60
         if(feof($this->_stream)) {
61
             throw new Syncroton_Wbxml_Exception_UnexpectedEndOfFile();
62
         }
63
-        
64
+
65
         $this->_getDPI();
66
-        
67
+
68
         $this->_getCharset();
69
-        
70
+
71
         $this->_getStringTable();
72
-        
73
+
74
         // resolve DPI as we have read the stringtable now
75
         // this->_dpi contains the string table index
76
         if($this->_dpiType === Syncroton_Wbxml_Abstract::DPI_STRINGTABLE) {
77
             $this->_dpi = $this->_stringTable$this->_dpi;
78
         }
79
-        
80
+
81
         #$this->_dtd = Syncroton_Wbxml_Dtd_Factory::factory($this->_dpi);
82
         $this->_dtd = Syncroton_Wbxml_Dtd_Factory::factory(Syncroton_Wbxml_Dtd_Factory::ACTIVESYNC);
83
     }
84
-    
85
+
86
     /**
87
      * return the Document Public Identifier
88
      *
89
@@ -95,37 +95,37 @@
90
     {
91
         return $this->_dpi;
92
     }
93
-    
94
+
95
     /**
96
      * return the wbxml version
97
      *
98
-     * @return string
99
+     * @return int
100
      */
101
     public function getVersion()
102
     {
103
         return $this->_version;
104
     }
105
-    
106
+
107
     /**
108
-     * decodes the tags 
109
+     * decodes the tags
110
      *
111
      * @return DOMDocument the decoded xml
112
      */
113
     public function decode()
114
     {
115
-        $openTags = NULL;
116
-        $node = NULL;
117
+        $openTags = null;
118
+        $node = null;
119
         $this->_codePage = $this->_dtd->getCurrentCodePage();
120
-        
121
+
122
         while (!feof($this->_stream)) {
123
             $byte = $this->_getByte();
124
-            
125
+
126
             switch($byte) {
127
                 case Syncroton_Wbxml_Abstract::END:
128
                     $node = $node->parentNode;
129
                     $openTags--;
130
                     break;
131
-                    
132
+
133
                 case Syncroton_Wbxml_Abstract::OPAQUE:
134
                     $length = $this->_getMultibyteUInt();
135
                     if($length > 0) {
136
@@ -133,14 +133,14 @@
137
                         try {
138
                             // let see if we can decode it. maybe the opaque data is wbxml encoded content
139
                             $opaqueDataStream = fopen("php://temp", 'r+');
140
-                            fputs($opaqueDataStream, $opaque);
141
+                            fwrite($opaqueDataStream, $opaque);
142
                             rewind($opaqueDataStream);
143
-                            
144
+
145
                             $opaqueContentDecoder = new Syncroton_Wbxml_Decoder($opaqueDataStream);
146
                             $dom = $opaqueContentDecoder->decode();
147
-                            
148
+
149
                             fclose($opaqueDataStream);
150
-                            
151
+
152
                             foreach($dom->childNodes as $newNode) {
153
                                 if($newNode instanceof DOMElement) {
154
                                     $newNode = $this->_dom->importNode($newNode, true);
155
@@ -149,22 +149,22 @@
156
                             }
157
                         } catch (Exception $e) {
158
                             // if not, just treat it as a string
159
-                            $node->appendChild($this->_dom->createTextNode($opaque)); 
160
+                            $node->appendChild($this->_dom->createTextNode($opaque));
161
                         }
162
                     }
163
                     break;
164
-                    
165
+
166
                 case Syncroton_Wbxml_Abstract::STR_I:
167
                     $string = $this->_getTerminatedString();
168
-                    $node->appendChild($this->_dom->createTextNode($string)); 
169
+                    $node->appendChild($this->_dom->createTextNode($string));
170
                     break;
171
-                    
172
+
173
                 case Syncroton_Wbxml_Abstract::SWITCH_PAGE:
174
                     $page = $this->_getByte();
175
                     $this->_codePage = $this->_dtd->switchCodePage($page);
176
                     #echo "switched to codepage $page\n";
177
                     break;
178
-                    
179
+
180
                 default:
181
                     $tagHasAttributes   = (($byte & 0x80) != 0);
182
                     $tagHasContent      = (($byte & 0x40) != 0);
183
@@ -179,10 +179,10 @@
184
                     }
185
                     $nameSpace    = $this->_codePage->getNameSpace();
186
                     $codePageName = $this->_codePage->getCodePageName();
187
-                    
188
+
189
                     #echo "Tag: $nameSpace:$tag\n";
190
-                    
191
-                    if ($node === NULL) {
192
+
193
+                    if ($node === null) {
194
                         // create the domdocument
195
                         $node    = $this->_createDomDocument($nameSpace, $tag);
196
                         $newNode = $node->documentElement;
197
@@ -192,23 +192,23 @@
198
                         }
199
                         $newNode = $node->appendChild($this->_dom->createElementNS('uri:' . $codePageName, $tag));
200
                     }
201
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Wbxml/Dtd/ActiveSync.php Changed
126
 
1
@@ -19,39 +19,39 @@
2
 
3
 class Syncroton_Wbxml_Dtd_ActiveSync
4
 {
5
-    const CODEPAGE_AIRSYNC           = 0;
6
-    const CODEPAGE_CONTACTS          = 1;
7
-    const CODEPAGE_EMAIL             = 2;
8
-    const CODEPAGE_AIRNOTIFY         = 3;
9
-    const CODEPAGE_CALENDAR          = 4;
10
-    const CODEPAGE_MOVE              = 5;
11
-    const CODEPAGE_ITEMESTIMATE      = 6;
12
-    const CODEPAGE_FOLDERHIERARCHY   = 7;
13
-    const CODEPAGE_MEETINGRESPONSE   = 8;
14
-    const CODEPAGE_TASKS             = 9;
15
-    const CODEPAGE_RESOLVERECIPIENTS = 10;
16
-    const CODEPAGE_VALIDATECERT      = 11;
17
-    const CODEPAGE_CONTACTS2         = 12;
18
-    const CODEPAGE_PING              = 13;
19
-    const CODEPAGE_PROVISION         = 14;
20
-    const CODEPAGE_SEARCH            = 15;
21
-    const CODEPAGE_GAL               = 16;
22
-    const CODEPAGE_AIRSYNCBASE       = 17;
23
-    const CODEPAGE_SETTINGS          = 18;
24
-    const CODEPAGE_DOCUMENTLIBRARY   = 19;
25
-    const CODEPAGE_ITEMOPERATIONS    = 20;
26
-    const CODEPAGE_COMPOSEMAIL       = 21;
27
-    const CODEPAGE_EMAIL2            = 22;
28
-    const CODEPAGE_NOTES             = 23;
29
-    const CODEPAGE_RIGHTSMANAGEMENT  = 24;
30
-    
31
+    public const CODEPAGE_AIRSYNC           = 0;
32
+    public const CODEPAGE_CONTACTS          = 1;
33
+    public const CODEPAGE_EMAIL             = 2;
34
+    public const CODEPAGE_AIRNOTIFY         = 3;
35
+    public const CODEPAGE_CALENDAR          = 4;
36
+    public const CODEPAGE_MOVE              = 5;
37
+    public const CODEPAGE_ITEMESTIMATE      = 6;
38
+    public const CODEPAGE_FOLDERHIERARCHY   = 7;
39
+    public const CODEPAGE_MEETINGRESPONSE   = 8;
40
+    public const CODEPAGE_TASKS             = 9;
41
+    public const CODEPAGE_RESOLVERECIPIENTS = 10;
42
+    public const CODEPAGE_VALIDATECERT      = 11;
43
+    public const CODEPAGE_CONTACTS2         = 12;
44
+    public const CODEPAGE_PING              = 13;
45
+    public const CODEPAGE_PROVISION         = 14;
46
+    public const CODEPAGE_SEARCH            = 15;
47
+    public const CODEPAGE_GAL               = 16;
48
+    public const CODEPAGE_AIRSYNCBASE       = 17;
49
+    public const CODEPAGE_SETTINGS          = 18;
50
+    public const CODEPAGE_DOCUMENTLIBRARY   = 19;
51
+    public const CODEPAGE_ITEMOPERATIONS    = 20;
52
+    public const CODEPAGE_COMPOSEMAIL       = 21;
53
+    public const CODEPAGE_EMAIL2            = 22;
54
+    public const CODEPAGE_NOTES             = 23;
55
+    public const CODEPAGE_RIGHTSMANAGEMENT  = 24;
56
+
57
     /**
58
      * variable to hold currently active codepage
59
      *
60
      * @var Syncroton_Wbxml_Dtd_ActiveSync_Abstract
61
      */
62
     protected $_currentCodePage;
63
-    
64
+
65
     /**
66
      * the constructor
67
      *
68
@@ -60,17 +60,17 @@
69
     {
70
         $this->_currentCodePage = new Syncroton_Wbxml_Dtd_ActiveSync_CodePage0();
71
     }
72
-    
73
+
74
     /**
75
      * returns reference to current codepage
76
      *
77
      * @return Syncroton_Wbxml_Dtd_ActiveSync_Abstract
78
      */
79
-    public function getCurrentCodePage() 
80
+    public function getCurrentCodePage()
81
     {
82
         return $this->_currentCodePage;
83
     }
84
-    
85
+
86
     /**
87
      * switch to another codepage
88
      *
89
@@ -80,12 +80,12 @@
90
     public function switchCodePage($_codePageId)
91
     {
92
         $className = 'Syncroton_Wbxml_Dtd_ActiveSync_CodePage' . $_codePageId;
93
-        
94
+
95
         $this->_currentCodePage = new $className();
96
-        
97
+
98
         return $this->_currentCodePage;
99
     }
100
-    
101
+
102
     /**
103
      * get initial dom document
104
      *
105
@@ -95,16 +95,16 @@
106
     {
107
         // Creates an instance of the DOMImplementation class
108
         $imp = new DOMImplementation();
109
-        
110
+
111
         // Creates a DOMDocumentType instance
112
         $dtd = $imp->createDocumentType('AirSync', "-//AIRSYNC//DTD AirSync//EN", "http://www.microsoft.com/");
113
 
114
         // Creates a DOMDocument instance
115
         $dom = $imp->createDocument($_nameSpace, $_tag, $dtd);
116
-        
117
+
118
         $dom->encoding      = 'utf-8';
119
         $dom->formatOutput  = false;
120
-        
121
+
122
         return $dom;
123
     }
124
-}    
125
+}
126
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Wbxml/Dtd/ActiveSync/Abstract.php Changed
111
 
1
@@ -16,49 +16,49 @@
2
  * @package     Wbxml
3
  * @subpackage  ActiveSync
4
  */
5
- 
6
+
7
 abstract class Syncroton_Wbxml_Dtd_ActiveSync_Abstract
8
 {
9
     /**
10
      * codepage number
11
      *
12
-     * @var integer
13
+     * @var ?integer
14
      */
15
-    protected $_codePageNumber  = NULL;
16
-            
17
+    protected $_codePageNumber  = null;
18
+
19
     /**
20
      * codepage name
21
      *
22
-     * @var string
23
+     * @var ?string
24
      */
25
-    protected $_codePageName    = NULL;
26
+    protected $_codePageName    = null;
27
 
28
     /**
29
      * document page identifier
30
      * not needed for ActiveSync
31
      *
32
-     * @var integer
33
+     * @var ?integer
34
      */
35
-    protected $_dpi             = NULL;
36
-    
37
+    protected $_dpi             = null;
38
+
39
     /**
40
      * mapping of tags to id's
41
      *
42
      * @var array
43
      */
44
-    protected $_tags            = array();
45
-    
46
+    protected $_tags            = ;
47
+
48
     /**
49
      * return document page identifier
50
      * is always NULL for activesync
51
      *
52
-     * @return unknown
53
+     * @return int|null
54
      */
55
     public function getDPI()
56
     {
57
         return $this->_dpi;
58
     }
59
-    
60
+
61
     /**
62
      * get codepage name
63
      *
64
@@ -68,7 +68,7 @@
65
     {
66
         return $this->_codePageName;
67
     }
68
-    
69
+
70
     /**
71
      * get namespace identifier
72
      *
73
@@ -78,7 +78,7 @@
74
     {
75
         return 'uri:' . $this->_codePageName;
76
     }
77
-    
78
+
79
     /**
80
      * get tag identifier
81
      *
82
@@ -94,21 +94,21 @@
83
 
84
         return $this->_tags$_tag;
85
     }
86
-    
87
+
88
     /**
89
      * return tag by given identity
90
      *
91
-     * @param unknown_type $_identity
92
-     * @return unknown
93
+     * @param int $_identity
94
+     * @return mixed
95
      */
96
     public function getTag($_identity)
97
     {
98
         $tag = array_search($_identity, $this->_tags);
99
-        
100
+
101
         if($tag === false) {
102
             throw new Syncroton_Wbxml_Exception("identity $_identity not found");
103
         }
104
-        
105
+
106
         return $tag;
107
     }
108
-}
109
\ No newline at end of file
110
+}
111
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Wbxml/Dtd/ActiveSync/CodePage0.php Changed
31
 
1
@@ -15,14 +15,14 @@
2
  * @package     Wbxml
3
  * @subpackage  ActiveSync
4
  */
5
- 
6
+
7
 class Syncroton_Wbxml_Dtd_ActiveSync_CodePage0 extends Syncroton_Wbxml_Dtd_ActiveSync_Abstract
8
 {
9
     protected $_codePageNumber  = 0;
10
-    
11
+
12
     protected $_codePageName    = 'AirSync';
13
-    
14
-    protected $_tags = array(
15
+
16
+    protected $_tags = 
17
         'Sync'              => 0x05,
18
         'Responses'         => 0x06,
19
         'Add'               => 0x07,
20
@@ -59,6 +59,6 @@
21
         'Partial'           => 0x26,
22
         'ConversationMode'  => 0x27,
23
         'MaxItems'          => 0x28,
24
-        'HeartbeatInterval' => 0x29
25
-    );
26
-}
27
\ No newline at end of file
28
+        'HeartbeatInterval' => 0x29,
29
+    ;
30
+}
31
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Wbxml/Dtd/ActiveSync/CodePage1.php Changed
31
 
1
@@ -15,14 +15,14 @@
2
  * @package     Wbxml
3
  * @subpackage  ActiveSync
4
  */
5
- 
6
+
7
 class Syncroton_Wbxml_Dtd_ActiveSync_CodePage1 extends Syncroton_Wbxml_Dtd_ActiveSync_Abstract
8
 {
9
     protected $_codePageNumber  = 1;
10
-    
11
+
12
     protected $_codePageName    = 'Contacts';
13
-        
14
-    protected $_tags = array(     
15
+
16
+    protected $_tags = 
17
         'Anniversary'               => 0x05,
18
         'AssistantName'             => 0x06,
19
         'AssistantPhoneNumber'      => 0x07,
20
@@ -80,6 +80,6 @@
21
         'Rtf'                    => 0x3b,
22
         'Picture'                => 0x3c,
23
         'Alias'                  => 0x3d,
24
-        'WeightedRank'           => 0x3e
25
-    );
26
-}
27
\ No newline at end of file
28
+        'WeightedRank'           => 0x3e,
29
+    ;
30
+}
31
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Wbxml/Dtd/ActiveSync/CodePage10.php Changed
31
 
1
@@ -15,14 +15,14 @@
2
  * @package     Wbxml
3
  * @subpackage  ActiveSync
4
  */
5
- 
6
+
7
 class Syncroton_Wbxml_Dtd_ActiveSync_CodePage10 extends Syncroton_Wbxml_Dtd_ActiveSync_Abstract
8
 {
9
     protected $_codePageNumber  = 10;
10
-    
11
+
12
     protected $_codePageName    = 'ResolveRecipients';
13
-        
14
-    protected $_tags = array(     
15
+
16
+    protected $_tags = 
17
         'ResolveRecipients'       => 0x05,
18
         'Response'                => 0x06,
19
         'Status'                  => 0x07,
20
@@ -47,6 +47,6 @@
21
         'Picture'                 => 0x1a,
22
         'MaxSize'                 => 0x1b,
23
         'Data'                    => 0x1c,
24
-        'MaxPictures'             => 0x1d
25
-    );
26
-}
27
\ No newline at end of file
28
+        'MaxPictures'             => 0x1d,
29
+    ;
30
+}
31
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Wbxml/Dtd/ActiveSync/CodePage11.php Changed
29
 
1
@@ -15,19 +15,19 @@
2
  * @package     Wbxml
3
  * @subpackage  ActiveSync
4
  */
5
- 
6
+
7
 class Syncroton_Wbxml_Dtd_ActiveSync_CodePage11 extends Syncroton_Wbxml_Dtd_ActiveSync_Abstract
8
 {
9
     protected $_codePageNumber  = 11;
10
-    
11
+
12
     protected $_codePageName    = 'ValidateCert';
13
-        
14
-    protected $_tags = array(     
15
+
16
+    protected $_tags = 
17
         'ValidateCert'            => 0x05,
18
         'Certificates'            => 0x06,
19
         'Certificate'             => 0x07,
20
         'CertificateChain'        => 0x08,
21
         'CheckCRL'                => 0x09,
22
-        'Status'                  => 0x0a
23
-    );
24
-}
25
\ No newline at end of file
26
+        'Status'                  => 0x0a,
27
+    ;
28
+}
29
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Wbxml/Dtd/ActiveSync/CodePage12.php Changed
31
 
1
@@ -15,14 +15,14 @@
2
  * @package     Wbxml
3
  * @subpackage  ActiveSync
4
  */
5
- 
6
+
7
 class Syncroton_Wbxml_Dtd_ActiveSync_CodePage12 extends Syncroton_Wbxml_Dtd_ActiveSync_Abstract
8
 {
9
     protected $_codePageNumber  = 12;
10
-    
11
+
12
     protected $_codePageName    = 'Contacts2';
13
-        
14
-    protected $_tags = array(     
15
+
16
+    protected $_tags = 
17
         'CustomerId'              => 0x05,
18
         'GovernmentId'            => 0x06,
19
         'IMAddress'               => 0x07,
20
@@ -32,6 +32,6 @@
21
         'CompanyMainPhone'        => 0x0b,
22
         'AccountName'             => 0x0c,
23
         'NickName'                => 0x0d,
24
-        'MMS'                     => 0x0e
25
-    );
26
-}
27
\ No newline at end of file
28
+        'MMS'                     => 0x0e,
29
+    ;
30
+}
31
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Wbxml/Dtd/ActiveSync/CodePage13.php Changed
19
 
1
@@ -21,7 +21,7 @@
2
 
3
     protected $_codePageName    = 'Ping';
4
 
5
-    protected $_tags = array(
6
+    protected $_tags = 
7
         'Ping'                   => 0x05,
8
         'AutdState'              => 0x06,   //unused
9
         'Status'                 => 0x07,
10
@@ -30,6 +30,6 @@
11
         'Folder'                 => 0x0a,
12
         'Id'                     => 0x0b,
13
         'Class'                  => 0x0c,
14
-        'MaxFolders'             => 0x0d
15
-    );
16
+        'MaxFolders'             => 0x0d,
17
+    ;
18
 }
19
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Wbxml/Dtd/ActiveSync/CodePage14.php Changed
27
 
1
@@ -16,14 +16,14 @@
2
  * @subpackage  ActiveSync
3
  * @todo        add missing tags
4
  */
5
- 
6
+
7
 class Syncroton_Wbxml_Dtd_ActiveSync_CodePage14 extends Syncroton_Wbxml_Dtd_ActiveSync_Abstract
8
 {
9
     protected $_codePageNumber  = 14;
10
-    
11
+
12
     protected $_codePageName    = 'Provision';
13
-        
14
-    protected $_tags = array(
15
+
16
+    protected $_tags = 
17
         'Provision'                          => 0x05,
18
         'Policies'                           => 0x06,
19
         'Policy'                             => 0x07,
20
@@ -78,5 +78,5 @@
21
         'ApplicationName'                    => 0x38,
22
         'ApprovedApplicationList'            => 0x39,
23
         'Hash'                               => 0x3a,
24
-    );
25
+    ;
26
 }
27
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Wbxml/Dtd/ActiveSync/CodePage15.php Changed
31
 
1
@@ -15,14 +15,14 @@
2
  * @package     Wbxml
3
  * @subpackage  ActiveSync
4
  */
5
- 
6
+
7
 class Syncroton_Wbxml_Dtd_ActiveSync_CodePage15 extends Syncroton_Wbxml_Dtd_ActiveSync_Abstract
8
 {
9
     protected $_codePageNumber  = 15;
10
-    
11
+
12
     protected $_codePageName    = 'Search';
13
-        
14
-    protected $_tags = array(     
15
+
16
+    protected $_tags = 
17
         'Search'            => 0x05,
18
         'Store'             => 0x07,
19
         'Name'              => 0x08,
20
@@ -51,6 +51,6 @@
21
         'ConversationId'    => 0x20,
22
         'Picture'           => 0x21,
23
         'MaxSize'           => 0x22,
24
-        'MaxPictures'       => 0x23
25
-    );
26
-}
27
\ No newline at end of file
28
+        'MaxPictures'       => 0x23,
29
+    ;
30
+}
31
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Wbxml/Dtd/ActiveSync/CodePage16.php Changed
29
 
1
@@ -15,14 +15,14 @@
2
  * @package     Wbxml
3
  * @subpackage  ActiveSync
4
  */
5
- 
6
+
7
 class Syncroton_Wbxml_Dtd_ActiveSync_CodePage16 extends Syncroton_Wbxml_Dtd_ActiveSync_Abstract
8
 {
9
     protected $_codePageNumber  = 16;
10
-    
11
+
12
     protected $_codePageName    = 'GAL';
13
-        
14
-    protected $_tags = array(
15
+
16
+    protected $_tags = 
17
         'DisplayName'           => 0x05,
18
         'Phone'                 => 0x06,
19
         'Office'                => 0x07,
20
@@ -37,5 +37,5 @@
21
         'Picture'               => 0x10,
22
         'Status'                => 0x11,
23
         'Data'                  => 0x12,
24
-    );
25
-}
26
\ No newline at end of file
27
+    ;
28
+}
29
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Wbxml/Dtd/ActiveSync/CodePage17.php Changed
29
 
1
@@ -15,14 +15,14 @@
2
  * @package     Wbxml
3
  * @subpackage  ActiveSync
4
  */
5
- 
6
+
7
 class Syncroton_Wbxml_Dtd_ActiveSync_CodePage17 extends Syncroton_Wbxml_Dtd_ActiveSync_Abstract
8
 {
9
     protected $_codePageNumber  = 17;
10
-    
11
+
12
     protected $_codePageName    = 'AirSyncBase';
13
-    
14
-    protected $_tags = array(
15
+
16
+    protected $_tags = 
17
         'BodyPreference'    => 0x05,
18
         'Type'              => 0x06,
19
         'TruncationSize'    => 0x07,
20
@@ -45,5 +45,5 @@
21
         'BodyPartReference' => 0x19,
22
         'BodyPart'          => 0x1a,
23
         'Status'            => 0x1b,
24
-    );
25
-}
26
\ No newline at end of file
27
+    ;
28
+}
29
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Wbxml/Dtd/ActiveSync/CodePage18.php Changed
27
 
1
@@ -15,14 +15,14 @@
2
  * @package     Wbxml
3
  * @subpackage  ActiveSync
4
  */
5
- 
6
+
7
 class Syncroton_Wbxml_Dtd_ActiveSync_CodePage18 extends Syncroton_Wbxml_Dtd_ActiveSync_Abstract
8
 {
9
     protected $_codePageNumber  = 18;
10
-    
11
+
12
     protected $_codePageName    = 'Settings';
13
-        
14
-    protected $_tags = array(     
15
+
16
+    protected $_tags = 
17
         'Settings'                  => 0x05,
18
         'Status'                    => 0x06,
19
         'Get'                       => 0x07,
20
@@ -61,5 +61,5 @@
21
         'UserDisplayName'           => 0x28,
22
         'SendDisabled'              => 0x29,
23
         'RightsManagementInformation' => 0x2b,
24
-    );
25
+    ;
26
 }
27
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Wbxml/Dtd/ActiveSync/CodePage19.php Changed
31
 
1
@@ -15,14 +15,14 @@
2
  * @package     Wbxml
3
  * @subpackage  ActiveSync
4
  */
5
- 
6
+
7
 class Syncroton_Wbxml_Dtd_ActiveSync_CodePage19 extends Syncroton_Wbxml_Dtd_ActiveSync_Abstract
8
 {
9
     protected $_codePageNumber  = 19;
10
-    
11
+
12
     protected $_codePageName    = 'DocumentLibrary';
13
-        
14
-    protected $_tags = array(
15
+
16
+    protected $_tags = 
17
         'LinkId'                => 0x05,
18
         'DisplayName'           => 0x06,
19
         'IsFolder'              => 0x07,
20
@@ -30,6 +30,6 @@
21
         'LastModifiedDate'      => 0x09,
22
         'IsHidden'              => 0x0a,
23
         'ContentLength'         => 0x0b,
24
-        'ContentType'           => 0x0c
25
-    );
26
-}
27
\ No newline at end of file
28
+        'ContentType'           => 0x0c,
29
+    ;
30
+}
31
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Wbxml/Dtd/ActiveSync/CodePage2.php Changed
31
 
1
@@ -15,14 +15,14 @@
2
  * @package     Wbxml
3
  * @subpackage  ActiveSync
4
  */
5
- 
6
+
7
 class Syncroton_Wbxml_Dtd_ActiveSync_CodePage2 extends Syncroton_Wbxml_Dtd_ActiveSync_Abstract
8
 {
9
     protected $_codePageNumber  = 2;
10
-    
11
+
12
     protected $_codePageName    = 'Email';
13
-        
14
-    protected $_tags = array(
15
+
16
+    protected $_tags = 
17
         'Attachment'            => 0x05,
18
         'Attachments'           => 0x06,
19
         'AttName'               => 0x07,
20
@@ -81,6 +81,6 @@
21
         'ContentClass'            => 0x3c,
22
         'FlagType'                => 0x3d,
23
         'CompleteTime'            => 0x3e,
24
-        'DisallowNewTimeProposal' => 0x3f
25
-    );
26
-}
27
\ No newline at end of file
28
+        'DisallowNewTimeProposal' => 0x3f,
29
+    ;
30
+}
31
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Wbxml/Dtd/ActiveSync/CodePage20.php Changed
29
 
1
@@ -15,14 +15,14 @@
2
  * @package     Wbxml
3
  * @subpackage  ActiveSync
4
  */
5
- 
6
+
7
 class Syncroton_Wbxml_Dtd_ActiveSync_CodePage20 extends Syncroton_Wbxml_Dtd_ActiveSync_Abstract
8
 {
9
     protected $_codePageNumber  = 20;
10
-    
11
+
12
     protected $_codePageName    = 'ItemOperations';
13
-        
14
-    protected $_tags = array(     
15
+
16
+    protected $_tags = 
17
         'ItemOperations'        => 0x05,
18
         'Fetch'                 => 0x06,
19
         'Store'                 => 0x07,
20
@@ -44,5 +44,5 @@
21
         'DstFldId'              => 0x17,
22
         'ConversationId'        => 0x18,
23
         'MoveAlways'            => 0x19,
24
-    );
25
-}
26
\ No newline at end of file
27
+    ;
28
+}
29
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Wbxml/Dtd/ActiveSync/CodePage21.php Changed
29
 
1
@@ -15,14 +15,14 @@
2
  * @package     Wbxml
3
  * @subpackage  ActiveSync
4
  */
5
- 
6
+
7
 class Syncroton_Wbxml_Dtd_ActiveSync_CodePage21 extends Syncroton_Wbxml_Dtd_ActiveSync_Abstract
8
 {
9
     protected $_codePageNumber  = 21;
10
-    
11
+
12
     protected $_codePageName    = 'ComposeMail';
13
-        
14
-    protected $_tags = array(
15
+
16
+    protected $_tags = 
17
         'SendMail'        => 0x05,
18
         'SmartForward'    => 0x06,
19
         'SmartReply'      => 0x07,
20
@@ -37,5 +37,5 @@
21
         'ClientId'        => 0x11,
22
         'Status'          => 0x12,
23
         'AccountId'       => 0x13,
24
-    );
25
-}
26
\ No newline at end of file
27
+    ;
28
+}
29
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Wbxml/Dtd/ActiveSync/CodePage22.php Changed
29
 
1
@@ -15,14 +15,14 @@
2
  * @package     Wbxml
3
  * @subpackage  ActiveSync
4
  */
5
- 
6
+
7
 class Syncroton_Wbxml_Dtd_ActiveSync_CodePage22 extends Syncroton_Wbxml_Dtd_ActiveSync_Abstract
8
 {
9
     protected $_codePageNumber  = 22;
10
-    
11
+
12
     protected $_codePageName    = 'Email2';
13
-        
14
-    protected $_tags = array(
15
+
16
+    protected $_tags = 
17
         'UmCallerID'            => 0x05,
18
         'UmUserNotes'           => 0x06,
19
         'UmAttDuration'         => 0x07,
20
@@ -38,5 +38,5 @@
21
         'AccountId'             => 0x11,
22
         'FirstDayOfWeek'        => 0x12,
23
         'MeetingMessageType'    => 0x13,
24
-   );
25
-}
26
\ No newline at end of file
27
+   ;
28
+}
29
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Wbxml/Dtd/ActiveSync/CodePage23.php Changed
27
 
1
@@ -15,18 +15,18 @@
2
  * @package     Wbxml
3
  * @subpackage  ActiveSync
4
  */
5
- 
6
+
7
 class Syncroton_Wbxml_Dtd_ActiveSync_CodePage23 extends Syncroton_Wbxml_Dtd_ActiveSync_Abstract
8
 {
9
     protected $_codePageNumber  = 23;
10
-    
11
+
12
     protected $_codePageName    = 'Notes';
13
-        
14
-    protected $_tags = array(     
15
+
16
+    protected $_tags = 
17
         'Subject'          => 0x05,
18
         'MessageClass'     => 0x06,
19
         'LastModifiedDate' => 0x07,
20
         'Categories'       => 0x08,
21
         'Category'         => 0x09,
22
-    );
23
-}
24
\ No newline at end of file
25
+    ;
26
+}
27
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Wbxml/Dtd/ActiveSync/CodePage24.php Changed
33
 
1
@@ -15,14 +15,14 @@
2
  * @package     Wbxml
3
  * @subpackage  ActiveSync
4
  */
5
- 
6
+
7
 class Syncroton_Wbxml_Dtd_ActiveSync_CodePage24 extends Syncroton_Wbxml_Dtd_ActiveSync_Abstract
8
 {
9
     protected $_codePageNumber  = 24;
10
-    
11
+
12
     protected $_codePageName    = 'RightsManagement';
13
-        
14
-    protected $_tags = array(     
15
+
16
+    protected $_tags = 
17
         'RightsManagementSupport'            => 0x05,
18
         'RightsManagementTemplates'          => 0x06,
19
         'RightsManagementTemplate'           => 0x07,
20
@@ -42,7 +42,7 @@
21
         'TemplateID'                         => 0x15,
22
         'TemplateDescription'                => 0x16,
23
         'ContentOwner'                       => 0x17,
24
-        'RemoveRightsManagementDistribution' => 0x18
25
-    );
26
-    
27
-}
28
\ No newline at end of file
29
+        'RemoveRightsManagementDistribution' => 0x18,
30
+    ;
31
+
32
+}
33
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Wbxml/Dtd/ActiveSync/CodePage254.php Changed
22
 
1
@@ -19,13 +19,13 @@
2
 class Syncroton_Wbxml_Dtd_ActiveSync_CodePage254 extends Syncroton_Wbxml_Dtd_ActiveSync_Abstract
3
 {
4
     protected $_codePageNumber  = 254;
5
-    
6
+
7
     protected $_codePageName    = 'WindowsLive';
8
-        
9
-    protected $_tags = array(
10
+
11
+    protected $_tags = 
12
         'Annotations'            => 0x05,
13
         'Annotation'             => 0x06,
14
         'Name'                   => 0x07,
15
-        'Value'                  => 0x08
16
-    );
17
-}
18
\ No newline at end of file
19
+        'Value'                  => 0x08,
20
+    ;
21
+}
22
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Wbxml/Dtd/ActiveSync/CodePage3.php Changed
34
 
1
@@ -15,14 +15,14 @@
2
  * @package     Wbxml
3
  * @subpackage  ActiveSync
4
  */
5
- 
6
+
7
 class Syncroton_Wbxml_Dtd_ActiveSync_CodePage3 extends Syncroton_Wbxml_Dtd_ActiveSync_Abstract
8
 {
9
     protected $_codePageNumber  = 3;
10
-    
11
+
12
     protected $_codePageName    = 'AirNotify';
13
-        
14
-    protected $_tags = array(     
15
+
16
+    protected $_tags = 
17
         'Notify'                    => 0x05,
18
         'Notification'              => 0x06,
19
         'Version'                   => 0x07,
20
@@ -41,9 +41,9 @@
21
         'Id'                        => 0x14,
22
         'Expiry'                    => 0x15,
23
         'NotifyGUID'                => 0x16,
24
-        'DeivceFriendlyName'        => 0x17
25
-    );
26
+        'DeivceFriendlyName'        => 0x17,
27
+    ;
28
 
29
     // attribute page
30
     #"Version='1.1'"           => 0x05,
31
-}
32
\ No newline at end of file
33
+}
34
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Wbxml/Dtd/ActiveSync/CodePage4.php Changed
31
 
1
@@ -15,14 +15,14 @@
2
  * @package     Wbxml
3
  * @subpackage  ActiveSync
4
  */
5
- 
6
+
7
 class Syncroton_Wbxml_Dtd_ActiveSync_CodePage4 extends Syncroton_Wbxml_Dtd_ActiveSync_Abstract
8
 {
9
     protected $_codePageNumber  = 4;
10
-    
11
+
12
     protected $_codePageName    = 'Calendar';
13
-        
14
-    protected $_tags = array(
15
+
16
+    protected $_tags = 
17
         'Timezone'                => 0x05,
18
         'AllDayEvent'             => 0x06,
19
         'Attendees'               => 0x07,
20
@@ -69,6 +69,6 @@
21
         'IsLeapMonth'             => 0x38,
22
         'FirstDayOfWeek'          => 0x39,
23
         'OnlineMeetingConfLink'   => 0x3a,
24
-        'OnlineMeetingExternalLink' => 0x3b
25
-    );
26
-}
27
\ No newline at end of file
28
+        'OnlineMeetingExternalLink' => 0x3b,
29
+    ;
30
+}
31
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Wbxml/Dtd/ActiveSync/CodePage5.php Changed
29
 
1
@@ -15,14 +15,14 @@
2
  * @package     Wbxml
3
  * @subpackage  ActiveSync
4
  */
5
- 
6
+
7
 class Syncroton_Wbxml_Dtd_ActiveSync_CodePage5 extends Syncroton_Wbxml_Dtd_ActiveSync_Abstract
8
 {
9
     protected $_codePageNumber  = 5;
10
 
11
     protected $_codePageName    = 'Move';
12
 
13
-    protected $_tags = array(
14
+    protected $_tags = 
15
         'MoveItems'               => 0x05,
16
         'Move'                    => 0x06,
17
         'SrcMsgId'                => 0x07,
18
@@ -30,6 +30,6 @@
19
         'DstFldId'                => 0x09,
20
         'Response'                => 0x0a,
21
         'Status'                  => 0x0b,
22
-        'DstMsgId'                => 0x0c
23
-    );
24
-}
25
\ No newline at end of file
26
+        'DstMsgId'                => 0x0c,
27
+    ;
28
+}
29
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Wbxml/Dtd/ActiveSync/CodePage6.php Changed
31
 
1
@@ -15,14 +15,14 @@
2
  * @package     Wbxml
3
  * @subpackage  ActiveSync
4
  */
5
- 
6
+
7
 class Syncroton_Wbxml_Dtd_ActiveSync_CodePage6 extends Syncroton_Wbxml_Dtd_ActiveSync_Abstract
8
 {
9
     protected $_codePageNumber  = 6;
10
-    
11
+
12
     protected $_codePageName    = 'ItemEstimate';
13
-        
14
-    protected $_tags = array(     
15
+
16
+    protected $_tags = 
17
         'GetItemEstimate'         => 0x05,
18
         'Version'                 => 0x06,
19
         'Collections'             => 0x07,
20
@@ -32,6 +32,6 @@
21
         'DateTime'                => 0x0b,
22
         'Estimate'                => 0x0c,
23
         'Response'                => 0x0d,
24
-        'Status'                  => 0x0e
25
-    );
26
-}
27
\ No newline at end of file
28
+        'Status'                  => 0x0e,
29
+    ;
30
+}
31
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Wbxml/Dtd/ActiveSync/CodePage7.php Changed
31
 
1
@@ -15,14 +15,14 @@
2
  * @package     Wbxml
3
  * @subpackage  ActiveSync
4
  */
5
- 
6
+
7
 class Syncroton_Wbxml_Dtd_ActiveSync_CodePage7 extends Syncroton_Wbxml_Dtd_ActiveSync_Abstract
8
 {
9
     protected $_codePageNumber  = 7;
10
-    
11
+
12
     protected $_codePageName    = 'FolderHierarchy';
13
-        
14
-    protected $_tags = array(     
15
+
16
+    protected $_tags = 
17
         'Folders'                => 0x05,
18
         'Folder'                 => 0x06,
19
         'DisplayName'            => 0x07,
20
@@ -42,6 +42,6 @@
21
         'FolderUpdate'           => 0x15,
22
         'FolderSync'             => 0x16,
23
         'Count'                  => 0x17,
24
-        'Version'                => 0x18   // not used anymore
25
-    );
26
-}
27
\ No newline at end of file
28
+        'Version'                => 0x18,   // not used anymore
29
+    ;
30
+}
31
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Wbxml/Dtd/ActiveSync/CodePage8.php Changed
31
 
1
@@ -15,14 +15,14 @@
2
  * @package     Wbxml
3
  * @subpackage  ActiveSync
4
  */
5
- 
6
+
7
 class Syncroton_Wbxml_Dtd_ActiveSync_CodePage8 extends Syncroton_Wbxml_Dtd_ActiveSync_Abstract
8
 {
9
     protected $_codePageNumber  = 8;
10
-    
11
+
12
     protected $_codePageName    = 'MeetingResponse';
13
-        
14
-    protected $_tags = array(     
15
+
16
+    protected $_tags = 
17
         'CalendarId'              => 0x05,
18
         'CollectionId'            => 0x06,
19
         'MeetingResponse'         => 0x07,
20
@@ -32,6 +32,6 @@
21
         'Status'                  => 0x0b,
22
         'UserResponse'            => 0x0c,
23
         'Version'                 => 0x0d, // not used anymore
24
-        'InstanceId'              => 0x0e
25
-    );
26
-}
27
\ No newline at end of file
28
+        'InstanceId'              => 0x0e,
29
+    ;
30
+}
31
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Wbxml/Dtd/ActiveSync/CodePage9.php Changed
29
 
1
@@ -15,14 +15,14 @@
2
  * @package     Wbxml
3
  * @subpackage  ActiveSync
4
  */
5
- 
6
+
7
 class Syncroton_Wbxml_Dtd_ActiveSync_CodePage9 extends Syncroton_Wbxml_Dtd_ActiveSync_Abstract
8
 {
9
     protected $_codePageNumber  = 9;
10
-    
11
+
12
     protected $_codePageName    = 'Tasks';
13
-        
14
-    protected $_tags = array(     
15
+
16
+    protected $_tags = 
17
         'Body'                    => 0x05,
18
         'BodySize'                => 0x06,
19
         'BodyTruncated'           => 0x07,
20
@@ -57,5 +57,5 @@
21
         'CalendarType'            => 0x24,
22
         'IsLeapMonth'             => 0x25,
23
         'FirstDayOfWeek'          => 0x26,
24
-    );
25
-}
26
\ No newline at end of file
27
+    ;
28
+}
29
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Wbxml/Dtd/Exception/CodePageNotFound.php Changed
14
 
1
@@ -16,7 +16,7 @@
2
  * @package     Wbxml
3
  * @subpackage  Wbxml
4
  */
5
- 
6
- class Syncroton_Wbxml_Dtd_Exception_CodePageNotFound extends Exception 
7
- {
8
- }
9
\ No newline at end of file
10
+
11
+class Syncroton_Wbxml_Dtd_Exception_CodePageNotFound extends Exception
12
+{
13
+}
14
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Wbxml/Dtd/Factory.php Changed
46
 
1
@@ -16,34 +16,28 @@
2
  * @package     Wbxml
3
  * @subpackage  Wbxml
4
  */
5
-
6
 class Syncroton_Wbxml_Dtd_Factory
7
 {
8
-    const ACTIVESYNC='AirSync';
9
-    
10
-    const SYNCML='SyncML';
11
-    
12
+    public const ACTIVESYNC = 'AirSync';
13
+    public const SYNCML = 'SyncML';
14
+
15
     /**
16
      * factory function to return a selected contacts backend class
17
      *
18
      * @param string $type
19
-     * @return Addressbook_Backend_Interface
20
+     * @return Syncroton_Wbxml_Dtd_ActiveSync
21
      */
22
-    static public function factory ($_type)
23
+    public static function factory($type)
24
     {
25
-        switch ($_type) {
26
+        switch ($type) {
27
             case self::ACTIVESYNC:
28
                 $instance = new Syncroton_Wbxml_Dtd_ActiveSync();
29
                 break;
30
-                
31
-            case self::SYNCML:
32
-                $instance = new Syncroton_Wbxml_Dtd_Syncml();
33
-                break;
34
-                                
35
+
36
             default:
37
-                throw new Syncroton_Wbxml_Exception('unsupported DTD: ' . $_type);
38
-                break;
39
+                throw new Syncroton_Wbxml_Exception('unsupported DTD: ' . $type);
40
         }
41
+
42
         return $instance;
43
     }
44
-}    
45
+}
46
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Wbxml/Dtd/Syncml Deleted
2
 
1
-(directory)
2
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Wbxml/Dtd/Syncml.php Deleted
44
 
1
@@ -1,42 +0,0 @@
2
-<?php
3
-/**
4
- * Syncroton
5
- *
6
- * @package     Wbxml
7
- * @subpackage  Syncml
8
- * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
9
- * @copyright   Copyright (c) 2008-2009 Metaways Infosystems GmbH (http://www.metaways.de)
10
- * @author      Lars Kneschke <l.kneschke@metaways.de>
11
- * @version     $Id:Factory.php 4968 2008-10-17 09:09:33Z l.kneschke@metaways.de $
12
- */
13
-
14
-/**
15
- * class documentation
16
- *
17
- * @package     Wbxml
18
- * @subpackage  Syncml
19
- */
20
-
21
-class Syncroton_Wbxml_Dtd_Syncml
22
-{
23
-    /**
24
-     * factory function to return a selected contacts backend class
25
-     *
26
-     * @param string $type
27
-     * @return Addressbook_Backend_Interface
28
-     */
29
-    static public function factory ($_type)
30
-    {
31
-        switch ($_type) {
32
-            case 'syncml:syncml1.1':
33
-            case 'syncml:syncml1.2':
34
-            case 'syncml:metinf1.1':
35
-            case 'syncml:metinf1.2':
36
-            case 'syncml:devinf1.1':
37
-            case 'syncml:devinf1.2':
38
-                throw new Syncroton_Wbxml_Exception('unsupported DTD: ' . $_type);
39
-                break;
40
-        }
41
-        return $instance;
42
-    }
43
-}    
44
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Wbxml/Dtd/Syncml/Abstract.php Deleted
106
 
1
@@ -1,103 +0,0 @@
2
-<?php
3
-/**
4
- * Syncroton
5
- *
6
- * @package     Wbxml
7
- * @subpackage  Syncml
8
- * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
9
- * @copyright   Copyright (c) 2008-2009 Metaways Infosystems GmbH (http://www.metaways.de)
10
- * @author      Lars Kneschke <l.kneschke@metaways.de>
11
- * @version     $Id:Abstract.php 4968 2008-10-17 09:09:33Z l.kneschke@metaways.de $
12
- */
13
-
14
-/**
15
- * class documentation
16
- *
17
- * @package     Wbxml
18
- * @subpackage  Syncml
19
- */
20
- 
21
-class Syncroton_Wbxml_Dtd_Syncml_Abstract
22
-{     
23
-    protected $_tags; 
24
-     
25
-    protected $_identity;
26
-    
27
-    protected $_codePages;
28
-    
29
-    protected $_currentCodePage;
30
-    
31
-    public function __construct($_initialCodePage = 0x00)
32
-    {
33
-        $this->switchCodePage($_initialCodePage);
34
-    }
35
-    
36
-    /**
37
-     * switch codepage
38
-     *
39
-     * @param integer $_id id of the codePage
40
-     * @return array
41
-     */
42
-    public function switchCodePage($_id)
43
-    {
44
-        if(!isset($this->_codePages$_id)) {
45
-            throw new Syncroton_Wbxml_Dtd_Exception_CodePageNotFound('invalid codePage id: ' . $_id);
46
-        }
47
-        $this->_currentCodePage = $_id;
48
-        $this->_tags = $this->_codePages$this->_currentCodePage'tags';
49
-        $this->_identity = array_flip($this->_tags);
50
-        
51
-        return $this->_codePages$this->_currentCodePage;
52
-    }
53
-    
54
-    /**
55
-     * get currently active codepage
56
-     *
57
-     * @return array
58
-     */
59
-    public function getCurrentCodePage()
60
-    {
61
-        return $this->_codePages$this->_currentCodePage;
62
-    }
63
-    
64
-    public function getTag($_identity)
65
-    {
66
-        if(!isset($this->_identity$_identity)) {
67
-            throw new Syncroton_Wbxml_Exception("identity $_identity not found");
68
-        }
69
-        
70
-        return $this->_identity$_identity;
71
-    }
72
-    
73
-    public function getIdentity($_tag)
74
-    {
75
-        if(!isset($this->_tags$_tag)) {
76
-            var_dump($this->_tags);
77
-            throw new Syncroton_Wbxml_Exception("tag $_tag not found");
78
-        }
79
-        
80
-        return $this->_tags$_tag;
81
-    }
82
-    
83
-    /**
84
-     * switch codepage by urn
85
-     *
86
-     * @param string $_urn
87
-     * @return array
88
-     */
89
-    public function switchCodePageByUrn($_urn)
90
-    {
91
-        $codePageNumber = NULL;
92
-        foreach($this->_codePages as $codePage) {
93
-            if($codePage'urn' == $_urn) {
94
-                $codePageNumber = $codePage'codePageNumber';
95
-            }
96
-        }
97
-        
98
-        if($codePageNumber === NULL) {
99
-            throw new Syncroton_Wbxml_Dtd_Exception_CodePageNotFound("codePage with URN $_urn not found");
100
-        }
101
-        
102
-        return $this->switchCodePage($codePageNumber);
103
-    }
104
-}
105
\ No newline at end of file
106
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Wbxml/Dtd/Syncml/DevInfo11.php Deleted
74
 
1
@@ -1,71 +0,0 @@
2
-<?php
3
-/**
4
- * Syncroton
5
- *
6
- * @package     Wbxml
7
- * @subpackage  Syncml
8
- * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
9
- * @copyright   Copyright (c) 2008-2009 Metaways Infosystems GmbH (http://www.metaways.de)
10
- * @author      Lars Kneschke <l.kneschke@metaways.de>
11
- * @version     $Id:DevInfo11.php 4968 2008-10-17 09:09:33Z l.kneschke@metaways.de $
12
- */
13
-
14
-/**
15
- * class documentation
16
- *
17
- * @package     Wbxml
18
- * @subpackage  Syncml
19
- */
20
- 
21
-class Syncroton_Wbxml_Dtd_Syncml_DevInfo11 extends Syncroton_Wbxml_Dtd_Syncml_Abstract
22
-{
23
-    protected $_codePages = array(
24
-        0x00 => array(
25
-            'codePageNumber'=> 0x00,
26
-            'dtdname'       => 'DevInf',
27
-            'dpi'           => '-//SYNCML//DTD DevInf 1.1//EN',
28
-            'url'           => 'http://www.syncml.org/docs/devinf_v11_20020215.dtd',
29
-            'urn'           => 'syncml:devinf1.1',
30
-            'tags'          => array(     
31
-                "CTCap"             => 0x05, 
32
-                "CTType"            => 0x06, 
33
-                "DataStore"         => 0x07, 
34
-                "DataType"          => 0x08, 
35
-                "DevID"             => 0x09, 
36
-                "DevInf"            => 0x0a, 
37
-                "DevTyp"            => 0x0b, 
38
-                "DisplayName"       => 0x0c, 
39
-                "DSMem"             => 0x0d, 
40
-                "Ext"               => 0x0e, 
41
-                "FwV"               => 0x0f, 
42
-                "HwV"               => 0x10, 
43
-                "Man"               => 0x11, 
44
-                "MaxGUIDSize"       => 0x12, 
45
-                "MaxID"             => 0x13, 
46
-                "MaxMem"            => 0x14, 
47
-                "Mod"               => 0x15, 
48
-                "OEM"               => 0x16, 
49
-                "ParamName"         => 0x17, 
50
-                "PropName"          => 0x18, 
51
-                "Rx"                => 0x19, 
52
-                "Rx-Pref"           => 0x1a, 
53
-                "SharedMem"         => 0x1b, 
54
-                "Size"              => 0x1c, 
55
-                "SourceRef"         => 0x1d, 
56
-                "SwV"               => 0x1e, 
57
-                "SyncCap"           => 0x1f, 
58
-                "SyncType"          => 0x20, 
59
-                "Tx"                => 0x21, 
60
-                "Tx-Pref"           => 0x22, 
61
-                "ValEnum"           => 0x23, 
62
-                "VerCT"             => 0x24, 
63
-                "VerDTD"            => 0x25, 
64
-                "XNam"              => 0x26, 
65
-                "XVal"              => 0x27, 
66
-                "UTC"               => 0x28, 
67
-                "SupportNumberOfChanges"=> 0x29, 
68
-                "SupportLargeObjs"  => 0x2a 
69
-            )
70
-        )
71
-    );
72
-}
73
\ No newline at end of file
74
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Wbxml/Dtd/Syncml/DevInfo12.php Deleted
83
 
1
@@ -1,80 +0,0 @@
2
-<?php
3
-/**
4
- * Syncroton
5
- *
6
- * @package     Wbxml
7
- * @subpackage  Syncml
8
- * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
9
- * @copyright   Copyright (c) 2008-2009 Metaways Infosystems GmbH (http://www.metaways.de)
10
- * @author      Lars Kneschke <l.kneschke@metaways.de>
11
- * @version     $Id:DevInfo12.php 4968 2008-10-17 09:09:33Z l.kneschke@metaways.de $
12
- */
13
-
14
-/**
15
- * class documentation
16
- *
17
- * @package     Wbxml
18
- * @subpackage  Syncml
19
- */
20
- 
21
-class Syncroton_Wbxml_Dtd_Syncml_DevInfo12 extends Syncroton_Wbxml_Dtd_Syncml_Abstract
22
-{    
23
-    protected $_codePages = array(
24
-        0x00 => array(
25
-            'codePageNumber'=> 0x00,
26
-            'dtdname'       => 'DevInf',
27
-            'dpi'           => '-//OMA//DTD SYNCML-DEVINF 1.2//EN',
28
-            'url'           => 'http://www.openmobilealliance.org/tech/DTD/OMA-SyncML-Device_Information-DTD-1.2.dtd',
29
-            'urn'           => 'syncml:devinf1.2',
30
-            'tags'          => array(     
31
-                "CTCap"             => 0x05, 
32
-                "CTType"            => 0x06, 
33
-                "DataStore"         => 0x07, 
34
-                "DataType"          => 0x08, 
35
-                "DevID"             => 0x09, 
36
-                "DevInf"            => 0x0a, 
37
-                "DevTyp"            => 0x0b, 
38
-                "DisplayName"       => 0x0c, 
39
-                "DSMem"             => 0x0d, 
40
-                "Ext"               => 0x0e, 
41
-                "FwV"               => 0x0f, 
42
-                "HwV"               => 0x10, 
43
-                "Man"               => 0x11, 
44
-                "MaxGUIDSize"       => 0x12, 
45
-                "MaxID"             => 0x13, 
46
-                "MaxMem"            => 0x14, 
47
-                "Mod"               => 0x15, 
48
-                "OEM"               => 0x16, 
49
-                "ParamName"         => 0x17, 
50
-                "PropName"          => 0x18, 
51
-                "Rx"                => 0x19, 
52
-                "Rx-Pref"           => 0x1a, 
53
-                "SharedMem"         => 0x1b, 
54
-                "Size"              => 0x1c, 
55
-                "SourceRef"         => 0x1d, 
56
-                "SwV"               => 0x1e, 
57
-                "SyncCap"           => 0x1f, 
58
-                "SyncType"          => 0x20, 
59
-                "Tx"                => 0x21, 
60
-                "Tx-Pref"           => 0x22, 
61
-                "ValEnum"           => 0x23, 
62
-                "VerCT"             => 0x24, 
63
-                "VerDTD"            => 0x25, 
64
-                "XNam"              => 0x26, 
65
-                "XVal"              => 0x27, 
66
-                "UTC"               => 0x28, 
67
-                "SupportNumberOfChanges"=> 0x29, 
68
-                "SupportLargeObjs"  => 0x2a, 
69
-                "Property"          => 0x2b, 
70
-                "PropParam"         => 0x2c, 
71
-                "MaxOccur"          => 0x2d, 
72
-                "NoTruncate"        => 0x2e, 
73
-                "Filter-Rx"         => 0x30, 
74
-                "FilterCap"         => 0x31, 
75
-                "FilterKeyword"     => 0x32, 
76
-                "FieldLevel"        => 0x33, 
77
-                "SupportHierarchicalSync"=> 0x34
78
-            )
79
-        )
80
-    );
81
-}
82
\ No newline at end of file
83
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Wbxml/Dtd/Syncml/Syncml11.php Deleted
110
 
1
@@ -1,107 +0,0 @@
2
-<?php
3
-/**
4
- * Syncroton
5
- *
6
- * @package     Wbxml
7
- * @subpackage  Syncml
8
- * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
9
- * @copyright   Copyright (c) 2008-2009 Metaways Infosystems GmbH (http://www.metaways.de)
10
- * @author      Lars Kneschke <l.kneschke@metaways.de>
11
- * @version     $Id:Syncml11.php 4968 2008-10-17 09:09:33Z l.kneschke@metaways.de $
12
- */
13
-
14
-/**
15
- * class documentation
16
- *
17
- * @package     Wbxml
18
- * @subpackage  Syncml
19
- */
20
- 
21
-class Syncroton_Wbxml_Dtd_Syncml_Syncml11 extends Syncroton_Wbxml_Dtd_Syncml_Abstract
22
-{     
23
-    protected $_codePages = array(
24
-        0x00 => array(
25
-            'codePageNumber'=> 0x00,
26
-            'dtdname'       => 'SyncML',
27
-            'dpi'           => '-//SYNCML//DTD SyncML 1.1//EN',
28
-            'url'           => "http://www.syncml.org/docs/syncml_represent_v11_20020213.dtd",
29
-            'urn'           => 'syncml:syncml1.1',
30
-            'tags'          => array(     
31
-                'Add'               => 0x05,
32
-                'Alert'             => 0x06,
33
-                'Archive'           => 0x07,
34
-                'Atomic'            => 0x08,
35
-                'Chal'              => 0x09,
36
-                'Cmd'               => 0x0a,
37
-                'CmdID'             => 0x0b,
38
-                'CmdRef'            => 0x0c,
39
-                'Copy'              => 0x0d,
40
-                'Cred'              => 0x0e,
41
-                'Data'              => 0x0f,
42
-                'Delete'            => 0x10,
43
-                'Exec'              => 0x11,
44
-                'Final'             => 0x12,
45
-                'Get'               => 0x13,
46
-                'Item'              => 0x14,
47
-                'Lang'              => 0x15,
48
-                'LocName'           => 0x16,
49
-                'LocURI'            => 0x17,
50
-                'Map'               => 0x18,
51
-                'MapItem'           => 0x19,
52
-                'Meta'              => 0x1a,
53
-                'MsgID'             => 0x1b,
54
-                'MsgRef'            => 0x1c,
55
-                'NoResp'            => 0x1d,
56
-                'NoResults'         => 0x1e,
57
-                'Put'               => 0x1f,
58
-                'Replace'           => 0x20,
59
-                'RespURI'           => 0x21,
60
-                'Results'           => 0x22,
61
-                'Search'            => 0x23,
62
-                'Sequence'          => 0x24,
63
-                'SessionID'         => 0x25,
64
-                'SftDel'            => 0x26,
65
-                'Source'            => 0x27,
66
-                'SourceRef'         => 0x28,
67
-                'Status'            => 0x29,
68
-                'Sync'              => 0x2a,
69
-                'SyncBody'          => 0x2b,
70
-                'SyncHdr'           => 0x2c,
71
-                'SyncML'            => 0x2d,
72
-                'Target'            => 0x2e,
73
-                'TargetRef'         => 0x2f,
74
-                'Reserved for future use.' => 0x30,
75
-                'VerDTD'            => 0x31,
76
-                'VerProto'          => 0x32,
77
-                'NumberOfChanges'   => 0x33,
78
-                'MoreData'          => 0x34
79
-            )    
80
-        ),
81
-        0x01 => array(
82
-            'codePageNumber'=> 0x01,
83
-            'dtdname'       => 'MetInf',
84
-            'dpi'           => '-//SYNCML//DTD MetInf 1.1//EN',
85
-            'url'           => 'http://www.syncml.org/docs/syncml_metinf_v11_20020215.dtd ',
86
-            'urn'           => 'syncml:metinf1.1',
87
-            'tags'          => array(     
88
-                'Anchor'       => 0x05,
89
-                'EMI'          => 0x06,
90
-                'Format'       => 0x07,
91
-                'FreeID'       => 0x08,
92
-                'FreeMem'      => 0x09,
93
-                'Last'         => 0x0a,
94
-                'Mark'         => 0x0b,
95
-                'MaxMsgSize'   => 0x0c,
96
-                'Mem'          => 0x0d,
97
-                'MetInf'       => 0x0e,
98
-                'Next'         => 0x0f,
99
-                'NextNonce'    => 0x10,
100
-                'SharedMem'    => 0x11,
101
-                'Size'         => 0x12,
102
-                'Type'         => 0x13,
103
-                'Version'      => 0x14,
104
-                'MaxObjSize'   => 0x15
105
-            )
106
-        ) 
107
-    );    
108
-}
109
\ No newline at end of file
110
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Wbxml/Dtd/Syncml/Syncml12.php Deleted
125
 
1
@@ -1,122 +0,0 @@
2
-<?php
3
-/**
4
- * Syncroton
5
- *
6
- * @package     Wbxml
7
- * @subpackage  Syncml
8
- * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
9
- * @copyright   Copyright (c) 2008-2009 Metaways Infosystems GmbH (http://www.metaways.de)
10
- * @author      Lars Kneschke <l.kneschke@metaways.de>
11
- * @version     $Id:Syncml12.php 4968 2008-10-17 09:09:33Z l.kneschke@metaways.de $
12
- */
13
-
14
-/**
15
- * class documentation
16
- *
17
- * @package     Wbxml
18
- * @subpackage  Syncml
19
- */
20
- 
21
-class Syncroton_Wbxml_Dtd_Syncml_Syncml12 extends Syncroton_Wbxml_Dtd_Syncml_Abstract
22
-{     
23
-          
24
-    /**
25
-     * section 8.2
26
-     *
27
-     * @var array
28
-     */
29
-    protected $_codePages = array(
30
-        0x00 => array(
31
-            'codePageNumber'=> 0x00,
32
-            'dtdname'       => 'SyncML',
33
-            'dpi'           => '-//SYNCML//DTD SyncML 1.2//EN',
34
-            'url'           => 'http://www.openmobilealliance.org/tech/DTD/OMA-TS-SyncML_RepPro_DTD-V1_2.dtd',
35
-            'urn'           => 'SYNCML:SYNCML1.2',
36
-            'tags'          => array(     
37
-                'Add'           => 0x05,
38
-                'Alert'         => 0x06,
39
-                'Archive'       => 0x07,
40
-                'Atomic'        => 0x08,
41
-                'Chal'          => 0x09,
42
-                'Cmd'           => 0x0a,
43
-                'CmdID'         => 0x0b,
44
-                'CmdRef'        => 0x0c,
45
-                'Copy'          => 0x0d,
46
-                'Cred'          => 0x0e,
47
-                'Data'          => 0x0f,
48
-                'Delete'        => 0x10,
49
-                'Exec'          => 0x11,
50
-                'Final'         => 0x12,
51
-                'Get'           => 0x13,
52
-                'Item'          => 0x14,
53
-                'Lang'          => 0x15,
54
-                'LocName'       => 0x16,
55
-                'LocURI'        => 0x17,
56
-                'Map'           => 0x18,
57
-                'MapItem'       => 0x19,
58
-                'Meta'          => 0x1a,
59
-                'MsgID'         => 0x1b,
60
-                'MsgRef'        => 0x1c,
61
-                'NoResp'        => 0x1d,
62
-                'NoResults'     => 0x1e,
63
-                'Put'           => 0x1f,
64
-                'Replace'       => 0x20,
65
-                'RespURI'       => 0x21,
66
-                'Results'       => 0x22,
67
-                'Search'        => 0x23,
68
-                'Sequence'      => 0x24,
69
-                'SessionID'     => 0x25,
70
-                'SftDel'        => 0x26,
71
-                'Source'        => 0x27,
72
-                'SourceRef'     => 0x28,
73
-                'Status'        => 0x29,
74
-                'Sync'          => 0x2a,
75
-                'SyncBody'      => 0x2b,
76
-                'SyncHdr'       => 0x2c,
77
-                'SyncML'        => 0x2d,
78
-                'Target'        => 0x2e,
79
-                'TargetRef'     => 0x2f,
80
-                'Reserved for future use.' => 0x30,
81
-                'VerDTD'        => 0x31,
82
-                'VerProto'      => 0x32,
83
-                'NumberOfChanges' =>  0x33,
84
-                'MoreData'      =>  0x34,
85
-                'Field'         =>  0x35,
86
-                'Filter'        =>  0x36,
87
-                'Record'        =>  0x37,
88
-                'FilterType'    =>  0x38,
89
-                'SourceParent'  =>  0x39,
90
-                'TargetParent'  =>  0x3a,
91
-                'Move'          =>  0x3b,
92
-                'Correlator'    =>  0x3c
93
-            )
94
-        ),
95
-        0x01 => array(
96
-            'codePageNumber'=> 0x01,
97
-            'dtdname'       => 'MetInf',
98
-            'dpi'           => '-//OMA//DTD SYNCML-METINF 1.2//EN',
99
-            'url'           => 'http://www.openmobilealliance.org/tech/DTD/OMA-TS-SyncML_MetaInfo_DTD-V1_2.dtd',
100
-            'urn'           => 'syncml:metinf1.2',
101
-            'tags'          => array(     
102
-                'Anchor'       => 0x05,
103
-                'EMI'          => 0x06,
104
-                'Format'       => 0x07,
105
-                'FreeID'       => 0x08,
106
-                'FreeMem'      => 0x09,
107
-                'Last'         => 0x0a,
108
-                'Mark'         => 0x0b,
109
-                'MaxMsgSize'   => 0x0c,
110
-                'Mem'          => 0x0d,
111
-                'MetInf'       => 0x0e,
112
-                'Next'         => 0x0f,
113
-                'NextNonce'    => 0x10,
114
-                'SharedMem'    => 0x11,
115
-                'Size'         => 0x12,
116
-                'Type'         => 0x13,
117
-                'Version'      => 0x14,
118
-                'MaxObjSize'   => 0x15,
119
-                'FieldLevel'   => 0x16
120
-            )
121
-        ) 
122
-    );
123
-}
124
\ No newline at end of file
125
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Wbxml/Encoder.php Changed
201
 
1
@@ -16,22 +16,22 @@
2
  * @package     Wbxml
3
  * @subpackage  Wbxml
4
  */
5
- 
6
+
7
 class Syncroton_Wbxml_Encoder extends Syncroton_Wbxml_Abstract
8
 {
9
     /**
10
      * count level of tags
11
      *
12
-     * @var string
13
+     * @var int
14
      */
15
     protected $_level = 0;
16
-    
17
+
18
     /**
19
      * the constructor
20
      *
21
      * @param resource $_stream
22
-     * @param string $_charSet
23
-     * @param integer $_version
24
+     * @param string   $_charSet
25
+     * @param int      $_version
26
      */
27
     public function __construct($_stream, $_charSet = 'UTF-8', $_version = 2)
28
     {
29
@@ -43,18 +43,18 @@
30
     /**
31
      * initialize internal variables and write wbxml header to stream
32
      *
33
-     * @param string $_urn
34
+     * @param DOMDocument $_dom
35
      * @todo check if dpi > 0, instead checking the urn
36
      */
37
     protected function _initialize($_dom)
38
     {
39
         $this->_dtd = Syncroton_Wbxml_Dtd_Factory::factory($_dom->doctype->name);
40
         $this->_codePage = $this->_dtd->getCurrentCodePage();
41
-        
42
+
43
         // the WBXML version
44
         $this->_writeByte($this->_version);
45
-        
46
-        if($this->_codePage->getDPI() === NULL) {
47
+
48
+        if($this->_codePage->getDPI() === null) {
49
             // the document public identifier
50
             $this->_writeMultibyteUInt(1);
51
         } else {
52
@@ -63,22 +63,22 @@
53
             $this->_writeMultibyteUInt(0);
54
             // the offset of the DPI in the string table
55
             $this->_writeByte(0);
56
-        }        
57
-        
58
+        }
59
+
60
         // write the charSet
61
         $this->_writeCharSet($this->_charSet);
62
-        
63
-        if($this->_codePage->getDPI() === NULL) {
64
+
65
+        if($this->_codePage->getDPI() === null) {
66
             // the length of the string table
67
             $this->_writeMultibyteUInt(0);
68
         } else {
69
             // the length of the string table
70
             $this->_writeMultibyteUInt(strlen($this->_codePage->getDPI()));
71
             // the dpi
72
-            $this->_writeString($this->_codePage->getDPI());      
73
-        }  
74
+            $this->_writeString($this->_codePage->getDPI());
75
+        }
76
     }
77
-    
78
+
79
     /**
80
      * write charset to stream
81
      *
82
@@ -91,31 +91,28 @@
83
             case 'UTF-8':
84
                 $this->_writeMultibyteUInt(106);
85
                 break;
86
-                
87
+
88
             default:
89
                 throw new Syncroton_Wbxml_Exception('unsuported charSet ' . strtoupper($_charSet));
90
-                break;
91
         }
92
-        
93
     }
94
-    
95
+
96
     /**
97
      * start encoding of xml to wbxml
98
      *
99
-     * @param string $_xml the xml string
100
-     * @return resource stream
101
+     * @param DOMDocument $_dom the DOM document
102
      */
103
     public function encode(DOMDocument $_dom)
104
     {
105
         $_dom->formatOutput = false;
106
-        
107
+
108
         $this->_initialize($_dom);
109
         $this->_traverseDom($_dom);
110
     }
111
 
112
     private function getAttributes($node)
113
     {
114
-        $attributes = array();
115
+        $attributes = ;
116
         if ($node->attributes) {
117
             for ($i = 0; $i < $node->attributes->length; ++$i) {
118
                 $attributes$node->attributes->item($i)->name = $node->attributes->item($i)->value;
119
@@ -124,7 +121,8 @@
120
         return $attributes;
121
     }
122
 
123
-    private function writeNode($node, $withContent = false, $data = null) {
124
+    private function writeNode($node, $withContent = false, $data = null)
125
+    {
126
         if($this->_codePage->getNameSpace() != $node->namespaceURI) {
127
             $this->_switchCodePage($node->namespaceURI);
128
         }
129
@@ -172,14 +170,15 @@
130
     /**
131
      * strip uri: from nameSpace
132
      *
133
-     * @param unknown_type $_nameSpace
134
-     * @return unknown
135
+     * @param string $_nameSpace
136
+     *
137
+     * @return string
138
      */
139
     protected function _stripNameSpace($_nameSpace)
140
     {
141
         return substr($_nameSpace, 4);
142
     }
143
-    
144
+
145
     /**
146
      * writes tag with data to stream
147
      *
148
@@ -188,36 +187,36 @@
149
      * @param bool $_hasContent
150
      * @param string $_data
151
      */
152
-    protected function _writeTag($_tag, $_attributes=NULL, $_hasContent=false, $_data=NULL)
153
+    protected function _writeTag($_tag, $_attributes = null, $_hasContent = false, $_data = null)
154
     {
155
-        if($_hasContent == false && $_data !== NULL) {
156
+        if($_hasContent == false && $_data !== null) {
157
             throw new Syncroton_Wbxml_Exception('$_hasContent can not be false, when $_data !== NULL');
158
         }
159
-        
160
+
161
         // handle the tag
162
         $identity = $this->_codePage->getIdentity($_tag);
163
-        
164
+
165
         if (is_array($_attributes) && isset($_attributes'uri:Syncroton;encoding')) {
166
             $encoding = 'opaque';
167
             unset($_attributes'uri:Syncroton;encoding');
168
         } else {
169
             $encoding = 'termstring';
170
         }
171
-        
172
+
173
         if(!empty($_attributes)) {
174
             $identity |= 0x80;
175
         }
176
-        
177
+
178
         if($_hasContent == true) {
179
             $identity |= 0x40;
180
         }
181
-        
182
+
183
         $this->_writeByte($identity);
184
-        
185
+
186
         // handle the data
187
-        if($_data !== NULL) {
188
+        if($_data !== null) {
189
             if ($encoding == 'opaque') {
190
-                $this->_writeOpaqueString(base64_decode($_data));
191
+                $this->_writeOpaqueString(base64_decode($_data));
192
             } else {
193
                 $this->_writeTerminatedString($_data);
194
             }
195
@@ -227,19 +226,19 @@
196
     /**
197
      * switch code page
198
      *
199
-     * @param string $_urn
200
+     * @param string $_nameSpace
201
kolab-syncroton-2.4.2.tar.gz/lib/ext/Syncroton/Wbxml/Exception.php Changed
12
 
1
@@ -17,7 +17,7 @@
2
  * @subpackage  Wbxml
3
  */
4
 
5
-class Syncroton_Wbxml_Exception extends Exception 
6
+class Syncroton_Wbxml_Exception extends Exception
7
 {
8
     protected $message = 'wbxml exception';
9
-}
10
\ No newline at end of file
11
+}
12
kolab-syncroton-2.4.2.tar.gz/lib/kolab_sync_backend_common.php Changed
17
 
1
@@ -144,13 +144,14 @@
2
     /**
3
      * Deletes Syncroton data object
4
      *
5
-     * @param string|object $id Object or identifier
6
+     * @param string|Syncroton_Model_IEntry $id Object or identifier
7
      *
8
      * @return bool True on success, False on failure
9
      * @throws Syncroton_Exception_DeadlockDetected|Exception
10
      */
11
     public function delete($id)
12
     {
13
+        // @phpstan-ignore-next-line
14
         $id = $id instanceof $this->interface_name ? $id->id : $id;
15
 
16
         if (!$id) {
17
kolab-syncroton-2.4.2.tar.gz/lib/kolab_sync_backend_device.php Changed
10
 
1
@@ -76,7 +76,7 @@
2
     /**
3
      * Delete a device
4
      *
5
-     * @param Syncroton_Model_IDevice $device Device object
6
+     * @param string|Syncroton_Model_IDevice $device Device object
7
      *
8
      * @return bool True on success, False on failure
9
      */
10
kolab-syncroton-2.4.2.tar.gz/lib/kolab_sync_backend_state.php Changed
7
 
1
@@ -225,5 +225,4 @@
2
         $select = $this->db->query("SELECT id FROM `{$this->table_name}` WHERE " . implode(' AND ', $where));
3
         return $this->db->num_rows($select) > 0;
4
     }
5
-
6
 }
7
kolab-syncroton-2.4.2.tar.gz/lib/kolab_sync_data.php Changed
35
 
1
@@ -510,7 +510,7 @@
2
         $found  = false;
3
 
4
         foreach ($this->extractFolders($folderid) as $fid) {
5
-            $search = $this->backend->searchEntries($fid, $this->device->deviceid, $this->modelName, $filter, $result_type, $force, $extraData);
6
+            $search = $this->backend->searchEntries($fid, $this->device->deviceid, $this->device->id, $this->modelName, $filter, $result_type, $force, $extraData);
7
             $found = true;
8
 
9
             switch ($result_type) {
10
@@ -587,7 +587,7 @@
11
         return $this->searchEntries($folderId, $filter, self::RESULT_COUNT, $syncState->extraData);
12
     }
13
 
14
- 
15
+
16
     public function getExtraData(Syncroton_Model_IFolder $folder)
17
     {
18
         return $this->backend->getExtraData($folder->serverId, $this->device->deviceid);
19
@@ -636,7 +636,6 @@
20
      */
21
     public function getCountOfChanges(Syncroton_Backend_IContent $contentBackend, Syncroton_Model_IFolder $folder, Syncroton_Model_ISyncState $syncState)
22
     {
23
-        // @phpstan-ignore-next-line
24
         $allClientEntries = $contentBackend->getFolderState($this->device, $folder, $syncState->counter);
25
         $allServerEntries = $this->getServerEntries($folder->serverId, $folder->lastfiltertype);
26
         $changedEntries   = $this->getChangedEntriesCount($folder->serverId, $syncState, $folder->lastfiltertype);
27
@@ -662,7 +661,6 @@
28
                 return true;
29
             }
30
 
31
-            // @phpstan-ignore-next-line
32
             $allClientEntries = $contentBackend->getFolderState($this->device, $folder, $syncState->counter);
33
 
34
             // @TODO: Consider looping over all folders here, not in getServerEntries() and
35
kolab-syncroton-2.4.2.tar.gz/lib/kolab_sync_data_calendar.php Changed
10
 
1
@@ -1246,7 +1246,7 @@
2
     /**
3
      * Sanity checks on event input
4
      *
5
-     * @param Syncroton_Model_IEntry &$entry Entry object
6
+     * @param Syncroton_Model_Event|Syncroton_Model_EventException &$entry Entry object
7
      *
8
      * @throws Syncroton_Exception_Status_Sync
9
      */
10
kolab-syncroton-2.4.2.tar.gz/lib/kolab_sync_data_email.php Changed
12
 
1
@@ -720,8 +720,8 @@
2
     /**
3
      * add entry from xml data
4
      *
5
-     * @param string                 $folderId Folder identifier
6
-     * @param Syncroton_Model_IEntry $entry    Entry
7
+     * @param string                $folderId Folder identifier
8
+     * @param Syncroton_Model_Email $entry    Entry
9
      *
10
      * @return string ID of the created entry
11
      */
12
kolab-syncroton-2.4.2.tar.gz/lib/kolab_sync_logger.php Changed
10
 
1
@@ -103,7 +103,7 @@
2
 
3
         // if log_file is configured all logs will go to it
4
         // otherwise use separate file for info/debug and warning/error
5
-        $file="undefined";
6
+        $file = "undefined";
7
         if (!$logfile) {
8
             switch ($mode) {
9
                 case self::DEBUG:
10
kolab-syncroton-2.4.2.tar.gz/lib/kolab_sync_storage.php Changed
180
 
1
@@ -1135,6 +1135,7 @@
2
      *
3
      * @param string $folderid    Folder identifier
4
      * @param string $deviceid    Device identifier
5
+     * @param string $device_key  Device primary key
6
      * @param string $type        Activesync model name (folder type)
7
      * @param array  $filter      Filter
8
      * @param int    $result_type Type of the result (see kolab_sync_data::RESULT_* constants)
9
@@ -1143,10 +1144,10 @@
10
      *
11
      * @return array|int Search result as count or array of uids
12
      */
13
-    public function searchEntries($folderid, $deviceid, $type, $filter, $result_type, $force, $extraData)
14
+    public function searchEntries($folderid, $deviceid, $device_key, $type, $filter, $result_type, $force, $extraData)
15
     {
16
         if ($type != self::MODEL_EMAIL) {
17
-            return $this->searchKolabEntries($folderid, $deviceid, $type, $filter, $result_type, $force);
18
+            return $this->searchKolabEntries($folderid, $deviceid, $device_key, $type, $filter, $result_type, $force);
19
         }
20
 
21
         $filter_str = 'ALL UNDELETED';
22
@@ -1163,11 +1164,6 @@
23
             }
24
         }
25
 
26
-        // get members of modified relations
27
-        if ($this->relationSupport) {
28
-            $changed_msgs = $this->getChangesByRelations($folderid, $deviceid, $type, $filter);
29
-        }
30
-
31
         $result = $result_type == kolab_sync_data::RESULT_COUNT ? 0 : ;
32
 
33
         $foldername = $this->folder_id2name($folderid, $deviceid);
34
@@ -1247,19 +1243,24 @@
35
             }
36
         }
37
 
38
-        // handle relation changes
39
-        if (!empty($changed_msgs)) {
40
-            $members = $this->findRelationMembersInFolder($foldername, $changed_msgs, $filter);
41
-
42
-            switch ($result_type) {
43
-                case kolab_sync_data::RESULT_COUNT:
44
-                    $result += count($members);
45
-                    break;
46
-
47
-                case kolab_sync_data::RESULT_UID:
48
-                    $result = array_values(array_unique(array_merge($result, $members)));
49
-                    break;
50
+        // get members of modified relations
51
+        if ($this->relationSupport) {
52
+            $changed_msgs = $this->getChangesByRelations($folderid, $device_key, $type, $filter);
53
+            // handle relation changes
54
+            if (!empty($changed_msgs)) {
55
+                $members = $this->findRelationMembersInFolder($foldername, $changed_msgs, $filter);
56
+
57
+                switch ($result_type) {
58
+                    case kolab_sync_data::RESULT_COUNT:
59
+                        $result += count($members);
60
+                        break;
61
+
62
+                    case kolab_sync_data::RESULT_UID:
63
+                        $result = array_values(array_unique(array_merge($result, $members)));
64
+                        break;
65
+                }
66
             }
67
+
68
         }
69
 
70
         return $result;
71
@@ -1299,6 +1300,7 @@
72
      *
73
      * @param string $folderid    Folder identifier
74
      * @param string $deviceid    Device identifier
75
+     * @param string $device_key  Device primary key
76
      * @param string $type        Activesync model name (folder type)
77
      * @param array  $filter      Filter
78
      * @param int    $result_type Type of the result (see kolab_sync_data::RESULT_* constants)
79
@@ -1306,13 +1308,13 @@
80
      *
81
      * @return array|int Search result as count or array of uids
82
      */
83
-    protected function searchKolabEntries($folderid, $deviceid, $type, $filter, $result_type, $force)
84
+    protected function searchKolabEntries($folderid, $deviceid, $device_key, $type, $filter, $result_type, $force)
85
     {
86
         // there's a PHP Warning from kolab_storage if $filter isn't an array
87
         if (empty($filter)) {
88
             $filter = ;
89
         } elseif ($this->relationSupport && ($type == self::MODEL_TASKS || $type == self::MODEL_NOTES)) {
90
-            $changed_objects = $this->getChangesByRelations($folderid, $deviceid, $type, $filter);
91
+            $changed_objects = $this->getChangesByRelations($folderid, $device_key, $type, $filter);
92
         }
93
 
94
         $folder = $this->getFolder($folderid, $deviceid, $type);
95
@@ -1472,7 +1474,7 @@
96
      * Detect changes of relation (tag) objects data and assigned objects
97
      * Returns relation member identifiers
98
      */
99
-    protected function getChangesByRelations($folderid, $deviceid, $type, $filter)
100
+    protected function getChangesByRelations($folderid, $device_key, $type, $filter)
101
     {
102
         // get period filter, create new objects filter
103
         foreach ($filter as $f) {
104
@@ -1487,7 +1489,7 @@
105
         }
106
 
107
         // get relations state from the last sync
108
-        $last_state = (array) $this->relations_state_get($deviceid, $folderid, $since);
109
+        $last_state = (array) $this->relations_state_get($device_key, $folderid, $since);
110
 
111
         // get current relations state
112
         $config  = kolab_storage_config::get_instance();
113
@@ -1564,7 +1566,7 @@
114
 
115
             $now = new DateTime('now', new DateTimeZone('UTC'));
116
 
117
-            $this->relations_state_set($deviceid, $folderid, $now, $data);
118
+            $this->relations_state_set($device_key, $folderid, $now, $data);
119
         }
120
 
121
         // in mail mode return only message URIs
122
@@ -1915,7 +1917,7 @@
123
     /**
124
      * Set state of relation objects at specified point in time
125
      */
126
-    public function relations_state_set($deviceid, $folderid, $synctime, $relations)
127
+    public function relations_state_set($device_key, $folderid, $synctime, $relations)
128
     {
129
         $synctime = $synctime->format('Y-m-d H:i:s');
130
         $rcube    = rcube::get_instance();
131
@@ -1926,24 +1928,25 @@
132
             $this->relations$folderid$synctime = $relations;
133
             $data = rcube_charset::clean(json_encode($relations));
134
 
135
-            $db->set_option('ignore_key_errors', true);
136
-            $db->query(
137
+            $result = $db->query(
138
                 "INSERT INTO `syncroton_relations_state`"
139
                 . " (`device_id`, `folder_id`, `synctime`, `data`)"
140
                 . " VALUES (?, ?, ?, ?)",
141
-                $deviceid,
142
+                $device_key,
143
                 $folderid,
144
                 $synctime,
145
                 $data
146
             );
147
-            $db->set_option('ignore_key_errors', false);
148
+            if ($err = $db->is_error($result)) {
149
+                throw new Exception("Failed to save relation: {$err}");
150
+            }
151
         }
152
     }
153
 
154
     /**
155
      * Get state of relation objects at specified point in time
156
      */
157
-    protected function relations_state_get($deviceid, $folderid, $synctime)
158
+    protected function relations_state_get($device_key, $folderid, $synctime)
159
     {
160
         $synctime = $synctime->format('Y-m-d H:i:s');
161
 
162
@@ -1959,7 +1962,7 @@
163
                 . " ORDER BY `synctime` DESC",
164
                 0,
165
                 1,
166
-                $deviceid,
167
+                $device_key,
168
                 $folderid,
169
                 $synctime
170
             );
171
@@ -1974,7 +1977,7 @@
172
             $db->query(
173
                 "DELETE FROM `syncroton_relations_state`"
174
                 . " WHERE `device_id` = ? AND `folder_id` = ? AND `synctime` <> ?",
175
-                $deviceid,
176
+                $device_key,
177
                 $folderid,
178
                 $synctime
179
             );
180
kolab-syncroton-2.4.2.tar.gz/lib/kolab_sync_storage_kolab4.php Changed
11
 
1
@@ -561,7 +561,8 @@
2
         // TODO: Subscribe shared DAV folders
3
     }
4
 
5
-    public function getExtraData($folderid, $deviceid) {
6
+    public function getExtraData($folderid, $deviceid)
7
+    {
8
         if (strpos($folderid, 'DAV:') === 0) {
9
             return null;
10
         }
11
kolab-syncroton-2.4.2.tar.gz/phpstan.neon Changed
16
 
1
@@ -3,14 +3,8 @@
2
         - phpstan.bootstrap.php
3
 
4
     excludePaths:
5
-        - vendor
6
         - lib/plugins
7
         - lib/ext/Roundcube
8
-        - lib/ext/Syncroton
9
-
10
-    ignoreErrors:
11
-        - |Access to an undefined property Syncroton_Model_.*|
12
-        - |Access to offset .* on an unknown class An.|
13
 
14
     paths:
15
         - lib
16
kolab-syncroton-2.4.2.tar.gz/tests/Sync/Sync/EmailTest.php Changed
19
 
1
@@ -302,7 +302,7 @@
2
 
3
         return 
4
             'syncKey' => $syncKey,
5
-            'serverId' => $serverId1
6
+            'serverId' => $serverId1,
7
         ;
8
     }
9
 
10
@@ -361,7 +361,7 @@
11
 
12
         return 
13
             'syncKey' => $syncKey,
14
-            'serverId' => $serverId
15
+            'serverId' => $serverId,
16
         ;
17
     }
18
 
19
kolab-syncroton.dsc Changed
10
 
1
@@ -2,7 +2,7 @@
2
 Source: kolab-syncroton
3
 Binary: kolab-syncroton
4
 Architecture: all
5
-Version: 1:2.4.2.16-1~kolab1
6
+Version: 1:2.4.2.18-1~kolab1
7
 Maintainer: Jeroen van Meeuwen <vanmeeuwen@kolabsys.com>
8
 Uploaders: Jeroen van Meeuwen <vanmeeuwen@kolabsys.com>
9
 Homepage: http://www.kolab.org/
10