Completed
Push — master ( e01579...0b39e0 )
by Aimeos
08:57
created
lib/mwlib/tests/MW/Criteria/Expression/Combine/SQLTest.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 		);
59 59
 
60 60
 		$expr1 = array();
61
-		$expr1[] = new \Aimeos\MW\Criteria\Expression\Compare\SQL( $conn, '==', 'list', array('a', 'b', 'c') );
61
+		$expr1[] = new \Aimeos\MW\Criteria\Expression\Compare\SQL( $conn, '==', 'list', array( 'a', 'b', 'c' ) );
62 62
 		$expr1[] = new \Aimeos\MW\Criteria\Expression\Compare\SQL( $conn, '~=', 'string', 'value' );
63 63
 
64 64
 		$expr2 = array();
@@ -75,11 +75,11 @@  discard block
 block discarded – undo
75 75
 		$expected = " NOT ( ( list IN ('a','b','c') AND string LIKE '%value%' ESCAPE '_' ) OR ( float < 0.1 AND int > 10 ) )";
76 76
 		$this->assertEquals( $expected, $test->toString( $types ) );
77 77
 
78
-		$obj = new \Aimeos\MW\Criteria\Expression\Combine\SQL('&&', array());
79
-		$this->assertEquals('', $obj->toString($types));
78
+		$obj = new \Aimeos\MW\Criteria\Expression\Combine\SQL( '&&', array() );
79
+		$this->assertEquals( '', $obj->toString( $types ) );
80 80
 
81
-		$this->setExpectedException('\\Aimeos\\MW\\Common\\Exception');
82
-		new \Aimeos\MW\Criteria\Expression\Combine\SQL('', array());
81
+		$this->setExpectedException( '\\Aimeos\\MW\\Common\\Exception' );
82
+		new \Aimeos\MW\Criteria\Expression\Combine\SQL( '', array() );
83 83
 
84 84
 	}
85 85
 }
Please login to merge, or discard this patch.
lib/mwlib/src/MW/Criteria/Expression/Compare/SQL.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 	 */
65 65
 	protected function createTerm( $name, $type, $value )
66 66
 	{
67
-		$term = $name . ' ' . self::$operators[$this->getOperator()] . ' ' . $this->escape( $this->getOperator(), $type, $value );
67
+		$term = $name.' '.self::$operators[$this->getOperator()].' '.$this->escape( $this->getOperator(), $type, $value );
68 68
 
69 69
 		if( in_array( $this->getOperator(), array( '=~', '~=' ), true ) ) {
70 70
 			$term .= ' ESCAPE \'_\'';
@@ -85,9 +85,9 @@  discard block
 block discarded – undo
85 85
 		switch( $this->getOperator() )
86 86
 		{
87 87
 			case '==':
88
-				return $name . ' IS NULL';
88
+				return $name.' IS NULL';
89 89
 			case '!=':
90
-				return $name . ' IS NOT NULL';
90
+				return $name.' IS NOT NULL';
91 91
 			default:
92 92
 				throw new \Aimeos\MW\Common\Exception( sprintf( 'NULL value not allowed for operator "%1$s"', $this->getOperator() ) );
93 93
 		}
@@ -106,9 +106,9 @@  discard block
 block discarded – undo
106 106
 		switch( $this->getOperator() )
107 107
 		{
108 108
 			case '==':
109
-				return $name . ' IN ' . $this->createValueList( $type, (array) $this->getValue() );
109
+				return $name.' IN '.$this->createValueList( $type, (array) $this->getValue() );
110 110
 			case '!=':
111
-				return $name . ' NOT IN ' . $this->createValueList( $type, (array) $this->getValue() );
111
+				return $name.' NOT IN '.$this->createValueList( $type, (array) $this->getValue() );
112 112
 			default:
113 113
 				$terms = array();
114 114
 
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 					$terms[] = $this->createTerm( $name, $type, $val );
117 117
 				}
118 118
 
119
-				return '(' . implode( ' OR ', $terms ) . ')';
119
+				return '('.implode( ' OR ', $terms ).')';
120 120
 		}
121 121
 	}
122 122
 
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 			$values[$key] = $this->escape( $operator, $type, $value );
141 141
 		}
142 142
 
143
-		return '(' . implode(',', $values) . ')';
143
+		return '('.implode( ',', $values ).')';
144 144
 	}
145 145
 
146 146
 
@@ -168,10 +168,10 @@  discard block
 block discarded – undo
168 168
 				if( in_array( $operator, array( '~=', '=~' ), true ) )
169 169
 				{
170 170
 					$value = str_replace( array( '%', '_', '[' ), array( '_%', '__', '_[' ), $this->conn->escape( $value ) );
171
-					$value = '\'%' . $value . '%\''; break;
171
+					$value = '\'%'.$value.'%\''; break;
172 172
 				}
173 173
 			default:
174
-				$value = '\'' . $this->conn->escape( $value ) . '\'';
174
+				$value = '\''.$this->conn->escape( $value ).'\'';
175 175
 		}
176 176
 
177 177
 		return $value;
Please login to merge, or discard this patch.
lib/mwlib/src/MW/DB/Statement/Base.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -132,9 +132,9 @@
 block discarded – undo
132 132
 					&& ( $count += substr_count( $pr, '\'' ) ) % 2 !== 0 )
133 133
 				{
134 134
 					if( ( $part = next( $parts ) ) === false ) {
135
-						throw new \Aimeos\MW\DB\Exception( 'Number of apostrophes don\'t match: ' . $sql );
135
+						throw new \Aimeos\MW\DB\Exception( 'Number of apostrophes don\'t match: '.$sql );
136 136
 					}
137
-					$temp .= '?' . $part;
137
+					$temp .= '?'.$part;
138 138
 				}
139 139
 				$result[] = $temp;
140 140
 			}
Please login to merge, or discard this patch.