svn: /pear/pear-core/trunk/ PEAR.php

[email protected] (Helgi Þormar Þorbjörnsson)
Newsgroups php.pear.cvs,php.pear.core
Message-ID <[email protected]>
dufuz                                    Sat, 08 May 2010 22:32:52 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=299159

Log:
Readability on the code.

Changed paths:
    U   pear/pear-core/trunk/PEAR.php

Modified: pear/pear-core/trunk/PEAR.php
===================================================================
--- pear/pear-core/trunk/PEAR.php	2010-05-08 21:20:24 UTC (rev 299158)
+++ pear/pear-core/trunk/PEAR.php	2010-05-08 22:32:52 UTC (rev 299159)
@@ -486,10 +486,16 @@
             $message     = $message->getMessage();
         }

-        if (isset($this) && isset($this->_expected_errors) && sizeof($this->_expected_errors) > 0 && sizeof($exp = end($this->_expected_errors))) {
+        if (
+            isset($this) &&
+            isset($this->_expected_errors) &&
+            count($this->_expected_errors) > 0 &&
+            count($exp = end($this->_expected_errors))
+        ) {
             if ($exp[0] == "*" ||
                 (is_int(reset($exp)) && in_array($code, $exp)) ||
-                (is_string(reset($exp)) && in_array($message, $exp))) {
+                (is_string(reset($exp)) && in_array($message, $exp))
+            ) {
                 $mode = PEAR_ERROR_RETURN;
             }
         }
@@ -559,7 +565,7 @@

     function staticPushErrorHandling($mode, $options = null)
     {
-        $stack = &$GLOBALS['_PEAR_error_handler_stack'];
+        $stack       = &$GLOBALS['_PEAR_error_handler_stack'];
         $def_mode    = &$GLOBALS['_PEAR_default_error_mode'];
         $def_options = &$GLOBALS['_PEAR_default_error_options'];
         $stack[] = array($def_mode, $def_options);
@@ -759,7 +765,11 @@
     }

     // Now call the shutdown functions
-    if (isset($GLOBALS['_PEAR_shutdown_funcs']) AND is_array($GLOBALS['_PEAR_shutdown_funcs']) AND !empty($GLOBALS['_PEAR_shutdown_funcs'])) {
+    if (
+        isset($GLOBALS['_PEAR_shutdown_funcs']) &&
+        is_array($GLOBALS['_PEAR_shutdown_funcs']) &&
+        !empty($GLOBALS['_PEAR_shutdown_funcs'])
+    ) {
         foreach ($GLOBALS['_PEAR_shutdown_funcs'] as $value) {
             call_user_func_array($value[0], $value[1]);
         }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.