@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function __construct($subject) |
64 | 64 | { |
65 | - $this->subject = (string)$subject; |
|
65 | + $this->subject = (string) $subject; |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | /** |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | | ([^\'"\\\\]+) # or $2: an unquoted chunk (no escapes). |
118 | 118 | /sx'; |
119 | 119 | |
120 | - return (string)preg_replace_callback($re_parse, array($this, '_str_replace_outside_quotes_cb'), $this->subject); |
|
120 | + return (string) preg_replace_callback($re_parse, array($this, '_str_replace_outside_quotes_cb'), $this->subject); |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | /** |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | } |
140 | 140 | |
141 | 141 | // Process only unquoted chunks (in group $2). |
142 | - return (string)preg_replace('/' . preg_quote($this->search, '/') . '/', $this->replace, $matches[2]); |
|
142 | + return (string) preg_replace('/'.preg_quote($this->search, '/').'/', $this->replace, $matches[2]); |
|
143 | 143 | } |
144 | 144 | |
145 | 145 | } |
@@ -47,7 +47,7 @@ |
||
47 | 47 | $contact->save(); |
48 | 48 | |
49 | 49 | // Redirect to self. |
50 | - header('Location: ' . basename(__FILE__)); |
|
50 | + header('Location: '.basename(__FILE__)); |
|
51 | 51 | exit; |
52 | 52 | } |
53 | 53 |
@@ -197,7 +197,7 @@ |
||
197 | 197 | if (method_exists($model, $method)) { |
198 | 198 | call_user_func_array(array($model, $method), $params); |
199 | 199 | } else { |
200 | - throw new IdiormMethodMissingException("Method $method() does not exist in class " . get_class($this)); |
|
200 | + throw new IdiormMethodMissingException("Method $method() does not exist in class ".get_class($this)); |
|
201 | 201 | } |
202 | 202 | } |
203 | 203 |
@@ -983,10 +983,10 @@ discard block |
||
983 | 983 | if ($result !== false && isset($result->$alias)) { |
984 | 984 | if (!is_numeric($result->$alias)) { |
985 | 985 | $return_value = $result->$alias; |
986 | - } elseif ((int)$result->$alias == (float)$result->$alias) { |
|
987 | - $return_value = (int)$result->$alias; |
|
986 | + } elseif ((int) $result->$alias == (float) $result->$alias) { |
|
987 | + $return_value = (int) $result->$alias; |
|
988 | 988 | } else { |
989 | - $return_value = (float)$result->$alias; |
|
989 | + $return_value = (float) $result->$alias; |
|
990 | 990 | } |
991 | 991 | } |
992 | 992 | |
@@ -1071,7 +1071,7 @@ discard block |
||
1071 | 1071 | protected function _add_result_column($expr, $alias = null) |
1072 | 1072 | { |
1073 | 1073 | if (null !== $alias) { |
1074 | - $expr .= ' AS ' . $this->_quote_identifier($alias); |
|
1074 | + $expr .= ' AS '.$this->_quote_identifier($alias); |
|
1075 | 1075 | } |
1076 | 1076 | |
1077 | 1077 | if ($this->_using_default_result_columns) { |
@@ -1682,7 +1682,7 @@ discard block |
||
1682 | 1682 | |
1683 | 1683 | $key = "{$table}.{$key}"; |
1684 | 1684 | } |
1685 | - $key = 'DATE(' . $result->_quote_identifier($key) . ')'; |
|
1685 | + $key = 'DATE('.$result->_quote_identifier($key).')'; |
|
1686 | 1686 | $result = $result->_add_condition($type, "{$key} {$separator} ?", $val); |
1687 | 1687 | } |
1688 | 1688 | |
@@ -1864,7 +1864,7 @@ discard block |
||
1864 | 1864 | |
1865 | 1865 | $query[] = $this->_quote_identifier($key); |
1866 | 1866 | $data[] = $subItem; |
1867 | - $query[] = $op . ' ?'; |
|
1867 | + $query[] = $op.' ?'; |
|
1868 | 1868 | } |
1869 | 1869 | } |
1870 | 1870 | $query[] = '))'; |
@@ -2503,13 +2503,13 @@ discard block |
||
2503 | 2503 | } |
2504 | 2504 | |
2505 | 2505 | if ($this->_distinct) { |
2506 | - $result_columns = 'DISTINCT ' . $result_columns; |
|
2506 | + $result_columns = 'DISTINCT '.$result_columns; |
|
2507 | 2507 | } |
2508 | 2508 | |
2509 | - $fragment .= "{$result_columns} FROM " . $this->_quote_identifier($this->_table_name); |
|
2509 | + $fragment .= "{$result_columns} FROM ".$this->_quote_identifier($this->_table_name); |
|
2510 | 2510 | |
2511 | 2511 | if (null !== $this->_table_alias) { |
2512 | - $fragment .= ' ' . $this->_quote_identifier($this->_table_alias); |
|
2512 | + $fragment .= ' '.$this->_quote_identifier($this->_table_alias); |
|
2513 | 2513 | } |
2514 | 2514 | |
2515 | 2515 | return $fragment; |
@@ -2560,7 +2560,7 @@ discard block |
||
2560 | 2560 | return ''; |
2561 | 2561 | } |
2562 | 2562 | |
2563 | - return 'GROUP BY ' . implode(', ', $this->_group_by); |
|
2563 | + return 'GROUP BY '.implode(', ', $this->_group_by); |
|
2564 | 2564 | } |
2565 | 2565 | |
2566 | 2566 | /** |
@@ -2585,7 +2585,7 @@ discard block |
||
2585 | 2585 | $this->_values = array_merge($this->_values, $condition[static::CONDITION_VALUES]); |
2586 | 2586 | } |
2587 | 2587 | |
2588 | - return strtoupper($type) . ' ' . implode(' AND ', $conditions); |
|
2588 | + return strtoupper($type).' '.implode(' AND ', $conditions); |
|
2589 | 2589 | } |
2590 | 2590 | |
2591 | 2591 | /** |
@@ -2601,7 +2601,7 @@ discard block |
||
2601 | 2601 | |
2602 | 2602 | $db = static::get_db($this->_connection_name); |
2603 | 2603 | |
2604 | - return 'ORDER BY ' . trim($db->quote(implode(', ', $this->_order_by)), "'"); |
|
2604 | + return 'ORDER BY '.trim($db->quote(implode(', ', $this->_order_by)), "'"); |
|
2605 | 2605 | } |
2606 | 2606 | |
2607 | 2607 | /** |
@@ -2625,7 +2625,7 @@ discard block |
||
2625 | 2625 | $fragment = 'LIMIT'; |
2626 | 2626 | } |
2627 | 2627 | |
2628 | - $this->_limit = (int)$this->_limit; |
|
2628 | + $this->_limit = (int) $this->_limit; |
|
2629 | 2629 | |
2630 | 2630 | $fragment .= " {$this->_limit}"; |
2631 | 2631 | } |
@@ -2646,9 +2646,9 @@ discard block |
||
2646 | 2646 | $clause = 'TO'; |
2647 | 2647 | } |
2648 | 2648 | |
2649 | - $this->_offset = (int)$this->_offset; |
|
2649 | + $this->_offset = (int) $this->_offset; |
|
2650 | 2650 | |
2651 | - return "$clause " . $this->_offset; |
|
2651 | + return "$clause ".$this->_offset; |
|
2652 | 2652 | } |
2653 | 2653 | |
2654 | 2654 | return ''; |
@@ -2734,7 +2734,7 @@ discard block |
||
2734 | 2734 | $quote_character = static::$_config[$this->_connection_name]['identifier_quote_character']; |
2735 | 2735 | |
2736 | 2736 | // double up any identifier quotes to escape them |
2737 | - return $quote_character . str_replace($quote_character, $quote_character . $quote_character, $part) . $quote_character; |
|
2737 | + return $quote_character.str_replace($quote_character, $quote_character.$quote_character, $part).$quote_character; |
|
2738 | 2738 | } |
2739 | 2739 | |
2740 | 2740 | /** |
@@ -2765,7 +2765,7 @@ discard block |
||
2765 | 2765 | ); |
2766 | 2766 | } |
2767 | 2767 | $parameter_string = implode(',', $parameters); |
2768 | - $key = $query . ':' . $parameter_string; |
|
2768 | + $key = $query.':'.$parameter_string; |
|
2769 | 2769 | |
2770 | 2770 | return sha1($key); |
2771 | 2771 | } |
@@ -3245,14 +3245,14 @@ discard block |
||
3245 | 3245 | $query[] = 'INSERT INTO'; |
3246 | 3246 | $query[] = $this->_quote_identifier($this->_table_name); |
3247 | 3247 | $field_list = array_map(array($this, '_quote_identifier'), array_keys($this->_dirty_fields)); |
3248 | - $query[] = '(' . implode(', ', $field_list) . ')'; |
|
3248 | + $query[] = '('.implode(', ', $field_list).')'; |
|
3249 | 3249 | $query[] = 'VALUES'; |
3250 | 3250 | |
3251 | 3251 | $placeholders = $this->_create_placeholders($this->_dirty_fields); |
3252 | 3252 | $query[] = "({$placeholders})"; |
3253 | 3253 | |
3254 | 3254 | if (static::get_db($this->_connection_name)->getAttribute(\PDO::ATTR_DRIVER_NAME) == 'pgsql') { |
3255 | - $query[] = 'RETURNING ' . $this->_quote_identifier($this->_get_id_column_name()); |
|
3255 | + $query[] = 'RETURNING '.$this->_quote_identifier($this->_get_id_column_name()); |
|
3256 | 3256 | } |
3257 | 3257 | |
3258 | 3258 | return implode(' ', $query); |
@@ -3273,8 +3273,7 @@ discard block |
||
3273 | 3273 | |
3274 | 3274 | return static::_execute( |
3275 | 3275 | implode(' ', $query), is_array($this->id(true)) ? |
3276 | - array_values($this->id(true)) : |
|
3277 | - array($this->id(true)), $this->_connection_name |
|
3276 | + array_values($this->id(true)) : array($this->id(true)), $this->_connection_name |
|
3278 | 3277 | ); |
3279 | 3278 | } |
3280 | 3279 | |
@@ -3407,7 +3406,7 @@ discard block |
||
3407 | 3406 | if (method_exists($this, $method)) { |
3408 | 3407 | return call_user_func_array(array($this, $method), $arguments); |
3409 | 3408 | } else { |
3410 | - throw new IdiormMethodMissingException("Method $name() does not exist in class " . get_class($this)); |
|
3409 | + throw new IdiormMethodMissingException("Method $name() does not exist in class ".get_class($this)); |
|
3411 | 3410 | } |
3412 | 3411 | } |
3413 | 3412 |
@@ -1105,7 +1105,7 @@ discard block |
||
1105 | 1105 | * the alias to return the column as. |
1106 | 1106 | * |
1107 | 1107 | * @param string $column |
1108 | - * @param mixed $alias |
|
1108 | + * @param null|string $alias |
|
1109 | 1109 | * |
1110 | 1110 | * @return $this |
1111 | 1111 | */ |
@@ -1122,7 +1122,7 @@ discard block |
||
1122 | 1122 | * the alias to return the column as. |
1123 | 1123 | * |
1124 | 1124 | * @param string $expr |
1125 | - * @param mixed $alias |
|
1125 | + * @param string|null $alias |
|
1126 | 1126 | * |
1127 | 1127 | * @return $this |
1128 | 1128 | */ |
@@ -1440,7 +1440,7 @@ discard block |
||
1440 | 1440 | * Internal method to add a HAVING condition to the query |
1441 | 1441 | */ |
1442 | 1442 | /** |
1443 | - * @param string|array $column_name |
|
1443 | + * @param string $column_name |
|
1444 | 1444 | * @param string $separator |
1445 | 1445 | * @param mixed $value |
1446 | 1446 | * |
@@ -1455,7 +1455,7 @@ discard block |
||
1455 | 1455 | * Internal method to add a HAVING clause with multiple values (like IN and NOT IN) |
1456 | 1456 | */ |
1457 | 1457 | /** |
1458 | - * @param string|array $column_name |
|
1458 | + * @param string $column_name |
|
1459 | 1459 | * @param string $separator |
1460 | 1460 | * @param mixed $values |
1461 | 1461 | * |
@@ -1482,7 +1482,7 @@ discard block |
||
1482 | 1482 | /** |
1483 | 1483 | * Internal method to add a HAVING clause with no parameters(like IS NULL and IS NOT NULL) |
1484 | 1484 | * |
1485 | - * @param string|array $column_name |
|
1485 | + * @param string $column_name |
|
1486 | 1486 | * @param string $operator |
1487 | 1487 | * |
1488 | 1488 | * @return $this |
@@ -1520,7 +1520,7 @@ discard block |
||
1520 | 1520 | /** |
1521 | 1521 | * Internal method to add a WHERE condition to the query |
1522 | 1522 | * |
1523 | - * @param string|array $column_name |
|
1523 | + * @param string $column_name |
|
1524 | 1524 | * @param string $separator |
1525 | 1525 | * @param mixed $value |
1526 | 1526 | * |
@@ -1534,7 +1534,7 @@ discard block |
||
1534 | 1534 | /** |
1535 | 1535 | * Add a WHERE clause with multiple values (like IN and NOT IN) |
1536 | 1536 | * |
1537 | - * @param string|array $column_name |
|
1537 | + * @param string $column_name |
|
1538 | 1538 | * @param string $separator |
1539 | 1539 | * @param mixed $values |
1540 | 1540 | * |
@@ -1561,7 +1561,7 @@ discard block |
||
1561 | 1561 | /** |
1562 | 1562 | * Add a WHERE clause with no parameters(like IS NULL and IS NOT NULL) |
1563 | 1563 | * |
1564 | - * @param string|array $column_name |
|
1564 | + * @param string $column_name |
|
1565 | 1565 | * @param string $operator |
1566 | 1566 | * |
1567 | 1567 | * @return $this |
@@ -1660,7 +1660,7 @@ discard block |
||
1660 | 1660 | * If column_name is an associative array, it will add a condition for each column |
1661 | 1661 | * |
1662 | 1662 | * @param string $type |
1663 | - * @param string|array $column_name |
|
1663 | + * @param string $column_name |
|
1664 | 1664 | * @param string $separator |
1665 | 1665 | * @param string|int $value |
1666 | 1666 | * |
@@ -1725,7 +1725,7 @@ discard block |
||
1725 | 1725 | * |
1726 | 1726 | * @param mixed $value |
1727 | 1727 | * |
1728 | - * @return array |
|
1728 | + * @return string |
|
1729 | 1729 | */ |
1730 | 1730 | protected function _get_compound_id_column_values($value) |
1731 | 1731 | { |
@@ -2659,7 +2659,7 @@ discard block |
||
2659 | 2659 | * only adds the pieces if they are not empty. |
2660 | 2660 | * |
2661 | 2661 | * @param string $glue |
2662 | - * @param array $pieces |
|
2662 | + * @param string[] $pieces |
|
2663 | 2663 | * |
2664 | 2664 | * @return string |
2665 | 2665 | */ |
@@ -2745,7 +2745,7 @@ discard block |
||
2745 | 2745 | * @param null|string $table_name |
2746 | 2746 | * @param string $connection_name |
2747 | 2747 | * |
2748 | - * @return mixed|string |
|
2748 | + * @return string |
|
2749 | 2749 | */ |
2750 | 2750 | protected static function _create_cache_key($query, $parameters, $table_name = null, $connection_name = self::DEFAULT_CONNECTION) |
2751 | 2751 | { |