@@ -100,8 +100,8 @@ discard block |
||
100 | 100 | $this->assertEquals( 'error', $row['message'] ); |
101 | 101 | |
102 | 102 | |
103 | - $this->setExpectedException('\\Aimeos\\MW\\Logger\\Exception'); |
|
104 | - $this->object->log( 'wrong log level', -1); |
|
103 | + $this->setExpectedException( '\\Aimeos\\MW\\Logger\\Exception' ); |
|
104 | + $this->object->log( 'wrong log level', -1 ); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | $conn = self::$dbm->acquire(); |
111 | 111 | $conn->create( 'DELETE FROM "mw_log_test"' )->execute()->finish(); |
112 | 112 | |
113 | - $this->object->log( array ( 'scalar', 'errortest' ) ); |
|
113 | + $this->object->log( array( 'scalar', 'errortest' ) ); |
|
114 | 114 | |
115 | 115 | $result = $conn->create( 'SELECT * FROM "mw_log_test"' )->execute(); |
116 | 116 |
@@ -41,7 +41,7 @@ |
||
41 | 41 | $this->value = $value; |
42 | 42 | |
43 | 43 | if( $value != '' ) { |
44 | - $this->formfield = '<input class="csrf-token" type="hidden" name="' . $this->name . '" value="' . $this->value . '" />'; |
|
44 | + $this->formfield = '<input class="csrf-token" type="hidden" name="'.$this->name.'" value="'.$this->value.'" />'; |
|
45 | 45 | } |
46 | 46 | } |
47 | 47 |
@@ -87,7 +87,7 @@ |
||
87 | 87 | */ |
88 | 88 | public function add( $data ) |
89 | 89 | { |
90 | - if( fwrite( $this->fh, $data . $this->lineend ) === false ) { |
|
90 | + if( fwrite( $this->fh, $data.$this->lineend ) === false ) { |
|
91 | 91 | throw new \Aimeos\MW\Container\Exception( sprintf( 'Unable to add content to file "%1$s"', $this->getName() ) ); |
92 | 92 | } |
93 | 93 | } |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | return new \Aimeos\MW\Convert\Compose( $list ); |
39 | 39 | } |
40 | 40 | |
41 | - return self::createObject( $keys );; |
|
41 | + return self::createObject( $keys ); ; |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | |
@@ -56,19 +56,19 @@ discard block |
||
56 | 56 | { |
57 | 57 | if( ctype_alnum( $part ) === false ) |
58 | 58 | { |
59 | - $classname = is_string( $key ) ? '\\Aimeos\\MW\\Convert\\' . $key : '<not a string>'; |
|
59 | + $classname = is_string( $key ) ? '\\Aimeos\\MW\\Convert\\'.$key : '<not a string>'; |
|
60 | 60 | throw new \Aimeos\MW\Convert\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) ); |
61 | 61 | } |
62 | 62 | } |
63 | 63 | |
64 | 64 | $iface = '\\Aimeos\\MW\\Convert\\Iface'; |
65 | - $classname = '\\Aimeos\\MW\\Convert\\' . $key; |
|
65 | + $classname = '\\Aimeos\\MW\\Convert\\'.$key; |
|
66 | 66 | |
67 | 67 | if( class_exists( $classname ) === false ) { |
68 | 68 | throw new \Aimeos\MW\Convert\Exception( sprintf( 'Class "%1$s" not available', $classname ) ); |
69 | 69 | } |
70 | 70 | |
71 | - $object = new $classname(); |
|
71 | + $object = new $classname(); |
|
72 | 72 | |
73 | 73 | if( !( $object instanceof $iface ) ) { |
74 | 74 | throw new \Aimeos\MW\Convert\Exception( sprintf( 'Class "%1$s" does not implement interface "%2$s"', $classname, $iface ) ); |
@@ -24,11 +24,11 @@ |
||
24 | 24 | |
25 | 25 | |
26 | 26 | /** |
27 | - * Includes config files using a simple caching. |
|
28 | - * |
|
29 | - * @param string $file Path and file name of a config file |
|
30 | - * @return array Value of the requested config file |
|
31 | - **/ |
|
27 | + * Includes config files using a simple caching. |
|
28 | + * |
|
29 | + * @param string $file Path and file name of a config file |
|
30 | + * @return array Value of the requested config file |
|
31 | + **/ |
|
32 | 32 | protected function includeFile( $file ) |
33 | 33 | { |
34 | 34 | if( !isset( $this->includeCache[$file] ) ) { |
@@ -90,7 +90,7 @@ |
||
90 | 90 | public function __destruct() |
91 | 91 | { |
92 | 92 | if( fwrite( $this->file, serialize( $this->config ) ) === false ) { |
93 | - echo 'Unable to write collected configuration to file' . PHP_EOL; |
|
93 | + echo 'Unable to write collected configuration to file'.PHP_EOL; |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | fclose( $this->file ); |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | $result = $stmt->execute(); |
254 | 254 | |
255 | 255 | while( ( $row = $result->fetch() ) !== false ) { |
256 | - $list[ $row['id'] ] = $row['value']; |
|
256 | + $list[$row['id']] = $row['value']; |
|
257 | 257 | } |
258 | 258 | |
259 | 259 | $this->dbm->release( $conn, $this->dbname ); |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | $result = $stmt->execute(); |
306 | 306 | |
307 | 307 | while( ( $row = $result->fetch() ) !== false ) { |
308 | - $list[ $row['id'] ] = $row['value']; |
|
308 | + $list[$row['id']] = $row['value']; |
|
309 | 309 | } |
310 | 310 | |
311 | 311 | $this->dbm->release( $conn, $this->dbname ); |
@@ -33,18 +33,18 @@ |
||
33 | 33 | { |
34 | 34 | if( ctype_alnum( $name ) === false ) |
35 | 35 | { |
36 | - $classname = is_string( $name ) ? '\\Aimeos\\MW\\Cache\\' . $name : '<not a string>'; |
|
36 | + $classname = is_string( $name ) ? '\\Aimeos\\MW\\Cache\\'.$name : '<not a string>'; |
|
37 | 37 | throw new \Aimeos\MW\Cache\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) ); |
38 | 38 | } |
39 | 39 | |
40 | 40 | $iface = '\\Aimeos\\MW\\Cache\\Iface'; |
41 | - $classname = '\\Aimeos\\MW\\Cache\\' . ucwords( $name ); |
|
41 | + $classname = '\\Aimeos\\MW\\Cache\\'.ucwords( $name ); |
|
42 | 42 | |
43 | 43 | if( class_exists( $classname ) === false ) { |
44 | 44 | throw new \Aimeos\MW\Cache\Exception( sprintf( 'Class "%1$s" not available', $classname ) ); |
45 | 45 | } |
46 | 46 | |
47 | - $manager = new $classname( $config, $resource ); |
|
47 | + $manager = new $classname( $config, $resource ); |
|
48 | 48 | |
49 | 49 | if( !( $manager instanceof $iface ) ) { |
50 | 50 | throw new \Aimeos\MW\Cache\Exception( sprintf( 'Class "%1$s" does not implement interface "%2$s"', $classname, $iface ) ); |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | |
66 | 66 | foreach( $paths as $path ) |
67 | 67 | { |
68 | - $location = $path . DIRECTORY_SEPARATOR . $locale; |
|
68 | + $location = $path.DIRECTORY_SEPARATOR.$locale; |
|
69 | 69 | |
70 | 70 | if( file_exists( $location ) ) |
71 | 71 | { |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | |
76 | 76 | if( strlen( $locale ) > 3 ) |
77 | 77 | { |
78 | - $location = $path . DIRECTORY_SEPARATOR . substr( $locale, 0, -strlen( strrchr( $locale, '_' ) ) ); |
|
78 | + $location = $path.DIRECTORY_SEPARATOR.substr( $locale, 0, -strlen( strrchr( $locale, '_' ) ) ); |
|
79 | 79 | |
80 | 80 | if( file_exists( $location ) ) { |
81 | 81 | $locations[] = $location; |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | $locale = substr( $locale, 0, -strlen( strrchr( $locale, '_' ) ) ); |
110 | 110 | } |
111 | 111 | |
112 | - switch ( $locale ) |
|
112 | + switch( $locale ) |
|
113 | 113 | { |
114 | 114 | case 'af': |
115 | 115 | case 'az': |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | case 'tk': |
163 | 163 | case 'ur': |
164 | 164 | case 'zu': |
165 | - return ($number == 1) ? 0 : 1; |
|
165 | + return ( $number == 1 ) ? 0 : 1; |
|
166 | 166 | |
167 | 167 | case 'am': |
168 | 168 | case 'bh': |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | case 'xbr': |
177 | 177 | case 'ti': |
178 | 178 | case 'wa': |
179 | - return (($number == 0) || ($number == 1)) ? 0 : 1; |
|
179 | + return ( ( $number == 0 ) || ( $number == 1 ) ) ? 0 : 1; |
|
180 | 180 | |
181 | 181 | case 'be': |
182 | 182 | case 'bs': |
@@ -184,41 +184,41 @@ discard block |
||
184 | 184 | case 'ru': |
185 | 185 | case 'sr': |
186 | 186 | case 'uk': |
187 | - return (($number % 10 == 1) && ($number % 100 != 11)) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2); |
|
187 | + return ( ( $number % 10 == 1 ) && ( $number % 100 != 11 ) ) ? 0 : ( ( ( $number % 10 >= 2 ) && ( $number % 10 <= 4 ) && ( ( $number % 100 < 10 ) || ( $number % 100 >= 20 ) ) ) ? 1 : 2 ); |
|
188 | 188 | |
189 | 189 | case 'cs': |
190 | 190 | case 'sk': |
191 | - return ($number == 1) ? 0 : ((($number >= 2) && ($number <= 4)) ? 1 : 2); |
|
191 | + return ( $number == 1 ) ? 0 : ( ( ( $number >= 2 ) && ( $number <= 4 ) ) ? 1 : 2 ); |
|
192 | 192 | |
193 | 193 | case 'ar': |
194 | - return ($number == 0) ? 0 : (($number == 1) ? 1 : (($number == 2) ? 2 : ((($number >= 3) && ($number <= 10)) ? 3 : ((($number >= 11) && ($number <= 99)) ? 4 : 5)))); |
|
194 | + return ( $number == 0 ) ? 0 : ( ( $number == 1 ) ? 1 : ( ( $number == 2 ) ? 2 : ( ( ( $number >= 3 ) && ( $number <= 10 ) ) ? 3 : ( ( ( $number >= 11 ) && ( $number <= 99 ) ) ? 4 : 5 ) ) ) ); |
|
195 | 195 | |
196 | 196 | case 'cy': |
197 | - return ($number == 1) ? 0 : (($number == 2) ? 1 : ((($number == 8) || ($number == 11)) ? 2 : 3)); |
|
197 | + return ( $number == 1 ) ? 0 : ( ( $number == 2 ) ? 1 : ( ( ( $number == 8 ) || ( $number == 11 ) ) ? 2 : 3 ) ); |
|
198 | 198 | |
199 | 199 | case 'ga': |
200 | - return ($number == 1) ? 0 : (($number == 2) ? 1 : 2); |
|
200 | + return ( $number == 1 ) ? 0 : ( ( $number == 2 ) ? 1 : 2 ); |
|
201 | 201 | |
202 | 202 | case 'lt': |
203 | - return (($number % 10 == 1) && ($number % 100 != 11)) ? 0 : ((($number % 10 >= 2) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2); |
|
203 | + return ( ( $number % 10 == 1 ) && ( $number % 100 != 11 ) ) ? 0 : ( ( ( $number % 10 >= 2 ) && ( ( $number % 100 < 10 ) || ( $number % 100 >= 20 ) ) ) ? 1 : 2 ); |
|
204 | 204 | |
205 | 205 | case 'lv': |
206 | - return ($number == 0) ? 0 : ((($number % 10 == 1) && ($number % 100 != 11)) ? 1 : 2); |
|
206 | + return ( $number == 0 ) ? 0 : ( ( ( $number % 10 == 1 ) && ( $number % 100 != 11 ) ) ? 1 : 2 ); |
|
207 | 207 | |
208 | 208 | case 'mk': |
209 | - return ($number % 10 == 1) ? 0 : 1; |
|
209 | + return ( $number % 10 == 1 ) ? 0 : 1; |
|
210 | 210 | |
211 | 211 | case 'mt': |
212 | - return ($number == 1) ? 0 : ((($number == 0) || (($number % 100 > 1) && ($number % 100 < 11))) ? 1 : ((($number % 100 > 10) && ($number % 100 < 20)) ? 2 : 3)); |
|
212 | + return ( $number == 1 ) ? 0 : ( ( ( $number == 0 ) || ( ( $number % 100 > 1 ) && ( $number % 100 < 11 ) ) ) ? 1 : ( ( ( $number % 100 > 10 ) && ( $number % 100 < 20 ) ) ? 2 : 3 ) ); |
|
213 | 213 | |
214 | 214 | case 'pl': |
215 | - return ($number == 1) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 12) || ($number % 100 > 14))) ? 1 : 2); |
|
215 | + return ( $number == 1 ) ? 0 : ( ( ( $number % 10 >= 2 ) && ( $number % 10 <= 4 ) && ( ( $number % 100 < 12 ) || ( $number % 100 > 14 ) ) ) ? 1 : 2 ); |
|
216 | 216 | |
217 | 217 | case 'ro': |
218 | - return ($number == 1) ? 0 : ((($number == 0) || (($number % 100 > 0) && ($number % 100 < 20))) ? 1 : 2); |
|
218 | + return ( $number == 1 ) ? 0 : ( ( ( $number == 0 ) || ( ( $number % 100 > 0 ) && ( $number % 100 < 20 ) ) ) ? 1 : 2 ); |
|
219 | 219 | |
220 | 220 | case 'sl': |
221 | - return ($number % 100 == 1) ? 0 : (($number % 100 == 2) ? 1 : ((($number % 100 == 3) || ($number % 100 == 4)) ? 2 : 3)); |
|
221 | + return ( $number % 100 == 1 ) ? 0 : ( ( $number % 100 == 2 ) ? 1 : ( ( ( $number % 100 == 3 ) || ( $number % 100 == 4 ) ) ? 2 : 3 ) ); |
|
222 | 222 | |
223 | 223 | default: |
224 | 224 | return 0; |