Passed
Push — master ( 69c104...59abc7 )
by Aimeos
04:13
created
Classes/Controller/AccountController.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -26,19 +26,19 @@  discard block
 block discarded – undo
26 26
 	 */
27 27
 	public function downloadAction()
28 28
 	{
29
-		$paths = Base::getAimeos()->getCustomPaths( 'client/html' );
29
+		$paths = Base::getAimeos()->getCustomPaths('client/html');
30 30
 		$context = $this->getContext();
31 31
 		$view = $context->getView();
32 32
 
33
-		$client = \Aimeos\Client\Html::create( $context, 'account/download' );
34
-		$client->setView( $view );
33
+		$client = \Aimeos\Client\Html::create($context, 'account/download');
34
+		$client->setView($view);
35 35
 		$client->process();
36 36
 
37 37
 		$response = $view->response();
38
-		$this->response->setStatus( $response->getStatusCode() );
38
+		$this->response->setStatus($response->getStatusCode());
39 39
 
40
-		foreach( $response->getHeaders() as $key => $value ) {
41
-			$this->response->setHeader( $key, implode( ', ', $value ) );
40
+		foreach ($response->getHeaders() as $key => $value) {
41
+			$this->response->setHeader($key, implode(', ', $value));
42 42
 		}
43 43
 
44 44
 		return (string) $response->getBody();
@@ -50,8 +50,8 @@  discard block
 block discarded – undo
50 50
 	 */
51 51
 	public function historyAction()
52 52
 	{
53
-		$client = \Aimeos\Client\Html::create( $this->getContext(), 'account/history' );
54
-		return $this->getClientOutput( $client );
53
+		$client = \Aimeos\Client\Html::create($this->getContext(), 'account/history');
54
+		return $this->getClientOutput($client);
55 55
 	}
56 56
 
57 57
 
@@ -60,8 +60,8 @@  discard block
 block discarded – undo
60 60
 	 */
61 61
 	public function favoriteAction()
62 62
 	{
63
-		$client = \Aimeos\Client\Html::create( $this->getContext(), 'account/favorite' );
64
-		return $this->getClientOutput( $client );
63
+		$client = \Aimeos\Client\Html::create($this->getContext(), 'account/favorite');
64
+		return $this->getClientOutput($client);
65 65
 	}
66 66
 
67 67
 
@@ -70,8 +70,8 @@  discard block
 block discarded – undo
70 70
 	 */
71 71
 	public function profileAction()
72 72
 	{
73
-		$client = \Aimeos\Client\Html::create( $this->getContext(), 'account/profile' );
74
-		return $this->getClientOutput( $client );
73
+		$client = \Aimeos\Client\Html::create($this->getContext(), 'account/profile');
74
+		return $this->getClientOutput($client);
75 75
 	}
76 76
 
77 77
 
@@ -80,8 +80,8 @@  discard block
 block discarded – undo
80 80
 	 */
81 81
 	public function subscriptionAction()
82 82
 	{
83
-		$client = \Aimeos\Client\Html::create( $this->getContext(), 'account/subscription' );
84
-		return $this->getClientOutput( $client );
83
+		$client = \Aimeos\Client\Html::create($this->getContext(), 'account/subscription');
84
+		return $this->getClientOutput($client);
85 85
 	}
86 86
 
87 87
 
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 	 */
91 91
 	public function watchAction()
92 92
 	{
93
-		$client = \Aimeos\Client\Html::create( $this->getContext(), 'account/watch' );
94
-		return $this->getClientOutput( $client );
93
+		$client = \Aimeos\Client\Html::create($this->getContext(), 'account/watch');
94
+		return $this->getClientOutput($client);
95 95
 	}
96 96
 }
Please login to merge, or discard this patch.
Classes/Controller/CatalogController.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -26,8 +26,8 @@  discard block
 block discarded – undo
26 26
 	 */
27 27
 	public function attributeAction()
28 28
 	{
29
-		$client = \Aimeos\Client\Html::create( $this->getContext(), 'catalog/attribute' );
30
-		return $this->getClientOutput( $client );
29
+		$client = \Aimeos\Client\Html::create($this->getContext(), 'catalog/attribute');
30
+		return $this->getClientOutput($client);
31 31
 	}
32 32
 
33 33
 
@@ -36,8 +36,8 @@  discard block
 block discarded – undo
36 36
 	 */
37 37
 	public function detailAction()
38 38
 	{
39
-		$client = \Aimeos\Client\Html::create( $this->getContext(), 'catalog/detail' );
40
-		return $this->getClientOutput( $client );
39
+		$client = \Aimeos\Client\Html::create($this->getContext(), 'catalog/detail');
40
+		return $this->getClientOutput($client);
41 41
 	}
42 42
 
43 43
 
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
46 46
 	 */
47 47
 	public function filterAction()
48 48
 	{
49
-		$client = \Aimeos\Client\Html::create( $this->getContext(), 'catalog/filter' );
50
-		return $this->getClientOutput( $client );
49
+		$client = \Aimeos\Client\Html::create($this->getContext(), 'catalog/filter');
50
+		return $this->getClientOutput($client);
51 51
 	}
52 52
 
53 53
 
@@ -56,8 +56,8 @@  discard block
 block discarded – undo
56 56
 	 */
57 57
 	public function countAction()
58 58
 	{
59
-		$client = \Aimeos\Client\Html::create( $this->getContext(), 'catalog/count' );
60
-		return $this->getClientOutput( $client );
59
+		$client = \Aimeos\Client\Html::create($this->getContext(), 'catalog/count');
60
+		return $this->getClientOutput($client);
61 61
 	}
62 62
 
63 63
 
@@ -66,8 +66,8 @@  discard block
 block discarded – undo
66 66
 	 */
67 67
 	public function listAction()
68 68
 	{
69
-		$client = \Aimeos\Client\Html::create( $this->getContext(), 'catalog/lists' );
70
-		return $this->getClientOutput( $client );
69
+		$client = \Aimeos\Client\Html::create($this->getContext(), 'catalog/lists');
70
+		return $this->getClientOutput($client);
71 71
 	}
72 72
 
73 73
 
@@ -76,8 +76,8 @@  discard block
 block discarded – undo
76 76
 	 */
77 77
 	public function searchAction()
78 78
 	{
79
-		$client = \Aimeos\Client\Html::create( $this->getContext(), 'catalog/search' );
80
-		return $this->getClientOutput( $client );
79
+		$client = \Aimeos\Client\Html::create($this->getContext(), 'catalog/search');
80
+		return $this->getClientOutput($client);
81 81
 	}
82 82
 
83 83
 
@@ -86,8 +86,8 @@  discard block
 block discarded – undo
86 86
 	 */
87 87
 	public function sessionAction()
88 88
 	{
89
-		$client = \Aimeos\Client\Html::create( $this->getContext(), 'catalog/session' );
90
-		return $this->getClientOutput( $client );
89
+		$client = \Aimeos\Client\Html::create($this->getContext(), 'catalog/session');
90
+		return $this->getClientOutput($client);
91 91
 	}
92 92
 
93 93
 
@@ -96,8 +96,8 @@  discard block
 block discarded – undo
96 96
 	 */
97 97
 	public function stageAction()
98 98
 	{
99
-		$client = \Aimeos\Client\Html::create( $this->getContext(), 'catalog/stage' );
100
-		return $this->getClientOutput( $client );
99
+		$client = \Aimeos\Client\Html::create($this->getContext(), 'catalog/stage');
100
+		return $this->getClientOutput($client);
101 101
 	}
102 102
 
103 103
 
@@ -106,8 +106,8 @@  discard block
 block discarded – undo
106 106
 	 */
107 107
 	public function stockAction()
108 108
 	{
109
-		$client = \Aimeos\Client\Html::create( $this->getContext(), 'catalog/stock' );
110
-		return $this->getClientOutput( $client );
109
+		$client = \Aimeos\Client\Html::create($this->getContext(), 'catalog/stock');
110
+		return $this->getClientOutput($client);
111 111
 	}
112 112
 
113 113
 
@@ -116,8 +116,8 @@  discard block
 block discarded – undo
116 116
 	 */
117 117
 	public function suggestAction()
118 118
 	{
119
-		$client = \Aimeos\Client\Html::create( $this->getContext(), 'catalog/suggest' );
120
-		return $this->getClientOutput( $client );
119
+		$client = \Aimeos\Client\Html::create($this->getContext(), 'catalog/suggest');
120
+		return $this->getClientOutput($client);
121 121
 	}
122 122
 
123 123
 
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 	 */
127 127
 	public function treeAction()
128 128
 	{
129
-		$client = \Aimeos\Client\Html::create( $this->getContext(), 'catalog/tree' );
130
-		return $this->getClientOutput( $client );
129
+		$client = \Aimeos\Client\Html::create($this->getContext(), 'catalog/tree');
130
+		return $this->getClientOutput($client);
131 131
 	}
132 132
 }
Please login to merge, or discard this patch.
Classes/Controller/AdminController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,6 +22,6 @@
 block discarded – undo
22 22
 	 */
23 23
 	public function indexAction()
24 24
 	{
25
-		$this->forward( 'search', 'Jqadm' );
25
+		$this->forward('search', 'Jqadm');
26 26
 	}
27 27
 }
Please login to merge, or discard this patch.
Classes/Controller/JqadmController.php 1 patch
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	protected function initializeAction()
30 30
 	{
31 31
 		parent::initializeAction();
32
-		$this->uriBuilder->setArgumentPrefix( 'tx_aimeos_web_aimeostxaimeosadmin' );
32
+		$this->uriBuilder->setArgumentPrefix('tx_aimeos_web_aimeostxaimeosadmin');
33 33
 	}
34 34
 
35 35
 
@@ -42,31 +42,31 @@  discard block
 block discarded – undo
42 42
 	{
43 43
 		$contents = '';
44 44
 		$files = array();
45
-		$type = $this->request->getArgument( 'type' );
45
+		$type = $this->request->getArgument('type');
46 46
 
47
-		foreach( Base::getAimeos()->getCustomPaths( 'admin/jqadm' ) as $base => $paths )
47
+		foreach (Base::getAimeos()->getCustomPaths('admin/jqadm') as $base => $paths)
48 48
 		{
49
-			foreach( $paths as $path )
49
+			foreach ($paths as $path)
50 50
 			{
51 51
 				$jsbAbsPath = $base . '/' . $path;
52
-				$jsb2 = new \Aimeos\MW\Jsb2\Standard( $jsbAbsPath, dirname( $jsbAbsPath ) );
53
-				$files = array_merge( $files, $jsb2->getFiles( $type ) );
52
+				$jsb2 = new \Aimeos\MW\Jsb2\Standard($jsbAbsPath, dirname($jsbAbsPath));
53
+				$files = array_merge($files, $jsb2->getFiles($type));
54 54
 			}
55 55
 		}
56 56
 
57
-		foreach( $files as $file )
57
+		foreach ($files as $file)
58 58
 		{
59
-			if( ( $content = file_get_contents( $file ) ) === false ) {
60
-				throw new \RuntimeException( sprintf( 'File "%1$s" not found', $jsbAbsPath ) );
59
+			if (($content = file_get_contents($file)) === false) {
60
+				throw new \RuntimeException(sprintf('File "%1$s" not found', $jsbAbsPath));
61 61
 			}
62 62
 
63 63
 			$contents .= $content;
64 64
 		}
65 65
 
66
-		if( $type === 'js' ) {
67
-			$this->response->setHeader( 'Content-Type', 'application/javascript' );
68
-		} elseif( $type === 'css' ) {
69
-			$this->response->setHeader( 'Content-Type', 'text/css' );
66
+		if ($type === 'js') {
67
+			$this->response->setHeader('Content-Type', 'application/javascript');
68
+		} elseif ($type === 'css') {
69
+			$this->response->setHeader('Content-Type', 'text/css');
70 70
 		}
71 71
 
72 72
 		return $contents;
@@ -82,11 +82,11 @@  discard block
 block discarded – undo
82 82
 	{
83 83
 		$cntl = $this->createAdmin();
84 84
 
85
-		if( ( $html = $cntl->copy() ) == '' ) {
86
-			return $this->setPsrResponse( $cntl->getView()->response() );
85
+		if (($html = $cntl->copy()) == '') {
86
+			return $this->setPsrResponse($cntl->getView()->response());
87 87
 		}
88 88
 
89
-		$this->view->assign( 'content', $html );
89
+		$this->view->assign('content', $html);
90 90
 	}
91 91
 
92 92
 
@@ -99,11 +99,11 @@  discard block
 block discarded – undo
99 99
 	{
100 100
 		$cntl = $this->createAdmin();
101 101
 
102
-		if( ( $html = $cntl->create() ) == '' ) {
103
-			return $this->setPsrResponse( $cntl->getView()->response() );
102
+		if (($html = $cntl->create()) == '') {
103
+			return $this->setPsrResponse($cntl->getView()->response());
104 104
 		}
105 105
 
106
-		$this->view->assign( 'content', $html );
106
+		$this->view->assign('content', $html);
107 107
 	}
108 108
 
109 109
 
@@ -116,11 +116,11 @@  discard block
 block discarded – undo
116 116
 	{
117 117
 		$cntl = $this->createAdmin();
118 118
 
119
-		if( ( $html = $cntl->delete() ) == '' ) {
120
-			return $this->setPsrResponse( $cntl->getView()->response() );
119
+		if (($html = $cntl->delete()) == '') {
120
+			return $this->setPsrResponse($cntl->getView()->response());
121 121
 		}
122 122
 
123
-		$this->view->assign( 'content', $html );
123
+		$this->view->assign('content', $html);
124 124
 	}
125 125
 
126 126
 
@@ -133,11 +133,11 @@  discard block
 block discarded – undo
133 133
 	{
134 134
 		$cntl = $this->createAdmin();
135 135
 
136
-		if( ( $html = $cntl->export() ) == '' ) {
137
-			return $this->setPsrResponse( $cntl->getView()->response() );
136
+		if (($html = $cntl->export()) == '') {
137
+			return $this->setPsrResponse($cntl->getView()->response());
138 138
 		}
139 139
 
140
-		$this->view->assign( 'content', $html );
140
+		$this->view->assign('content', $html);
141 141
 	}
142 142
 
143 143
 
@@ -150,11 +150,11 @@  discard block
 block discarded – undo
150 150
 	{
151 151
 		$cntl = $this->createAdmin();
152 152
 
153
-		if( ( $html = $cntl->get() ) == '' ) {
154
-			return $this->setPsrResponse( $cntl->getView()->response() );
153
+		if (($html = $cntl->get()) == '') {
154
+			return $this->setPsrResponse($cntl->getView()->response());
155 155
 		}
156 156
 
157
-		$this->view->assign( 'content', $html );
157
+		$this->view->assign('content', $html);
158 158
 	}
159 159
 
160 160
 
@@ -167,11 +167,11 @@  discard block
 block discarded – undo
167 167
 	{
168 168
 		$cntl = $this->createAdmin();
169 169
 
170
-		if( ( $html = $cntl->import() ) == '' ) {
171
-			return $this->setPsrResponse( $cntl->getView()->response() );
170
+		if (($html = $cntl->import()) == '') {
171
+			return $this->setPsrResponse($cntl->getView()->response());
172 172
 		}
173 173
 
174
-		$this->view->assign( 'content', $html );
174
+		$this->view->assign('content', $html);
175 175
 	}
176 176
 
177 177
 
@@ -184,11 +184,11 @@  discard block
 block discarded – undo
184 184
 	{
185 185
 		$cntl = $this->createAdmin();
186 186
 
187
-		if( ( $html = $cntl->save() ) == '' ) {
188
-			return $this->setPsrResponse( $cntl->getView()->response() );
187
+		if (($html = $cntl->save()) == '') {
188
+			return $this->setPsrResponse($cntl->getView()->response());
189 189
 		}
190 190
 
191
-		$this->view->assign( 'content', $html );
191
+		$this->view->assign('content', $html);
192 192
 	}
193 193
 
194 194
 
@@ -201,11 +201,11 @@  discard block
 block discarded – undo
201 201
 	{
202 202
 		$cntl = $this->createAdmin();
203 203
 
204
-		if( ( $html = $cntl->search() ) == '' ) {
205
-			return $this->setPsrResponse( $cntl->getView()->response() );
204
+		if (($html = $cntl->search()) == '') {
205
+			return $this->setPsrResponse($cntl->getView()->response());
206 206
 		}
207 207
 
208
-		$this->view->assign( 'content', $html );
208
+		$this->view->assign('content', $html);
209 209
 	}
210 210
 
211 211
 
@@ -218,24 +218,24 @@  discard block
 block discarded – undo
218 218
 	{
219 219
 		$resource = 'dashboard';
220 220
 
221
-		if( $this->request->hasArgument( 'resource' )
222
-			&& ( $value = $this->request->getArgument( 'resource' ) ) != ''
221
+		if ($this->request->hasArgument('resource')
222
+			&& ($value = $this->request->getArgument('resource')) != ''
223 223
 		) {
224 224
 			$resource = $value;
225 225
 		}
226 226
 
227 227
 		$aimeos = Base::getAimeos();
228
-		$context = $this->getContextBackend( 'admin/jqadm/templates' );
228
+		$context = $this->getContextBackend('admin/jqadm/templates');
229 229
 
230 230
 		$view = $context->getView();
231 231
 
232 232
 		$view->aimeosType = 'TYPO3';
233 233
 		$view->aimeosVersion = Base::getVersion();
234
-		$view->aimeosExtensions = implode( ',', $aimeos->getExtensions() );
234
+		$view->aimeosExtensions = implode(',', $aimeos->getExtensions());
235 235
 
236
-		$context->setView( $view );
236
+		$context->setView($view);
237 237
 
238
-		return \Aimeos\Admin\JQAdm::create( $context, $aimeos, $resource );
238
+		return \Aimeos\Admin\JQAdm::create($context, $aimeos, $resource);
239 239
 	}
240 240
 
241 241
 
@@ -256,13 +256,13 @@  discard block
 block discarded – undo
256 256
 	 * @param \Psr\Http\Message\ResponseInterface $response PSR-7 response object
257 257
 	 * @return string Generated output
258 258
 	 */
259
-	protected function setPsrResponse( \Psr\Http\Message\ResponseInterface $response )
259
+	protected function setPsrResponse(\Psr\Http\Message\ResponseInterface $response)
260 260
 	{
261
-		$this->response->setStatus( $response->getStatusCode() );
261
+		$this->response->setStatus($response->getStatusCode());
262 262
 
263
-		foreach( $response->getHeaders() as $key => $value ) {
264
-			foreach( (array) $value as $val ) {
265
-				$this->response->setHeader( $key, $val );
263
+		foreach ($response->getHeaders() as $key => $value) {
264
+			foreach ((array) $value as $val) {
265
+				$this->response->setHeader($key, $val);
266 266
 			}
267 267
 		}
268 268
 
Please login to merge, or discard this patch.
Classes/Controller/JsonadmController.php 1 patch
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 	protected function initializeAction()
28 28
 	{
29 29
 		parent::initializeAction();
30
-		$this->uriBuilder->setArgumentPrefix( 'tx_aimeos_web_aimeostxaimeosadmin' );
30
+		$this->uriBuilder->setArgumentPrefix('tx_aimeos_web_aimeostxaimeosadmin');
31 31
 	}
32 32
 
33 33
 
@@ -40,20 +40,20 @@  discard block
 block discarded – undo
40 40
 	{
41 41
 		$resource = null;
42 42
 
43
-		if( $this->request->hasArgument( 'resource' )
44
-			&& ( $value = $this->request->getArgument( 'resource' ) ) != ''
43
+		if ($this->request->hasArgument('resource')
44
+			&& ($value = $this->request->getArgument('resource')) != ''
45 45
 		) {
46 46
 			$resource = $value;
47 47
 		}
48 48
 
49
-		switch( $this->request->getMethod() )
49
+		switch ($this->request->getMethod())
50 50
 		{
51
-			case 'DELETE': return $this->deleteAction( $resource );
52
-			case 'PATCH': return $this->patchAction( $resource );
53
-			case 'POST': return $this->postAction( $resource );
54
-			case 'PUT': return $this->putAction( $resource );
55
-			case 'GET': return $this->getAction( $resource );
56
-			default: return $this->optionsAction( $resource );
51
+			case 'DELETE': return $this->deleteAction($resource);
52
+			case 'PATCH': return $this->patchAction($resource);
53
+			case 'POST': return $this->postAction($resource);
54
+			case 'PUT': return $this->putAction($resource);
55
+			case 'GET': return $this->getAction($resource);
56
+			default: return $this->optionsAction($resource);
57 57
 		}
58 58
 	}
59 59
 
@@ -64,10 +64,10 @@  discard block
 block discarded – undo
64 64
 	 * @param string Resource location, e.g. "product/property/type"
65 65
 	 * @return string Generated output
66 66
 	 */
67
-	public function deleteAction( $resource )
67
+	public function deleteAction($resource)
68 68
 	{
69
-		$response = $this->createAdmin( $resource )->delete( $this->getPsrRequest(), new Response() );
70
-		return $this->setPsrResponse( $response );
69
+		$response = $this->createAdmin($resource)->delete($this->getPsrRequest(), new Response());
70
+		return $this->setPsrResponse($response);
71 71
 	}
72 72
 
73 73
 
@@ -77,10 +77,10 @@  discard block
 block discarded – undo
77 77
 	 * @param string Resource location, e.g. "product/property/type"
78 78
 	 * @return string Generated output
79 79
 	 */
80
-	public function getAction( $resource )
80
+	public function getAction($resource)
81 81
 	{
82
-		$response = $this->createAdmin( $resource )->get( $this->getPsrRequest(), new Response() );
83
-		return $this->setPsrResponse( $response );
82
+		$response = $this->createAdmin($resource)->get($this->getPsrRequest(), new Response());
83
+		return $this->setPsrResponse($response);
84 84
 	}
85 85
 
86 86
 
@@ -90,10 +90,10 @@  discard block
 block discarded – undo
90 90
 	 * @param string Resource location, e.g. "product/property/type"
91 91
 	 * @return string Generated output
92 92
 	 */
93
-	public function patchAction( $resource )
93
+	public function patchAction($resource)
94 94
 	{
95
-		$response = $this->createAdmin( $resource )->patch( $this->getPsrRequest(), new Response() );
96
-		return $this->setPsrResponse( $response );
95
+		$response = $this->createAdmin($resource)->patch($this->getPsrRequest(), new Response());
96
+		return $this->setPsrResponse($response);
97 97
 	}
98 98
 
99 99
 
@@ -103,10 +103,10 @@  discard block
 block discarded – undo
103 103
 	 * @param string Resource location, e.g. "product/property/type"
104 104
 	 * @return string Generated output
105 105
 	 */
106
-	public function postAction( $resource )
106
+	public function postAction($resource)
107 107
 	{
108
-		$response = $this->createAdmin( $resource )->post( $this->getPsrRequest(), new Response() );
109
-		return $this->setPsrResponse( $response );
108
+		$response = $this->createAdmin($resource)->post($this->getPsrRequest(), new Response());
109
+		return $this->setPsrResponse($response);
110 110
 	}
111 111
 
112 112
 
@@ -116,10 +116,10 @@  discard block
 block discarded – undo
116 116
 	 * @param string Resource location, e.g. "product/property/type"
117 117
 	 * @return string Generated output
118 118
 	 */
119
-	public function putAction( $resource )
119
+	public function putAction($resource)
120 120
 	{
121
-		$response = $this->createAdmin( $resource )->put( $this->getPsrRequest(), new Response() );
122
-		return $this->setPsrResponse( $response );
121
+		$response = $this->createAdmin($resource)->put($this->getPsrRequest(), new Response());
122
+		return $this->setPsrResponse($response);
123 123
 	}
124 124
 
125 125
 
@@ -129,10 +129,10 @@  discard block
 block discarded – undo
129 129
 	 * @param string Resource location, e.g. "product/property/type"
130 130
 	 * @return string Generated output
131 131
 	 */
132
-	public function optionsAction( $resource )
132
+	public function optionsAction($resource)
133 133
 	{
134
-		$response = $this->createAdmin( $resource )->options( $this->getPsrRequest(), new Response() );
135
-		return $this->setPsrResponse( $response );
134
+		$response = $this->createAdmin($resource)->options($this->getPsrRequest(), new Response());
135
+		return $this->setPsrResponse($response);
136 136
 	}
137 137
 
138 138
 
@@ -142,10 +142,10 @@  discard block
 block discarded – undo
142 142
 	 * @param string Resource location, e.g. "product/property/type"
143 143
 	 * @return \Aimeos\Admin\JsonAdm\Iface Jsonadm client
144 144
 	 */
145
-	protected function createAdmin( $resource )
145
+	protected function createAdmin($resource)
146 146
 	{
147
-		$context = $this->getContextBackend( 'admin/jsonadm/templates' );
148
-		return \Aimeos\Admin\JsonAdm::create( $context, Base::getAimeos(), $resource );
147
+		$context = $this->getContextBackend('admin/jsonadm/templates');
148
+		return \Aimeos\Admin\JsonAdm::create($context, Base::getAimeos(), $resource);
149 149
 	}
150 150
 
151 151
 
@@ -166,13 +166,13 @@  discard block
 block discarded – undo
166 166
 	 * @param \Psr\Http\Message\ResponseInterface $response PSR-7 response object
167 167
 	 * @return string Generated output
168 168
 	 */
169
-	protected function setPsrResponse( \Psr\Http\Message\ResponseInterface $response )
169
+	protected function setPsrResponse(\Psr\Http\Message\ResponseInterface $response)
170 170
 	{
171
-		$this->response->setStatus( $response->getStatusCode() );
171
+		$this->response->setStatus($response->getStatusCode());
172 172
 
173
-		foreach( $response->getHeaders() as $key => $value ) {
174
-			foreach( (array) $value as $val ) {
175
-				$this->response->setHeader( $key, $val );
173
+		foreach ($response->getHeaders() as $key => $value) {
174
+			foreach ((array) $value as $val) {
175
+				$this->response->setHeader($key, $val);
176 176
 			}
177 177
 		}
178 178
 
Please login to merge, or discard this patch.
Classes/Controller/JsonapiController.php 1 patch
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -30,26 +30,26 @@  discard block
 block discarded – undo
30 30
 	{
31 31
 		$resource = $related = null;
32 32
 
33
-		if( $this->request->hasArgument( 'resource' )
34
-			&& ( $value = $this->request->getArgument( 'resource' ) ) != ''
33
+		if ($this->request->hasArgument('resource')
34
+			&& ($value = $this->request->getArgument('resource')) != ''
35 35
 		) {
36 36
 			$resource = $value;
37 37
 		}
38 38
 
39
-		if( $this->request->hasArgument( 'related' )
40
-			&& ( $value = $this->request->getArgument( 'related' ) ) != ''
39
+		if ($this->request->hasArgument('related')
40
+			&& ($value = $this->request->getArgument('related')) != ''
41 41
 		) {
42 42
 			$related = $value;
43 43
 		}
44 44
 
45
-		switch( $this->request->getMethod() )
45
+		switch ($this->request->getMethod())
46 46
 		{
47
-			case 'DELETE': return $this->deleteAction( $resource, $related );
48
-			case 'PATCH': return $this->patchAction( $resource, $related );
49
-			case 'POST': return $this->postAction( $resource, $related );
50
-			case 'PUT': return $this->putAction( $resource, $related );
51
-			case 'GET': return $this->getAction( $resource, $related );
52
-			default: return $this->optionsAction( $resource );
47
+			case 'DELETE': return $this->deleteAction($resource, $related);
48
+			case 'PATCH': return $this->patchAction($resource, $related);
49
+			case 'POST': return $this->postAction($resource, $related);
50
+			case 'PUT': return $this->putAction($resource, $related);
51
+			case 'GET': return $this->getAction($resource, $related);
52
+			default: return $this->optionsAction($resource);
53 53
 		}
54 54
 	}
55 55
 
@@ -61,10 +61,10 @@  discard block
 block discarded – undo
61 61
 	 * @param string Related resource, e.g. "product"
62 62
 	 * @return string Generated output
63 63
 	 */
64
-	public function deleteAction( $resource, $related )
64
+	public function deleteAction($resource, $related)
65 65
 	{
66
-		$response = $this->createClient( $resource, $related )->delete( $this->getPsrRequest(), new Response() );
67
-		return $this->setPsrResponse( $response );
66
+		$response = $this->createClient($resource, $related)->delete($this->getPsrRequest(), new Response());
67
+		return $this->setPsrResponse($response);
68 68
 	}
69 69
 
70 70
 
@@ -75,10 +75,10 @@  discard block
 block discarded – undo
75 75
 	 * @param string Related resource, e.g. "product"
76 76
 	 * @return string Generated output
77 77
 	 */
78
-	public function getAction( $resource, $related )
78
+	public function getAction($resource, $related)
79 79
 	{
80
-		$response = $this->createClient( $resource, $related )->get( $this->getPsrRequest(), new Response() );
81
-		return $this->setPsrResponse( $response );
80
+		$response = $this->createClient($resource, $related)->get($this->getPsrRequest(), new Response());
81
+		return $this->setPsrResponse($response);
82 82
 	}
83 83
 
84 84
 
@@ -89,10 +89,10 @@  discard block
 block discarded – undo
89 89
 	 * @param string Related resource, e.g. "product"
90 90
 	 * @return string Generated output
91 91
 	 */
92
-	public function patchAction( $resource, $related )
92
+	public function patchAction($resource, $related)
93 93
 	{
94
-		$response = $this->createClient( $resource, $related )->patch( $this->getPsrRequest(), new Response() );
95
-		return $this->setPsrResponse( $response );
94
+		$response = $this->createClient($resource, $related)->patch($this->getPsrRequest(), new Response());
95
+		return $this->setPsrResponse($response);
96 96
 	}
97 97
 
98 98
 
@@ -103,10 +103,10 @@  discard block
 block discarded – undo
103 103
 	 * @param string Related resource, e.g. "product"
104 104
 	 * @return string Generated output
105 105
 	 */
106
-	public function postAction( $resource, $related )
106
+	public function postAction($resource, $related)
107 107
 	{
108
-		$response = $this->createClient( $resource, $related )->post( $this->getPsrRequest(), new Response() );
109
-		return $this->setPsrResponse( $response );
108
+		$response = $this->createClient($resource, $related)->post($this->getPsrRequest(), new Response());
109
+		return $this->setPsrResponse($response);
110 110
 	}
111 111
 
112 112
 
@@ -117,10 +117,10 @@  discard block
 block discarded – undo
117 117
 	 * @param string Related resource, e.g. "product"
118 118
 	 * @return string Generated output
119 119
 	 */
120
-	public function putAction( $resource, $related )
120
+	public function putAction($resource, $related)
121 121
 	{
122
-		$response = $this->createClient( $resource, $related )->put( $this->getPsrRequest(), new Response() );
123
-		return $this->setPsrResponse( $response );
122
+		$response = $this->createClient($resource, $related)->put($this->getPsrRequest(), new Response());
123
+		return $this->setPsrResponse($response);
124 124
 	}
125 125
 
126 126
 
@@ -130,10 +130,10 @@  discard block
 block discarded – undo
130 130
 	 * @param string Resource location, e.g. "product"
131 131
 	 * @return string Generated output
132 132
 	 */
133
-	public function optionsAction( $resource )
133
+	public function optionsAction($resource)
134 134
 	{
135
-		$response = $this->createClient( $resource )->options( $this->getPsrRequest(), new Response() );
136
-		return $this->setPsrResponse( $response );
135
+		$response = $this->createClient($resource)->options($this->getPsrRequest(), new Response());
136
+		return $this->setPsrResponse($response);
137 137
 	}
138 138
 
139 139
 
@@ -144,10 +144,10 @@  discard block
 block discarded – undo
144 144
 	 * @param string|null Related resource, e.g. "product"
145 145
 	 * @return \Aimeos\Client\JsonApi\Iface Jsonapi client
146 146
 	 */
147
-	protected function createClient( $resource, $related = null )
147
+	protected function createClient($resource, $related = null)
148 148
 	{
149
-		$context = $this->getContext( 'client/jsonapi/templates' );
150
-		return \Aimeos\Client\JsonApi::create( $context, $resource . '/' . $related );
149
+		$context = $this->getContext('client/jsonapi/templates');
150
+		return \Aimeos\Client\JsonApi::create($context, $resource . '/' . $related);
151 151
 	}
152 152
 
153 153
 
@@ -168,13 +168,13 @@  discard block
 block discarded – undo
168 168
 	 * @param \Psr\Http\Message\ResponseInterface $response PSR-7 response object
169 169
 	 * @return string Generated output
170 170
 	 */
171
-	protected function setPsrResponse( \Psr\Http\Message\ResponseInterface $response )
171
+	protected function setPsrResponse(\Psr\Http\Message\ResponseInterface $response)
172 172
 	{
173
-		$this->response->setStatus( $response->getStatusCode() );
173
+		$this->response->setStatus($response->getStatusCode());
174 174
 
175
-		foreach( $response->getHeaders() as $key => $value ) {
176
-			foreach( (array) $value as $val ) {
177
-				$this->response->setHeader( $key, $val );
175
+		foreach ($response->getHeaders() as $key => $value) {
176
+			foreach ((array) $value as $val) {
177
+				$this->response->setHeader($key, $val);
178 178
 			}
179 179
 		}
180 180
 
Please login to merge, or discard this patch.
Classes/Base/I18n.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
 	/**
24 24
 	 * Creates new translation objects.
25 25
 	 *
26
-     * @param array $i18nPaths Paths to the translation directories
26
+	 * @param array $i18nPaths Paths to the translation directories
27 27
 	 * @param array $langIds List of two letter ISO language IDs
28 28
 	 * @param array $local List of local translation entries overwriting the standard ones
29 29
 	 * @return array List of translation objects implementing MW_Translation_Interface
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -28,20 +28,20 @@  discard block
 block discarded – undo
28 28
 	 * @param array $local List of local translation entries overwriting the standard ones
29 29
 	 * @return array List of translation objects implementing MW_Translation_Interface
30 30
 	 */
31
-	public static function get( array $i18nPaths, array $languageIds, array $local = array() )
31
+	public static function get(array $i18nPaths, array $languageIds, array $local = array())
32 32
 	{
33 33
 		$i18nList = array();
34 34
 
35
-		foreach( $languageIds as $langid )
35
+		foreach ($languageIds as $langid)
36 36
 		{
37
-			if( $langid == '' ) { continue; }
37
+			if ($langid == '') { continue; }
38 38
 
39
-			if( !isset( self::$i18n[$langid] ) )
39
+			if (!isset(self::$i18n[$langid]))
40 40
 			{
41
-				$i18n = new \Aimeos\MW\Translation\Gettext( $i18nPaths, $langid );
41
+				$i18n = new \Aimeos\MW\Translation\Gettext($i18nPaths, $langid);
42 42
 
43
-				if( (bool) \Aimeos\Aimeos\Base::getExtConfig( 'useAPC', false ) === true ) {
44
-					$i18n = new \Aimeos\MW\Translation\Decorator\APC( $i18n, \Aimeos\Aimeos\Base::getExtConfig( 'apcPrefix', 't3:' ) );
43
+				if ((bool) \Aimeos\Aimeos\Base::getExtConfig('useAPC', false) === true) {
44
+					$i18n = new \Aimeos\MW\Translation\Decorator\APC($i18n, \Aimeos\Aimeos\Base::getExtConfig('apcPrefix', 't3:'));
45 45
 				}
46 46
 
47 47
 				self::$i18n[$langid] = $i18n;
@@ -49,10 +49,10 @@  discard block
 block discarded – undo
49 49
 
50 50
 			$i18nList[$langid] = self::$i18n[$langid];
51 51
 
52
-			if( isset( $local[$langid] ) )
52
+			if (isset($local[$langid]))
53 53
 			{
54
-				$translations = self::parseTranslations( (array) $local[$langid] );
55
-				$i18nList[$langid] = new \Aimeos\MW\Translation\Decorator\Memory( $i18nList[$langid], $translations );
54
+				$translations = self::parseTranslations((array) $local[$langid]);
55
+				$i18nList[$langid] = new \Aimeos\MW\Translation\Decorator\Memory($i18nList[$langid], $translations);
56 56
 			}
57 57
 		}
58 58
 
@@ -66,19 +66,19 @@  discard block
 block discarded – undo
66 66
 	 * @param array $entries User-defined translation entries via TypoScript
67 67
 	 * @return array Associative list of translation domain and original string / list of tranlations
68 68
 	 */
69
-	protected static function parseTranslations( array $entries )
69
+	protected static function parseTranslations(array $entries)
70 70
 	{
71 71
 		$translations = array();
72 72
 
73
-		foreach( $entries as $entry )
73
+		foreach ($entries as $entry)
74 74
 		{
75
-			if( isset( $entry['domain'] ) && isset( $entry['string'] ) && isset( $entry['trans'] ) )
75
+			if (isset($entry['domain']) && isset($entry['string']) && isset($entry['trans']))
76 76
 			{
77
-				$string = str_replace( ['\\n', '\\'], ["\n", ''], $entry['string'] );
77
+				$string = str_replace(['\\n', '\\'], ["\n", ''], $entry['string']);
78 78
 				$trans = array();
79 79
 
80
-				foreach( (array) $entry['trans'] as $str ) {
81
-					$trans[] = str_replace( ['\\n', '\\'], ["\n", ''], $str );
80
+				foreach ((array) $entry['trans'] as $str) {
81
+					$trans[] = str_replace(['\\n', '\\'], ["\n", ''], $str);
82 82
 				}
83 83
 
84 84
 				$translations[$entry['domain']][$string] = $trans;
Please login to merge, or discard this patch.
Classes/Base/Aimeos.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -27,26 +27,26 @@
 block discarded – undo
27 27
 	 */
28 28
 	public static function get()
29 29
 	{
30
-		if( self::$aimeos === null )
30
+		if (self::$aimeos === null)
31 31
 		{
32 32
 			$extDirs = array();
33 33
 
34 34
 			// Extension directories
35
-			if( is_array( $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['extDirs'] ) )
35
+			if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['extDirs']))
36 36
 			{
37
-				ksort( $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['extDirs'] );
37
+				ksort($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['extDirs']);
38 38
 
39
-				foreach( $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['extDirs'] as $dir )
39
+				foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['extDirs'] as $dir)
40 40
 				{
41
-					$absPath = \TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName( $dir );
41
+					$absPath = \TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($dir);
42 42
 
43
-					if( !empty( $absPath ) ) {
43
+					if (!empty($absPath)) {
44 44
 						$extDirs[] = $absPath;
45 45
 					}
46 46
 				}
47 47
 			}
48 48
 
49
-			self::$aimeos = new \Aimeos\Bootstrap( $extDirs, false );
49
+			self::$aimeos = new \Aimeos\Bootstrap($extDirs, false);
50 50
 		}
51 51
 
52 52
 		return self::$aimeos;
Please login to merge, or discard this patch.
Classes/Base/Locale.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -27,45 +27,45 @@  discard block
 block discarded – undo
27 27
 	 * @param \TYPO3\CMS\Extbase\Mvc\RequestInterface|null $request Request object
28 28
 	 * @return \Aimeos\MShop\Locale\Item\Iface Locale item object
29 29
 	 */
30
-	public static function get( \Aimeos\MShop\Context\Item\Iface $context, \TYPO3\CMS\Extbase\Mvc\RequestInterface $request = null )
30
+	public static function get(\Aimeos\MShop\Context\Item\Iface $context, \TYPO3\CMS\Extbase\Mvc\RequestInterface $request = null)
31 31
 	{
32
-		if( !isset( self::$locale ) )
32
+		if (!isset(self::$locale))
33 33
 		{
34 34
 			$config = $context->getConfig();
35 35
 
36 36
 
37
-			$sitecode = $config->get( 'mshop/locale/site', 'default' );
38
-			$name = $config->get( 'typo3/param/name/site', 'site' );
37
+			$sitecode = $config->get('mshop/locale/site', 'default');
38
+			$name = $config->get('typo3/param/name/site', 'site');
39 39
 
40
-			if( $request !== null && $request->hasArgument( $name ) === true ) {
41
-				$sitecode = $request->getArgument( $name );
42
-			} elseif( ( $value = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP( 'S' ) ) !== null ) {
40
+			if ($request !== null && $request->hasArgument($name) === true) {
41
+				$sitecode = $request->getArgument($name);
42
+			} elseif (($value = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('S')) !== null) {
43 43
 				$sitecode = $value;
44 44
 			}
45 45
 
46 46
 
47
-			$langid = $config->get( 'mshop/locale/language', '' );
48
-			$name = $config->get( 'typo3/param/name/language', 'locale' );
47
+			$langid = $config->get('mshop/locale/language', '');
48
+			$name = $config->get('typo3/param/name/language', 'locale');
49 49
 
50
-			if( $request !== null && $request->hasArgument( $name ) === true ) {
51
-				$langid = $request->getArgument( $name );
52
-			} elseif( isset( $GLOBALS['TSFE']->config['config']['language'] ) ) {
50
+			if ($request !== null && $request->hasArgument($name) === true) {
51
+				$langid = $request->getArgument($name);
52
+			} elseif (isset($GLOBALS['TSFE']->config['config']['language'])) {
53 53
 				$langid = $GLOBALS['TSFE']->config['config']['language'];
54 54
 			}
55 55
 
56 56
 
57
-			$currency = $config->get( 'mshop/locale/currency', '' );
58
-			$name = $config->get( 'typo3/param/name/currency', 'currency' );
57
+			$currency = $config->get('mshop/locale/currency', '');
58
+			$name = $config->get('typo3/param/name/currency', 'currency');
59 59
 
60
-			if( $request !== null && $request->hasArgument( $name ) === true ) {
61
-				$currency = $request->getArgument( $name );
62
-			} elseif( ( $value = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP( 'C' ) ) !== null ) {
60
+			if ($request !== null && $request->hasArgument($name) === true) {
61
+				$currency = $request->getArgument($name);
62
+			} elseif (($value = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('C')) !== null) {
63 63
 				$currency = $value;
64 64
 			}
65 65
 
66 66
 
67
-			$localeManager = \Aimeos\MShop::create( $context, 'locale' );
68
-			self::$locale = $localeManager->bootstrap( $sitecode, $langid, $currency );
67
+			$localeManager = \Aimeos\MShop::create($context, 'locale');
68
+			self::$locale = $localeManager->bootstrap($sitecode, $langid, $currency);
69 69
 		}
70 70
 
71 71
 		return self::$locale;
@@ -79,13 +79,13 @@  discard block
 block discarded – undo
79 79
 	 * @param string $site Unique site code
80 80
 	 * @return \Aimeos\MShop\Context\Item\Iface Modified context object
81 81
 	 */
82
-	public static function getBackend( \Aimeos\MShop\Context\Item\Iface $context, $site )
82
+	public static function getBackend(\Aimeos\MShop\Context\Item\Iface $context, $site)
83 83
 	{
84
-		$localeManager = \Aimeos\MShop::create( $context, 'locale' );
84
+		$localeManager = \Aimeos\MShop::create($context, 'locale');
85 85
 
86 86
 		try {
87
-			$localeItem = $localeManager->bootstrap( $site, '', '', false, null, true );
88
-		} catch( \Aimeos\MShop\Exception $e ) {
87
+			$localeItem = $localeManager->bootstrap($site, '', '', false, null, true);
88
+		} catch (\Aimeos\MShop\Exception $e) {
89 89
 			$localeItem = $localeManager->createItem();
90 90
 		}
91 91
 
Please login to merge, or discard this patch.