Merge pull request #22561 from mattwire/jobapi3
[civicrm-core.git] / CRM / Utils / SQL / Insert.php
index c06bd601c1bf621e5b2502f2733213d8d2021671..96970e23c5f4bf0bfb4e9c514dbd907447ebcff6 100644 (file)
@@ -36,6 +36,7 @@ class CRM_Utils_SQL_Insert {
 
   /**
    * Array<string> list of column names
+   * @var array
    */
   private $columns;
 
@@ -62,10 +63,11 @@ class CRM_Utils_SQL_Insert {
     $row = [];
     foreach ((array) $dao as $key => $value) {
       if ($value === 'null') {
-        $value = NULL; // Blerg!!!
+        // Blerg!!!
+        $value = NULL;
       }
       // Skip '_foobar' and '{\u00}*_options' and 'N'.
-      if (preg_match('/[a-zA-Z]/', $key{0}) && $key !== 'N') {
+      if (preg_match('/[a-zA-Z]/', $key[0]) && $key !== 'N') {
         $row[$key] = $value;
       }
     }
@@ -156,7 +158,7 @@ class CRM_Utils_SQL_Insert {
   /**
    * Escape string.
    *
-   * @param string|NULL $value
+   * @param string|null $value
    *
    * @return string
    *   SQL expression, e.g. "it\'s great" (with-quotes) or NULL (without-quotes)