No need for these variables to be member variables.
authorMichael M Slusarz <slusarz@curecanti.org>
Mon, 6 Sep 2010 22:08:12 +0000 (16:08 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Tue, 7 Sep 2010 01:16:47 +0000 (19:16 -0600)
Saves a bit of space in a serialized representation.

framework/Imap_Client/lib/Horde/Imap/Client/Search/Query.php

index 60de6d0..31ac8dc 100644 (file)
@@ -35,24 +35,6 @@ class Horde_Imap_Client_Search_Query
     protected $_charset = null;
 
     /**
-     * The list of defined system flags (see RFC 3501 [2.3.2]).
-     *
-     * @var array
-     */
-    protected $_systemflags = array(
-        'ANSWERED', 'DELETED', 'DRAFT', 'FLAGGED', 'RECENT', 'SEEN'
-    );
-
-    /**
-     * The list of 'system' headers that have a specific search query.
-     *
-     * @var array
-     */
-    protected $_systemheaders = array(
-        'BCC', 'CC', 'FROM', 'SUBJECT', 'TO'
-    );
-
-    /**
      * The list of search params.
      *
      * @var array
@@ -152,6 +134,12 @@ class Horde_Imap_Client_Search_Query
         }
 
         if (!empty($ptr['header'])) {
+            /* The list of 'system' headers that have a specific search
+             * query. */
+            $systemheaders = array(
+                'BCC', 'CC', 'FROM', 'SUBJECT', 'TO'
+            );
+
             foreach ($ptr['header'] as $val) {
                 if ($val['not']) {
                     $cmds[] = 'NOT';
@@ -159,7 +147,7 @@ class Horde_Imap_Client_Search_Query
                     $imap4 = true;
                 }
 
-                if (in_array($val['header'], $this->_systemheaders)) {
+                if (in_array($val['header'], $systemheaders)) {
                     $cmds[] = $val['header'];
                 } else {
                     // HEADER searches were not in IMAP2
@@ -345,9 +333,15 @@ class Horde_Imap_Client_Search_Query
         if (!isset($this->_search['flag'])) {
             $this->_search['flag'] = array();
         }
+
+        /* The list of defined system flags (see RFC 3501 [2.3.2]). */
+        $systemflags = array(
+            'ANSWERED', 'DELETED', 'DRAFT', 'FLAGGED', 'RECENT', 'SEEN'
+        );
+
         $this->_search['flag'][$name] = array(
             'set' => $set,
-            'type' => in_array($name, $this->_systemflags) ? 'flag' : 'keyword'
+            'type' => in_array($name, $systemflags) ? 'flag' : 'keyword'
         );
     }