logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ihabu...@apache.org
Subject svn commit: r1163177 - /logging/log4php/trunk/src/main/php/Logger.php
Date Tue, 30 Aug 2011 11:41:45 GMT
Author: ihabunek
Date: Tue Aug 30 11:41:45 2011
New Revision: 1163177

URL: http://svn.apache.org/viewvc?rev=1163177&view=rev
Log:
Logger: Replaced a for loop with foreach to make code more readable.

Modified:
    logging/log4php/trunk/src/main/php/Logger.php

Modified: logging/log4php/trunk/src/main/php/Logger.php
URL: http://svn.apache.org/viewvc/logging/log4php/trunk/src/main/php/Logger.php?rev=1163177&r1=1163176&r2=1163177&view=diff
==============================================================================
--- logging/log4php/trunk/src/main/php/Logger.php (original)
+++ logging/log4php/trunk/src/main/php/Logger.php Tue Aug 30 11:41:45 2011
@@ -387,10 +387,8 @@ class Logger {
 	 * Remove all previously added appenders from the Logger.
 	 */
 	public function removeAllAppenders() {
-		$appenderNames = array_keys($this->appenders);
-		$enumAppenders = count($appenderNames);
-		for($i = 0; $i < $enumAppenders; $i++) {
-			$this->removeAppender($appenderNames[$i]); 
+		foreach($this->appenders as $name => $appender) {
+			$this->removeAppender($name);
 		}
 	} 
 			



Mime
View raw message