[TASK] Fix coding guideline issues
authorXavier Perseguers <typo3@perseguers.ch>
Thu, 12 May 2011 12:14:19 +0000 (14:14 +0200)
committerXavier Perseguers <typo3@perseguers.ch>
Thu, 12 May 2011 12:14:19 +0000 (14:14 +0200)
There are a few coding guideline issues left in code. First is
using "else if" instead of "elseif", second is using "null" instead
of "NULL".

Change-Id: I438819e9fd1ecfee2fd88c6974b93bb10d9b23ba
Releases: 1.3, 1.2

typo3/sysext/dbal/class.ux_t3lib_db.php
typo3/sysext/dbal/class.ux_t3lib_sqlparser.php

index 6be1ef7..bb596dd 100644 (file)
@@ -1003,7 +1003,7 @@ class ux_t3lib_DB extends t3lib_DB {
                                        $mt = $this->sql_field_metatype($table, $k);
                                        if ($mt{0} == 'I') {
                                                $v = (int) $v;
-                                       } else if ($mt{0} == 'F') {
+                                       } elseif ($mt{0} == 'F') {
                                                $v = (double) $v;
                                        }
 
@@ -1115,7 +1115,7 @@ class ux_t3lib_DB extends t3lib_DB {
                                                $mt = $this->sql_field_metatype($table, $k);
                                                if ($mt{0} == 'I') {
                                                        $v = (int) $v;
-                                               } else if ($mt{0} == 'F') {
+                                               } elseif ($mt{0} == 'F') {
                                                        $v = (double) $v;
                                                }
                                                $nArr[] = $this->quoteFieldNames($k) . '=' . ((!in_array($k, $no_quote_fields)) ? $this->fullQuoteStr($v, $table) : $v);
@@ -2452,7 +2452,7 @@ class ux_t3lib_DB extends t3lib_DB {
         * @return      string          Returns the type of the specified field index
         */
        public function sql_field_type(&$res, $pointer) {
-               if ($res === null) {
+               if ($res === NULL) {
                        debug(array('no res in sql_field_type!'));
                        return 'text';
                }
index 768d9f2..f88b1ac 100644 (file)
@@ -662,13 +662,13 @@ class ux_t3lib_sqlparser extends t3lib_sqlparser {
                                                                                                }
                                                                                                $output .= ' (' . trim(implode(',', $valueBuffer)) . ')';
                                                                                        }
-                                                                               } else if (t3lib_div::inList('BETWEEN,NOT BETWEEN', $v['comparator'])) {
+                                                                               } elseif (t3lib_div::inList('BETWEEN,NOT BETWEEN', $v['comparator'])) {
                                                                                        $lbound = $v['values'][0];
                                                                                        $ubound = $v['values'][1];
                                                                                        $output .= ' ' . $lbound[1] . $this->compileAddslashes($lbound[0]) . $lbound[1];
                                                                                        $output .= ' AND ';
                                                                                        $output .= $ubound[1] . $this->compileAddslashes($ubound[0]) . $ubound[1];
-                                                                               } else if (isset($v['value']['operator'])) {
+                                                                               } elseif (isset($v['value']['operator'])) {
                                                                                        $values = array();
                                                                                        foreach ($v['value']['args'] as $fieldDef) {
                                                                                                $values[] = ($fieldDef['table'] ? $fieldDef['table'] . '.' : '') . $fieldDef['field'];