Passed
Push — master ( 78ff77...606203 )
by Aimeos
04:53
created
setup/MShopAddLocaleData.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -164,7 +164,7 @@
 block discarded – undo
164 164
 
165 165
 			try {
166 166
 				$localeManager->save( $item );
167
-			} catch( \Aimeos\Base\DB\Exception $e ) { ; } // if locale combination was already available
167
+			} catch( \Aimeos\Base\DB\Exception $e ) {; } // if locale combination was already available
168 168
 		}
169 169
 	}
170 170
 }
Please login to merge, or discard this patch.
Braces   +19 added lines, -7 removed lines patch added patch discarded remove patch
@@ -52,9 +52,12 @@  discard block
 block discarded – undo
52 52
 		$localeManager = \Aimeos\MShop\Locale\Manager\Factory::create( $this->context(), 'Standard' );
53 53
 		$siteManager = $localeManager->getSubManager( 'site' );
54 54
 
55
-		try {
55
+		try
56
+		{
56 57
 			$siteItem = $siteManager->insert( $siteManager->create()->setLabel( $code )->setCode( $code ) );
57
-		} catch( \Aimeos\Base\DB\Exception $e ) {
58
+		}
59
+		catch( \Aimeos\Base\DB\Exception $e )
60
+		{
58 61
 			$siteItem = $siteManager->find( $code );
59 62
 		}
60 63
 
@@ -69,7 +72,9 @@  discard block
 block discarded – undo
69 72
 
70 73
 			$localeManager->save( $localeItem, false );
71 74
 		}
72
-		catch( \Aimeos\Base\DB\Exception $e ) {} // already in the database
75
+		catch( \Aimeos\Base\DB\Exception $e )
76
+		{
77
+} // already in the database
73 78
 	}
74 79
 
75 80
 
@@ -91,9 +96,12 @@  discard block
 block discarded – undo
91 96
 
92 97
 		foreach( $data as $key => $dataset )
93 98
 		{
94
-			try {
99
+			try
100
+			{
95 101
 				$item = $manager->insert( $manager->create()->fromArray( $dataset ), $parentId );
96
-			} catch( \Aimeos\Base\DB\Exception $e ) {
102
+			}
103
+			catch( \Aimeos\Base\DB\Exception $e )
104
+			{
97 105
 				$item = $manager->find( $key );
98 106
 			}
99 107
 
@@ -162,9 +170,13 @@  discard block
 block discarded – undo
162 170
 				->set( 'site_id', $siteIds[$dataset['site']]['id'] )
163 171
 				->setSiteId( $siteIds[$dataset['site']]['site'] );
164 172
 
165
-			try {
173
+			try
174
+			{
166 175
 				$localeManager->save( $item );
167
-			} catch( \Aimeos\Base\DB\Exception $e ) { ; } // if locale combination was already available
176
+			}
177
+			catch( \Aimeos\Base\DB\Exception $e )
178
+			{
179
+; } // if locale combination was already available
168 180
 		}
169 181
 	}
170 182
 }
Please login to merge, or discard this patch.
setup/unitperf/CatalogAddPerfData.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -61,8 +61,7 @@  discard block
 block discarded – undo
61 61
 				for( $i = 0; $i < $numCatPerLevel; $i++ ) {
62 62
 					$treeFcn( $parents, $catItem->getId(), $numCatPerLevel, $level - 1, $catLabel . '-' . ( $i + 1 ), $i );
63 63
 				}
64
-			}
65
-			else
64
+			} else
66 65
 			{
67 66
 				$fcn = function( array $parents, $catLabel ) {
68 67
 
@@ -120,9 +119,12 @@  discard block
 block discarded – undo
120 119
 
121 120
 		while( true )
122 121
 		{
123
-			try {
122
+			try
123
+			{
124 124
 				return $catalogManager->insert( $item, $parentId );
125
-			} catch( \Aimeos\Base\DB\Exception $e ) {
125
+			}
126
+			catch( \Aimeos\Base\DB\Exception $e )
127
+			{
126 128
 				if( $e->getCode() !== 40001 ) { throw $e; } // transaction deadlock
127 129
 			}
128 130
 		}
Please login to merge, or discard this patch.
src/MW/DB/Result/DBAL.php 1 patch
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -50,9 +50,12 @@  discard block
 block discarded – undo
50 50
 	 */
51 51
 	public function affectedRows() : int
52 52
 	{
53
-		try {
53
+		try
54
+		{
54 55
 			return $this->result->rowCount();
55
-		} catch( \Doctrine\DBAL\Driver\Exception $e ) {
56
+		}
57
+		catch( \Doctrine\DBAL\Driver\Exception $e )
58
+		{
56 59
 			throw new \Aimeos\Base\DB\Exception( $e->getMessage(), $e->getCode() );
57 60
 		}
58 61
 	}
@@ -90,9 +93,12 @@  discard block
 block discarded – undo
90 93
 	 */
91 94
 	public function finish() : Iface
92 95
 	{
93
-		try {
96
+		try
97
+		{
94 98
 			$this->result->free();
95
-		} catch( \Doctrine\DBAL\Driver\Exception $e ) {
99
+		}
100
+		catch( \Doctrine\DBAL\Driver\Exception $e )
101
+		{
96 102
 			throw new \Aimeos\Base\DB\Exception( $e->getMessage(), $e->getCode() );
97 103
 		}
98 104
 
Please login to merge, or discard this patch.
src/MW/DB/Result/PDO.php 1 patch
Braces   +20 added lines, -8 removed lines patch added patch discarded remove patch
@@ -51,9 +51,12 @@  discard block
 block discarded – undo
51 51
 	 */
52 52
 	public function affectedRows() : int
53 53
 	{
54
-		try {
54
+		try
55
+		{
55 56
 			return $this->statement->rowCount();
56
-		} catch( \PDOException $e ) {
57
+		}
58
+		catch( \PDOException $e )
59
+		{
57 60
 			throw new \Aimeos\Base\DB\Exception( $e->getMessage(), $e->getCode(), $e->errorInfo );
58 61
 		}
59 62
 	}
@@ -68,9 +71,12 @@  discard block
 block discarded – undo
68 71
 	 */
69 72
 	public function fetch( int $style = \Aimeos\Base\DB\Result\Base::FETCH_ASSOC ) : ?array
70 73
 	{
71
-		try {
74
+		try
75
+		{
72 76
 			return $this->statement->fetch( $style ? \PDO::FETCH_ASSOC : \PDO::FETCH_NUM ) ?: null;
73
-		} catch( \PDOException $e ) {
77
+		}
78
+		catch( \PDOException $e )
79
+		{
74 80
 			throw new \Aimeos\Base\DB\Exception( $e->getMessage(), $e->getCode(), $e->errorInfo );
75 81
 		}
76 82
 	}
@@ -84,9 +90,12 @@  discard block
 block discarded – undo
84 90
 	 */
85 91
 	public function finish() : Iface
86 92
 	{
87
-		try {
93
+		try
94
+		{
88 95
 			$this->statement->closeCursor();
89
-		} catch( \PDOException $e ) {
96
+		}
97
+		catch( \PDOException $e )
98
+		{
90 99
 			throw new \Aimeos\Base\DB\Exception( $e->getMessage(), $e->getCode(), $e->errorInfo );
91 100
 		}
92 101
 
@@ -101,9 +110,12 @@  discard block
 block discarded – undo
101 110
 	 */
102 111
 	public function nextResult() : bool
103 112
 	{
104
-		try {
113
+		try
114
+		{
105 115
 			return $this->statement->nextRowset();
106
-		} catch( \PDOException $e ) {
116
+		}
117
+		catch( \PDOException $e )
118
+		{
107 119
 			return false;
108 120
 		}
109 121
 	}
Please login to merge, or discard this patch.
src/MW/DB/Manager/DBAL.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -109,7 +109,8 @@
 block discarded – undo
109 109
 
110 110
 			return array_pop( $this->connections[$name] );
111 111
 		}
112
-		catch( \Exception $e ) {
112
+		catch( \Exception $e )
113
+		{
113 114
 			throw new \Aimeos\Base\DB\Exception( $e->getMessage(), $e->getCode() );
114 115
 		}
115 116
 	}
Please login to merge, or discard this patch.
src/MW/DB/Manager/PDO.php 1 patch
Braces   +4 added lines, -5 removed lines patch added patch discarded remove patch
@@ -110,7 +110,8 @@  discard block
 block discarded – undo
110 110
 
111 111
 			return array_pop( $this->connections[$name] );
112 112
 		}
113
-		catch( \PDOException $e ) {
113
+		catch( \PDOException $e )
114
+		{
114 115
 			throw new \Aimeos\Base\DB\Exception( $e->getMessage(), $e->getCode(), $e->errorInfo );
115 116
 		}
116 117
 	}
@@ -160,14 +161,12 @@  discard block
 block discarded – undo
160 161
 			{
161 162
 				$dsn .= 'Database=' . $dbase;
162 163
 				$dsn .= isset( $host ) ? ';Server=' . $host . ( isset( $port ) ? ',' . $port : '' ) : '';
163
-			}
164
-			elseif( $sock == null )
164
+			} elseif( $sock == null )
165 165
 			{
166 166
 				$dsn .= 'dbname=' . $dbase;
167 167
 				$dsn .= isset( $host ) ? ';host=' . $host : '';
168 168
 				$dsn .= isset( $port ) ? ';port=' . $port : '';
169
-			}
170
-			else
169
+			} else
171 170
 			{
172 171
 				$dsn .= 'dbname=' . $dbase . ';unix_socket=' . $sock;
173 172
 			}
Please login to merge, or discard this patch.
src/MW/DB/Statement/DBAL/Prepared.php 2 patches
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -71,9 +71,12 @@
 block discarded – undo
71 71
 	 */
72 72
 	public function execute() : \Aimeos\Base\DB\Result\Iface
73 73
 	{
74
-		try {
74
+		try
75
+		{
75 76
 			$result = $this->exec();
76
-		} catch( \Doctrine\DBAL\Driver\Exception $e ) {
77
+		}
78
+		catch( \Doctrine\DBAL\Driver\Exception $e )
79
+		{
77 80
 			throw new \Aimeos\Base\DB\Exception( $e->getMessage() . ': ' . $this->sql . map( $this->binds )->col( 0 )->toJson(), $e->getCode() );
78 81
 		}
79 82
 
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 		switch( $type )
118 118
 		{
119 119
 			case \Aimeos\Base\DB\Statement\Base::PARAM_NULL:
120
-				$dbaltype = \Doctrine\DBAL\ParameterType::NULL; break;
120
+				$dbaltype = \Doctrine\DBAL\ParameterType::null; break;
121 121
 			case \Aimeos\Base\DB\Statement\Base::PARAM_BOOL:
122 122
 				$dbaltype = \Doctrine\DBAL\ParameterType::BOOLEAN; break;
123 123
 			case \Aimeos\Base\DB\Statement\Base::PARAM_INT:
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 		}
134 134
 
135 135
 		if( is_null( $value ) ) {
136
-			$dbaltype = \Doctrine\DBAL\ParameterType::NULL;
136
+			$dbaltype = \Doctrine\DBAL\ParameterType::null;
137 137
 		}
138 138
 
139 139
 		return $dbaltype;
Please login to merge, or discard this patch.
src/MW/DB/Statement/DBAL/Simple.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -69,9 +69,12 @@
 block discarded – undo
69 69
 	 */
70 70
 	public function execute() : \Aimeos\Base\DB\Result\Iface
71 71
 	{
72
-		try {
72
+		try
73
+		{
73 74
 			$result = $this->getConnection()->getRawObject()->getWrappedConnection()->query( $this->sql );
74
-		} catch( \Doctrine\DBAL\Driver\Exception $e ) {
75
+		}
76
+		catch( \Doctrine\DBAL\Driver\Exception $e )
77
+		{
75 78
 			throw new \Aimeos\Base\DB\Exception( $e->getMessage() . ': ' . $this->sql, $e->getCode() );
76 79
 		}
77 80
 
Please login to merge, or discard this patch.
src/MW/DB/Statement/PDO/Prepared.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -72,9 +72,12 @@
 block discarded – undo
72 72
 	 */
73 73
 	public function execute() : \Aimeos\Base\DB\Result\Iface
74 74
 	{
75
-		try {
75
+		try
76
+		{
76 77
 			$stmt = $this->exec();
77
-		} catch( \PDOException $e ) {
78
+		}
79
+		catch( \PDOException $e )
80
+		{
78 81
 			throw new \Aimeos\Base\DB\Exception( $e->getMessage() . ': ' . $this->sql . map( $this->binds )->col( 0 )->toJson(), $e->getCode(), $e->errorInfo );
79 82
 		}
80 83
 
Please login to merge, or discard this patch.