Remove unsused code/variables.
authorJan Schneider <jan@horde.org>
Mon, 15 Nov 2010 15:40:50 +0000 (16:40 +0100)
committerJan Schneider <jan@horde.org>
Mon, 15 Nov 2010 22:22:13 +0000 (23:22 +0100)
framework/Date/lib/Horde/Date.php
framework/Date/lib/Horde/Date/Repeater/DayPortion.php
framework/Date/lib/Horde/Date/Repeater/Time.php
framework/Ldap/lib/Horde/Ldap.php
framework/Ldap/lib/Horde/Ldap/Entry.php
framework/Ldap/lib/Horde/Ldap/Filter.php
framework/Ldap/lib/Horde/Ldap/Ldif.php
framework/Ldap/lib/Horde/Ldap/Search.php
framework/Ldap/lib/Horde/Ldap/Util.php

index 147ec45..fe06b6d 100644 (file)
@@ -194,7 +194,6 @@ class Horde_Date
         }
 
         if (func_num_args() > 2) {
-            $args = func_get_args();
             // Handle args in order: year month day hour min sec tz
             $this->_initializeFromArgs(func_get_args());
             return;
index f9bdd65..19b490c 100644 (file)
@@ -51,8 +51,6 @@ class Horde_Date_Repeater_DayPortion extends Horde_Date_Repeater
     {
         parent::next($pointer);
 
-        $fullDay = 60 * 60 * 24;
-
         if (!$this->currentSpan) {
             $nowSeconds = $this->now->hour * 3600 + $this->now->min * 60 + $this->now->sec;
             if ($nowSeconds < $this->range[0]) {
index a90cd1f..21e37f5 100644 (file)
@@ -5,7 +5,7 @@ class Horde_Date_Repeater_Time extends Horde_Date_Repeater
     public $type;
     public $ambiguous;
 
-    public function __construct($time, $options = array())
+    public function __construct($time)
     {
         $t = str_replace(':', '', $time);
 
index ec2f5b0..bfbde3c 100644 (file)
@@ -699,10 +699,7 @@ class Horde_Ldap
                 } catch (Exception $e) {
                     /* We have a failure.  What kind?  We may be able to
                      * reconnect and try again. */
-                    $error_code = $e->getCode();
-                    $error_name = $this->errorName($error_code);
-
-                    if ($this->errorName($error_code) != 'LDAP_OPERATIONS_ERROR' ||
+                    if ($this->errorName($e->getCode()) != 'LDAP_OPERATIONS_ERROR' ||
                         !$this->_config['auto_reconnect']) {
                         /* Errors other than the above catched are just passed
                          * back to the user so he may react upon them. */
@@ -1005,14 +1002,7 @@ class Horde_Ldap
 
         /* Make dn relative to parent. */
         $base = Horde_Ldap_Util::explodeDN($dn, array('casefold' => 'none', 'reverse' => false, 'onlyvalues' => false));
-
         $entry_rdn = array_shift($base);
-        if (is_array($entry_rdn)) {
-            /* Maybe the dn consist of a multivalued RDN. We must
-             * build the dn in this case because the $entry_rdn is an
-             * array. */
-            $filter_dn = Horde_Ldap_Util::canonicalDN($entry_rdn);
-        }
         $base = Horde_Ldap_Util::canonicalDN($base);
 
         $result = @ldap_list($this->_link, $base, $entry_rdn, array(), 1, 1);
index 75dda34..f2dcd5d 100644 (file)
@@ -350,7 +350,7 @@ class Horde_Ldap_Entry
     public function getValues()
     {
         $attrs = array();
-        foreach ($this->_attributes as $attr => $value) {
+        foreach (array_keys($this->_attributes) as $attr) {
             $attrs[$attr] = $this->getValue($attr);
         }
         return $attrs;
@@ -645,7 +645,7 @@ class Horde_Ldap_Entry
 
         /* New entry. */
         if ($this->_new) {
-            $msg = $ldap->add($this);
+            $ldap->add($this);
             $this->_new                = false;
             $this->_changes['add']     = array();
             $this->_changes['delete']  = array();
index f3666d6..8b2ff66 100644 (file)
@@ -390,7 +390,6 @@ class Horde_Ldap_Filter
         // operator.
         $subfilters_o = array();
         foreach ($subfilters as $s_s) {
-            $o = self::parse($s_s);
             array_push($subfilters_o, self::parse($s_s));
         }
         if (count($subfilters_o) == 1) {
index 3c1740d..0321f63 100644 (file)
@@ -307,7 +307,7 @@ class Horde_Ldap_Ldif
         } elseif ($entry->willBeMoved()) {
             $this->_writeLine('changetype: modrdn');
             $olddn     = Horde_Ldap_Util::explodeDN($entry->currentDN(), array('casefold' => 'none'));
-            $oldrdn    = array_shift($olddn);
+            array_shift($olddn);
             $oldparent = implode(',', $olddn);
             $newdn     = Horde_Ldap_Util::explodeDN($entry->dn(), array('casefold' => 'none'));
             $rdn       = array_shift($newdn);
@@ -449,7 +449,7 @@ class Horde_Ldap_Ldif
         }
 
         // Free variables.
-        foreach (get_object_vars($this) as $name => $value) {
+        foreach (array_keys(get_object_vars($this)) as $name) {
             unset($this->$name);
         }
     }
index ced3c6a..9e9a727 100644 (file)
@@ -321,7 +321,7 @@ class Horde_Ldap_Search implements Iterator
     {
         $return = array();
         $sorted = $this->sortedAsArray($attrs, $order);
-        foreach ($sorted as $key => $row) {
+        foreach ($sorted as $row) {
             $entry = $this->_ldap->getEntry($row['dn'], $this->searchedAttributes());
             array_push($return, $entry);
         }
index 4e17206..65da557 100644 (file)
@@ -114,7 +114,6 @@ class Horde_Ldap_Util
 
                     if ($options['onlyvalues']) {
                         preg_match('/(.+?)(?<!\\\\)=(.+)/', $subrdn_v, $matches);
-                        $rdn_ocl         = $matches[1];
                         $rdn_val         = $matches[2];
                         $unescaped       = self::unescapeDNValue($rdn_val);
                         $rdns[$subrdn_k] = $unescaped[0];
@@ -137,7 +136,6 @@ class Horde_Ldap_Util
 
                 if ($options['onlyvalues']) {
                     preg_match('/(.+?)(?<!\\\\)=(.+)/', $value, $matches);
-                    $dn_ocl         = $matches[1];
                     $dn_val         = $matches[2];
                     $unescaped      = self::unescapeDNValue($dn_val);
                     $dn_array[$key] = $unescaped[0];