Completed
Push — master ( c159b3...130612 )
by Aimeos
04:42
created
Controller/JsonadmController.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -31,15 +31,15 @@  discard block
 block discarded – undo
31 31
 	 * @param string $site Unique site code
32 32
 	 * @return \Symfony\Component\HttpFoundation\Response Response object containing the generated output
33 33
 	 */
34
-	public function deleteAction( Request $request, $resource, $site = 'default' )
34
+	public function deleteAction(Request $request, $resource, $site = 'default')
35 35
 	{
36 36
 		$status = 500;
37 37
 		$header = $request->headers->all();
38 38
 
39
-		$client = $this->createClient( $site, $resource, $request->get( 'lang', 'en' ) );
40
-		$result = $client->delete( $request->getContent(), $header, $status );
39
+		$client = $this->createClient($site, $resource, $request->get('lang', 'en'));
40
+		$result = $client->delete($request->getContent(), $header, $status);
41 41
 
42
-		return $this->createResponse( $result, $status, $header );
42
+		return $this->createResponse($result, $status, $header);
43 43
 	}
44 44
 
45 45
 
@@ -51,15 +51,15 @@  discard block
 block discarded – undo
51 51
 	 * @param string $site Unique site code
52 52
 	 * @return \Symfony\Component\HttpFoundation\Response Response object containing the generated output
53 53
 	 */
54
-	public function getAction( Request $request, $resource, $site = 'default' )
54
+	public function getAction(Request $request, $resource, $site = 'default')
55 55
 	{
56 56
 		$status = 500;
57 57
 		$header = $request->headers->all();
58 58
 
59
-		$client = $this->createClient( $site, $resource, $request->get( 'lang', 'en' ) );
60
-		$result = $client->get( $request->getContent(), $header, $status );
59
+		$client = $this->createClient($site, $resource, $request->get('lang', 'en'));
60
+		$result = $client->get($request->getContent(), $header, $status);
61 61
 
62
-		return $this->createResponse( $result, $status, $header );
62
+		return $this->createResponse($result, $status, $header);
63 63
 	}
64 64
 
65 65
 
@@ -71,15 +71,15 @@  discard block
 block discarded – undo
71 71
 	 * @param string $site Unique site code
72 72
 	 * @return \Symfony\Component\HttpFoundation\Response Response object containing the generated output
73 73
 	 */
74
-	public function patchAction( Request $request, $resource, $site = 'default' )
74
+	public function patchAction(Request $request, $resource, $site = 'default')
75 75
 	{
76 76
 		$status = 500;
77 77
 		$header = $request->headers->all();
78 78
 
79
-		$client = $this->createClient( $site, $resource, $request->get( 'lang', 'en' ) );
80
-		$result = $client->patch( $request->getContent(), $header, $status );
79
+		$client = $this->createClient($site, $resource, $request->get('lang', 'en'));
80
+		$result = $client->patch($request->getContent(), $header, $status);
81 81
 
82
-		return $this->createResponse( $result, $status, $header );
82
+		return $this->createResponse($result, $status, $header);
83 83
 	}
84 84
 
85 85
 
@@ -91,15 +91,15 @@  discard block
 block discarded – undo
91 91
 	 * @param string $site Unique site code
92 92
 	 * @return \Symfony\Component\HttpFoundation\Response Response object containing the generated output
93 93
 	 */
94
-	public function postAction( Request $request, $resource, $site = 'default' )
94
+	public function postAction(Request $request, $resource, $site = 'default')
95 95
 	{
96 96
 		$status = 500;
97 97
 		$header = $request->headers->all();
98 98
 
99
-		$client = $this->createClient( $site, $resource, $request->get( 'lang', 'en' ) );
100
-		$result = $client->post( $request->getContent(), $header, $status );
99
+		$client = $this->createClient($site, $resource, $request->get('lang', 'en'));
100
+		$result = $client->post($request->getContent(), $header, $status);
101 101
 
102
-		return $this->createResponse( $result, $status, $header );
102
+		return $this->createResponse($result, $status, $header);
103 103
 	}
104 104
 
105 105
 
@@ -111,15 +111,15 @@  discard block
 block discarded – undo
111 111
 	 * @param string $site Unique site code
112 112
 	 * @return \Symfony\Component\HttpFoundation\Response Response object containing the generated output
113 113
 	 */
114
-	public function putAction( Request $request, $resource, $site = 'default' )
114
+	public function putAction(Request $request, $resource, $site = 'default')
115 115
 	{
116 116
 		$status = 500;
117 117
 		$header = $request->headers->all();
118 118
 
119
-		$client = $this->createClient( $site, $resource, $request->get( 'lang', 'en' ) );
120
-		$result = $client->put( $request->getContent(), $header, $status );
119
+		$client = $this->createClient($site, $resource, $request->get('lang', 'en'));
120
+		$result = $client->put($request->getContent(), $header, $status);
121 121
 
122
-		return $this->createResponse( $result, $status, $header );
122
+		return $this->createResponse($result, $status, $header);
123 123
 	}
124 124
 
125 125
 
@@ -131,15 +131,15 @@  discard block
 block discarded – undo
131 131
 	 * @param string $site Unique site code
132 132
 	 * @return \Symfony\Component\HttpFoundation\Response Response object containing the generated output
133 133
 	 */
134
-	public function optionsAction( Request $request, $resource = '', $site = 'default' )
134
+	public function optionsAction(Request $request, $resource = '', $site = 'default')
135 135
 	{
136 136
 		$status = 500;
137 137
 		$header = $request->headers->all();
138 138
 
139
-		$client = $this->createClient( $site, $resource, $request->get( 'lang', 'en' ) );
140
-		$result = $client->options( $request->getContent(), $header, $status );
139
+		$client = $this->createClient($site, $resource, $request->get('lang', 'en'));
140
+		$result = $client->options($request->getContent(), $header, $status);
141 141
 
142
-		return $this->createResponse( $result, $status, $header );
142
+		return $this->createResponse($result, $status, $header);
143 143
 	}
144 144
 
145 145
 
@@ -151,19 +151,19 @@  discard block
 block discarded – undo
151 151
 	 * @param string $lang Language code
152 152
 	 * @return \Aimeos\MShop\Context\Item\Iface Context item
153 153
 	 */
154
-	protected function createClient( $site, $resource, $lang )
154
+	protected function createClient($site, $resource, $lang)
155 155
 	{
156
-		$aimeos = $this->get( 'aimeos' )->get();
157
-		$templatePaths = $aimeos->getCustomPaths( 'admin/jsonadm/templates' );
156
+		$aimeos = $this->get('aimeos')->get();
157
+		$templatePaths = $aimeos->getCustomPaths('admin/jsonadm/templates');
158 158
 
159
-		$context = $this->get( 'aimeos_context' )->get( false, 'backend' );
160
-		$context->setI18n( $this->get('aimeos_i18n')->get( array( $lang, 'en' ) ) );
161
-		$context->setLocale( $this->get('aimeos_locale')->getBackend( $context, $site ) );
159
+		$context = $this->get('aimeos_context')->get(false, 'backend');
160
+		$context->setI18n($this->get('aimeos_i18n')->get(array($lang, 'en')));
161
+		$context->setLocale($this->get('aimeos_locale')->getBackend($context, $site));
162 162
 
163
-		$view = $this->get('aimeos_view')->create( $context, $templatePaths, $lang );
164
-		$context->setView( $view );
163
+		$view = $this->get('aimeos_view')->create($context, $templatePaths, $lang);
164
+		$context->setView($view);
165 165
 
166
-		return \Aimeos\Admin\JsonAdm\Factory::createClient( $context, $templatePaths, $resource );
166
+		return \Aimeos\Admin\JsonAdm\Factory::createClient($context, $templatePaths, $resource);
167 167
 	}
168 168
 
169 169
 
@@ -175,14 +175,14 @@  discard block
 block discarded – undo
175 175
 	 * @param array $header List of HTTP headers
176 176
 	 * @return Response HTTP response object
177 177
 	 */
178
-	protected function createResponse( $content, $status, array $header )
178
+	protected function createResponse($content, $status, array $header)
179 179
 	{
180 180
 		$response = new Response();
181
-		$response->setContent( $content );
182
-		$response->setStatusCode( $status );
181
+		$response->setContent($content);
182
+		$response->setStatusCode($status);
183 183
 
184
-		foreach( $header as $key => $value ) {
185
-			$response->headers->set( $key, $value );
184
+		foreach ($header as $key => $value) {
185
+			$response->headers->set($key, $value);
186 186
 		}
187 187
 
188 188
 		return $response;
Please login to merge, or discard this patch.
Controller/ExtadmController.php 1 patch
Spacing   +66 added lines, -66 removed lines patch added patch discarded remove patch
@@ -30,63 +30,63 @@  discard block
 block discarded – undo
30 30
 	 * @param Request $request Symfony request object
31 31
 	 * @return Response Generated output for the admin interface
32 32
 	 */
33
-	public function indexAction( Request $request )
33
+	public function indexAction(Request $request)
34 34
 	{
35
-		$site = $request->attributes->get( 'site', $request->query->get( 'site', 'default' ) );
36
-		$lang = $request->attributes->get( 'lang', $request->query->get( 'lang', 'en' ) );
37
-		$tab = $request->attributes->get( 'tab', $request->query->get( 'tab', 0 ) );
35
+		$site = $request->attributes->get('site', $request->query->get('site', 'default'));
36
+		$lang = $request->attributes->get('lang', $request->query->get('lang', 'en'));
37
+		$tab = $request->attributes->get('tab', $request->query->get('tab', 0));
38 38
 
39
-		$context = $this->get( 'aimeos_context' )->get( false, 'backend' );
40
-		$context->setLocale( $this->get( 'aimeos_locale' )->getBackend( $context, $site ) );
39
+		$context = $this->get('aimeos_context')->get(false, 'backend');
40
+		$context->setLocale($this->get('aimeos_locale')->getBackend($context, $site));
41 41
 
42
-		$aimeos = $this->get( 'aimeos' );
42
+		$aimeos = $this->get('aimeos');
43 43
 		$bootstrap = $aimeos->get();
44 44
 
45
-		$cntlPaths = $bootstrap->getCustomPaths( 'controller/extjs' );
46
-		$controller = new \Aimeos\Controller\ExtJS\JsonRpc( $context, $cntlPaths );
45
+		$cntlPaths = $bootstrap->getCustomPaths('controller/extjs');
46
+		$controller = new \Aimeos\Controller\ExtJS\JsonRpc($context, $cntlPaths);
47 47
 		$cssFiles = array();
48 48
 
49
-		foreach( $bootstrap->getCustomPaths( 'admin/extjs' ) as $base => $paths )
49
+		foreach ($bootstrap->getCustomPaths('admin/extjs') as $base => $paths)
50 50
 		{
51
-			foreach( $paths as $path )
51
+			foreach ($paths as $path)
52 52
 			{
53
-				$jsbAbsPath = $base . '/' . $path;
53
+				$jsbAbsPath = $base.'/'.$path;
54 54
 
55
-				if( !is_file( $jsbAbsPath ) ) {
56
-					throw new \Exception( sprintf( 'JSB2 file "%1$s" not found', $jsbAbsPath ) );
55
+				if (!is_file($jsbAbsPath)) {
56
+					throw new \Exception(sprintf('JSB2 file "%1$s" not found', $jsbAbsPath));
57 57
 				}
58 58
 
59
-				$jsb2 = new \Aimeos\MW\Jsb2\Standard( $jsbAbsPath, dirname( $path ) );
60
-				$cssFiles = array_merge( $cssFiles, $jsb2->getUrls( 'css' ) );
59
+				$jsb2 = new \Aimeos\MW\Jsb2\Standard($jsbAbsPath, dirname($path));
60
+				$cssFiles = array_merge($cssFiles, $jsb2->getUrls('css'));
61 61
 			}
62 62
 		}
63 63
 
64
-		$params = array( 'site' => '{site}', 'lang' => '{lang}', 'tab' => '{tab}' );
65
-		$adminUrl = $this->generateUrl( 'aimeos_shop_extadm', $params );
64
+		$params = array('site' => '{site}', 'lang' => '{lang}', 'tab' => '{tab}');
65
+		$adminUrl = $this->generateUrl('aimeos_shop_extadm', $params);
66 66
 
67
-		$token = $this->get( 'security.csrf.token_manager' )->getToken( 'aimeos_admin_token' )->getValue();
68
-		$jsonUrl = $this->generateUrl( 'aimeos_shop_extadm_json', array( '_token' => $token, 'site' => $site ) );
67
+		$token = $this->get('security.csrf.token_manager')->getToken('aimeos_admin_token')->getValue();
68
+		$jsonUrl = $this->generateUrl('aimeos_shop_extadm_json', array('_token' => $token, 'site' => $site));
69 69
 
70
-		$jqadmUrl = $this->generateUrl( 'aimeos_shop_jqadm_search', array( 'site' => $site, 'resource' => 'product' ) );
70
+		$jqadmUrl = $this->generateUrl('aimeos_shop_jqadm_search', array('site' => $site, 'resource' => 'product'));
71 71
 
72 72
 		$vars = array(
73 73
 			'lang' => $lang,
74 74
 			'cssFiles' => $cssFiles,
75 75
 			'languages' => $this->getJsonLanguages(),
76
-			'config' => $this->getJsonClientConfig( $context ),
77
-			'site' => $this->getJsonSiteItem( $context, $site ),
78
-			'i18nContent' => $this->getJsonClientI18n( $bootstrap->getI18nPaths(), $lang ),
76
+			'config' => $this->getJsonClientConfig($context),
77
+			'site' => $this->getJsonSiteItem($context, $site),
78
+			'i18nContent' => $this->getJsonClientI18n($bootstrap->getI18nPaths(), $lang),
79 79
 			'searchSchemas' => $controller->getJsonSearchSchemas(),
80 80
 			'itemSchemas' => $controller->getJsonItemSchemas(),
81
-			'smd' => $controller->getJsonSmd( $jsonUrl ),
82
-			'urlTemplate' => urldecode( $adminUrl ),
83
-			'uploaddir' => $this->container->getParameter( 'aimeos_shop.uploaddir' ),
81
+			'smd' => $controller->getJsonSmd($jsonUrl),
82
+			'urlTemplate' => urldecode($adminUrl),
83
+			'uploaddir' => $this->container->getParameter('aimeos_shop.uploaddir'),
84 84
 			'version' => $aimeos->getVersion(),
85 85
 			'jqadmurl' => $jqadmUrl,
86 86
 			'activeTab' => $tab,
87 87
 		);
88 88
 
89
-		return $this->render( 'AimeosShopBundle:Extadm:index.html.twig', $vars );
89
+		return $this->render('AimeosShopBundle:Extadm:index.html.twig', $vars);
90 90
 	}
91 91
 
92 92
 
@@ -96,23 +96,23 @@  discard block
 block discarded – undo
96 96
 	 * @param Request $request Symfony request object
97 97
 	 * @return Response JSON RPC message response
98 98
 	 */
99
-	public function doAction( Request $request )
99
+	public function doAction(Request $request)
100 100
 	{
101 101
 		$csrfProvider = $this->get('security.csrf.token_manager');
102 102
 
103
-		if( $csrfProvider->isTokenValid( new CsrfToken( 'aimeos_admin_token',  $request->query->get( '_token' ) ) ) !== true ) {
104
-			throw new \Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException( 'CSRF token is invalid' );
103
+		if ($csrfProvider->isTokenValid(new CsrfToken('aimeos_admin_token', $request->query->get('_token'))) !== true) {
104
+			throw new \Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException('CSRF token is invalid');
105 105
 		}
106 106
 
107
-		$cntlPaths = $this->get( 'aimeos' )->get()->getCustomPaths( 'controller/extjs' );
108
-		$context = $this->get( 'aimeos_context' )->get( false, 'backend' );
109
-		$context->setView( $this->get( 'aimeos_view' )->create( $context, array() ) );
110
-		$context->setLocale( $this->get( 'aimeos_locale' )->getBackend( $context, 'default' ) );
107
+		$cntlPaths = $this->get('aimeos')->get()->getCustomPaths('controller/extjs');
108
+		$context = $this->get('aimeos_context')->get(false, 'backend');
109
+		$context->setView($this->get('aimeos_view')->create($context, array()));
110
+		$context->setLocale($this->get('aimeos_locale')->getBackend($context, 'default'));
111 111
 
112
-		$controller = new \Aimeos\Controller\ExtJS\JsonRpc( $context, $cntlPaths );
112
+		$controller = new \Aimeos\Controller\ExtJS\JsonRpc($context, $cntlPaths);
113 113
 
114
-		$response = $controller->process( $request->request->all(), $request->getContent() );
115
-		return $this->render( 'AimeosShopBundle:Extadm:do.html.twig', array( 'output' => $response ) );
114
+		$response = $controller->process($request->request->all(), $request->getContent());
115
+		return $this->render('AimeosShopBundle:Extadm:do.html.twig', array('output' => $response));
116 116
 	}
117 117
 
118 118
 
@@ -125,27 +125,27 @@  discard block
 block discarded – undo
125 125
 	{
126 126
 		$contents = '';
127 127
 		$jsFiles = array();
128
-		$aimeos = $this->get( 'aimeos' )->get();
128
+		$aimeos = $this->get('aimeos')->get();
129 129
 
130
-		foreach( $aimeos->getCustomPaths( 'admin/extjs' ) as $base => $paths )
130
+		foreach ($aimeos->getCustomPaths('admin/extjs') as $base => $paths)
131 131
 		{
132
-			foreach( $paths as $path )
132
+			foreach ($paths as $path)
133 133
 			{
134
-				$jsbAbsPath = $base . '/' . $path;
135
-				$jsb2 = new \Aimeos\MW\Jsb2\Standard( $jsbAbsPath, dirname( $jsbAbsPath ) );
136
-				$jsFiles = array_merge( $jsFiles, $jsb2->getFiles( 'js' ) );
134
+				$jsbAbsPath = $base.'/'.$path;
135
+				$jsb2 = new \Aimeos\MW\Jsb2\Standard($jsbAbsPath, dirname($jsbAbsPath));
136
+				$jsFiles = array_merge($jsFiles, $jsb2->getFiles('js'));
137 137
 			}
138 138
 		}
139 139
 
140
-		foreach( $jsFiles as $file )
140
+		foreach ($jsFiles as $file)
141 141
 		{
142
-			if( ( $content = file_get_contents( $file ) ) !== false ) {
142
+			if (($content = file_get_contents($file)) !== false) {
143 143
 				$contents .= $content;
144 144
 			}
145 145
 		}
146 146
 
147
-		$response = new Response( $contents );
148
-		$response->headers->set( 'Content-Type', 'application/javascript' );
147
+		$response = new Response($contents);
148
+		$response->headers->set('Content-Type', 'application/javascript');
149 149
 
150 150
 		return $response;
151 151
 	}
@@ -160,11 +160,11 @@  discard block
 block discarded – undo
160 160
 	{
161 161
 		$result = array();
162 162
 
163
-		foreach( $this->get( 'aimeos' )->get()->getI18nList( 'admin' ) as $id ) {
164
-			$result[] = array( 'id' => $id, 'label' => $id );
163
+		foreach ($this->get('aimeos')->get()->getI18nList('admin') as $id) {
164
+			$result[] = array('id' => $id, 'label' => $id);
165 165
 		}
166 166
 
167
-		return json_encode( $result );
167
+		return json_encode($result);
168 168
 	}
169 169
 
170 170
 
@@ -174,10 +174,10 @@  discard block
 block discarded – undo
174 174
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context item object
175 175
 	 * @return string JSON encoded configuration object
176 176
 	 */
177
-	protected function getJsonClientConfig( \Aimeos\MShop\Context\Item\Iface $context )
177
+	protected function getJsonClientConfig(\Aimeos\MShop\Context\Item\Iface $context)
178 178
 	{
179
-		$config = $context->getConfig()->get( 'admin/extjs', array() );
180
-		return json_encode( array( 'admin' => array( 'extjs' => $config ) ), JSON_FORCE_OBJECT );
179
+		$config = $context->getConfig()->get('admin/extjs', array());
180
+		return json_encode(array('admin' => array('extjs' => $config)), JSON_FORCE_OBJECT);
181 181
 	}
182 182
 
183 183
 
@@ -188,16 +188,16 @@  discard block
 block discarded – undo
188 188
 	 * @param string $lang ISO language code like "en" or "en_GB"
189 189
 	 * @return string JSON encoded translation object
190 190
 	 */
191
-	protected function getJsonClientI18n( array $i18nPaths, $lang )
191
+	protected function getJsonClientI18n(array $i18nPaths, $lang)
192 192
 	{
193
-		$i18n = new \Aimeos\MW\Translation\Gettext( $i18nPaths, $lang );
193
+		$i18n = new \Aimeos\MW\Translation\Gettext($i18nPaths, $lang);
194 194
 
195 195
 		$content = array(
196
-			'admin' => $i18n->getAll( 'admin' ),
197
-			'admin/ext' => $i18n->getAll( 'admin/ext' ),
196
+			'admin' => $i18n->getAll('admin'),
197
+			'admin/ext' => $i18n->getAll('admin/ext'),
198 198
 		);
199 199
 
200
-		return json_encode( $content, JSON_FORCE_OBJECT );
200
+		return json_encode($content, JSON_FORCE_OBJECT);
201 201
 	}
202 202
 
203 203
 
@@ -209,18 +209,18 @@  discard block
 block discarded – undo
209 209
 	 * @return string JSON encoded site item object
210 210
 	 * @throws Exception If no site item was found for the code
211 211
 	 */
212
-	protected function getJsonSiteItem( \Aimeos\MShop\Context\Item\Iface $context, $site )
212
+	protected function getJsonSiteItem(\Aimeos\MShop\Context\Item\Iface $context, $site)
213 213
 	{
214
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'locale/site' );
214
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'locale/site');
215 215
 
216 216
 		$criteria = $manager->createSearch();
217
-		$criteria->setConditions( $criteria->compare( '==', 'locale.site.code', $site ) );
218
-		$items = $manager->searchItems( $criteria );
217
+		$criteria->setConditions($criteria->compare('==', 'locale.site.code', $site));
218
+		$items = $manager->searchItems($criteria);
219 219
 
220
-		if( ( $item = reset( $items ) ) === false ) {
221
-			throw new \Exception( sprintf( 'No site found for code "%1$s"', $site ) );
220
+		if (($item = reset($items)) === false) {
221
+			throw new \Exception(sprintf('No site found for code "%1$s"', $site));
222 222
 		}
223 223
 
224
-		return json_encode( $item->toArray() );
224
+		return json_encode($item->toArray());
225 225
 	}
226 226
 }
Please login to merge, or discard this patch.
Controller/JqadmController.php 1 patch
Spacing   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -29,35 +29,35 @@  discard block
 block discarded – undo
29 29
 	 * @param $type File type, i.e. "css" or "js"
30 30
 	 * @return Response Response object
31 31
 	 */
32
-	public function fileAction( $type )
32
+	public function fileAction($type)
33 33
 	{
34 34
 		$contents = '';
35 35
 		$files = array();
36
-		$aimeos = $this->get( 'aimeos' )->get();
36
+		$aimeos = $this->get('aimeos')->get();
37 37
 
38
-		foreach( $aimeos->getCustomPaths( 'admin/jqadm' ) as $base => $paths )
38
+		foreach ($aimeos->getCustomPaths('admin/jqadm') as $base => $paths)
39 39
 		{
40
-			foreach( $paths as $path )
40
+			foreach ($paths as $path)
41 41
 			{
42
-				$jsbAbsPath = $base . '/' . $path;
43
-				$jsb2 = new \Aimeos\MW\Jsb2\Standard( $jsbAbsPath, dirname( $jsbAbsPath ) );
44
-				$files = array_merge( $files, $jsb2->getFiles( $type ) );
42
+				$jsbAbsPath = $base.'/'.$path;
43
+				$jsb2 = new \Aimeos\MW\Jsb2\Standard($jsbAbsPath, dirname($jsbAbsPath));
44
+				$files = array_merge($files, $jsb2->getFiles($type));
45 45
 			}
46 46
 		}
47 47
 
48
-		foreach( $files as $file )
48
+		foreach ($files as $file)
49 49
 		{
50
-			if( ( $content = file_get_contents( $file ) ) !== false ) {
50
+			if (($content = file_get_contents($file)) !== false) {
51 51
 				$contents .= $content;
52 52
 			}
53 53
 		}
54 54
 
55
-		$response = new Response( $contents );
55
+		$response = new Response($contents);
56 56
 
57
-		if( $type === 'js' ) {
58
-			$response->headers->set( 'Content-Type', 'application/javascript' );
59
-		} elseif( $type === 'css' ) {
60
-			$response->headers->set( 'Content-Type', 'text/css' );
57
+		if ($type === 'js') {
58
+			$response->headers->set('Content-Type', 'application/javascript');
59
+		} elseif ($type === 'css') {
60
+			$response->headers->set('Content-Type', 'text/css');
61 61
 		}
62 62
 
63 63
 		return $response;
@@ -72,10 +72,10 @@  discard block
 block discarded – undo
72 72
 	 * @param string $site Unique site code
73 73
 	 * @return Response Generated output
74 74
 	 */
75
-	public function copyAction( Request $request, $resource, $site = 'default' )
75
+	public function copyAction(Request $request, $resource, $site = 'default')
76 76
 	{
77
-		$cntl = $this->createClient( $request, $site, $resource );
78
-		return $this->getHtml( $cntl->copy() );
77
+		$cntl = $this->createClient($request, $site, $resource);
78
+		return $this->getHtml($cntl->copy());
79 79
 	}
80 80
 
81 81
 
@@ -87,10 +87,10 @@  discard block
 block discarded – undo
87 87
 	 * @param string $site Unique site code
88 88
 	 * @return Response Generated output
89 89
 	 */
90
-	public function createAction( Request $request, $resource, $site = 'default' )
90
+	public function createAction(Request $request, $resource, $site = 'default')
91 91
 	{
92
-		$cntl = $this->createClient( $request, $site, $resource );
93
-		return $this->getHtml( $cntl->create() );
92
+		$cntl = $this->createClient($request, $site, $resource);
93
+		return $this->getHtml($cntl->create());
94 94
 	}
95 95
 
96 96
 
@@ -102,10 +102,10 @@  discard block
 block discarded – undo
102 102
 	 * @param string $site Unique site code
103 103
 	 * @return Response Generated output
104 104
 	 */
105
-	public function deleteAction( Request $request, $resource, $site = 'default' )
105
+	public function deleteAction(Request $request, $resource, $site = 'default')
106 106
 	{
107
-		$cntl = $this->createClient( $request, $site, $resource );
108
-		return $this->getHtml( $cntl->delete() . $cntl->search() );
107
+		$cntl = $this->createClient($request, $site, $resource);
108
+		return $this->getHtml($cntl->delete().$cntl->search());
109 109
 	}
110 110
 
111 111
 
@@ -117,10 +117,10 @@  discard block
 block discarded – undo
117 117
 	 * @param string $site Unique site code
118 118
 	 * @return Response Generated output
119 119
 	 */
120
-	public function getAction( Request $request, $resource, $site = 'default' )
120
+	public function getAction(Request $request, $resource, $site = 'default')
121 121
 	{
122
-		$cntl = $this->createClient( $request, $site, $resource );
123
-		return $this->getHtml( $cntl->get() );
122
+		$cntl = $this->createClient($request, $site, $resource);
123
+		return $this->getHtml($cntl->get());
124 124
 	}
125 125
 
126 126
 
@@ -132,10 +132,10 @@  discard block
 block discarded – undo
132 132
 	 * @param string $site Unique site code
133 133
 	 * @return Response Generated output
134 134
 	 */
135
-	public function saveAction( Request $request, $resource, $site = 'default' )
135
+	public function saveAction(Request $request, $resource, $site = 'default')
136 136
 	{
137
-		$cntl = $this->createClient( $request, $site, $resource );
138
-		return $this->getHtml( ( $cntl->save() ? : $cntl->search() ) );
137
+		$cntl = $this->createClient($request, $site, $resource);
138
+		return $this->getHtml(($cntl->save() ?: $cntl->search()));
139 139
 	}
140 140
 
141 141
 
@@ -147,10 +147,10 @@  discard block
 block discarded – undo
147 147
 	 * @param string $site Unique site code
148 148
 	 * @return Response Generated output
149 149
 	 */
150
-	public function searchAction( Request $request, $resource, $site = 'default' )
150
+	public function searchAction(Request $request, $resource, $site = 'default')
151 151
 	{
152
-		$cntl = $this->createClient( $request, $site, $resource );
153
-		return $this->getHtml( $cntl->search() );
152
+		$cntl = $this->createClient($request, $site, $resource);
153
+		return $this->getHtml($cntl->search());
154 154
 	}
155 155
 
156 156
 
@@ -162,21 +162,21 @@  discard block
 block discarded – undo
162 162
 	 * @param string $resource Resource location, e.g. "product"
163 163
 	 * @return \Aimeos\Admin\JQAdm\Iface Context item
164 164
 	 */
165
-	protected function createClient( Request $request, $site, $resource )
165
+	protected function createClient(Request $request, $site, $resource)
166 166
 	{
167
-		$lang = $request->get( 'lang', 'en' );
167
+		$lang = $request->get('lang', 'en');
168 168
 
169
-		$aimeos = $this->get( 'aimeos' )->get();
170
-		$templatePaths = $aimeos->getCustomPaths( 'admin/jqadm/templates' );
169
+		$aimeos = $this->get('aimeos')->get();
170
+		$templatePaths = $aimeos->getCustomPaths('admin/jqadm/templates');
171 171
 
172
-		$context = $this->get( 'aimeos_context' )->get( false, 'backend' );
173
-		$context->setI18n( $this->get( 'aimeos_i18n' )->get( array( $lang, 'en' ) ) );
174
-		$context->setLocale( $this->get( 'aimeos_locale' )->getBackend( $context, $site ) );
172
+		$context = $this->get('aimeos_context')->get(false, 'backend');
173
+		$context->setI18n($this->get('aimeos_i18n')->get(array($lang, 'en')));
174
+		$context->setLocale($this->get('aimeos_locale')->getBackend($context, $site));
175 175
 
176
-		$view = $this->get( 'aimeos_view' )->create( $context, $templatePaths, $lang );
177
-		$context->setView( $view );
176
+		$view = $this->get('aimeos_view')->create($context, $templatePaths, $lang);
177
+		$context->setView($view);
178 178
 
179
-		return \Aimeos\Admin\JQAdm\Factory::createClient( $context, $templatePaths, $resource );
179
+		return \Aimeos\Admin\JQAdm\Factory::createClient($context, $templatePaths, $resource);
180 180
 	}
181 181
 
182 182
 
@@ -186,11 +186,11 @@  discard block
 block discarded – undo
186 186
 	 * @param string $content Content from admin client
187 187
 	 * @return Response View for rendering the output
188 188
 	 */
189
-	protected function getHtml( $content )
189
+	protected function getHtml($content)
190 190
 	{
191
-		$version = $this->get( 'aimeos' )->getVersion();
192
-		$content = str_replace( array( '{type}', '{version}' ), array( 'Symfony', $version ), $content );
191
+		$version = $this->get('aimeos')->getVersion();
192
+		$content = str_replace(array('{type}', '{version}'), array('Symfony', $version), $content);
193 193
 
194
-		return $this->render( 'AimeosShopBundle:Jqadm:index.html.twig', array( 'content' => $content ) );
194
+		return $this->render('AimeosShopBundle:Jqadm:index.html.twig', array('content' => $content));
195 195
 	}
196 196
 }
Please login to merge, or discard this patch.
Service/View.php 1 patch
Spacing   +57 added lines, -57 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 	 * @param RequestStack $requestStack Current request stack
33 33
 	 * @param Container $container Container object to access parameters
34 34
 	 */
35
-	public function __construct( RequestStack $requestStack, Container $container )
35
+	public function __construct(RequestStack $requestStack, Container $container)
36 36
 	{
37 37
 		$this->requestStack = $requestStack;
38 38
 		$this->container = $container;
@@ -47,20 +47,20 @@  discard block
 block discarded – undo
47 47
 	 * @param string|null $locale Code of the current language or null for no translation
48 48
 	 * @return \Aimeos\MW\View\Iface View object
49 49
 	 */
50
-	public function create( \Aimeos\MShop\Context\Item\Iface $context, array $templatePaths, $locale = null )
50
+	public function create(\Aimeos\MShop\Context\Item\Iface $context, array $templatePaths, $locale = null)
51 51
 	{
52 52
 		$config = $context->getConfig();
53
-		$view = new \Aimeos\MW\View\Standard( $templatePaths );
54
-
55
-		$this->addCsrf( $view );
56
-		$this->addAccess( $view, $context );
57
-		$this->addConfig( $view, $config );
58
-		$this->addNumber( $view, $config );
59
-		$this->addParam( $view );
60
-		$this->addRequest( $view );
61
-		$this->addResponse( $view );
62
-		$this->addTranslate( $view, $locale );
63
-		$this->addUrl( $view );
53
+		$view = new \Aimeos\MW\View\Standard($templatePaths);
54
+
55
+		$this->addCsrf($view);
56
+		$this->addAccess($view, $context);
57
+		$this->addConfig($view, $config);
58
+		$this->addNumber($view, $config);
59
+		$this->addParam($view);
60
+		$this->addRequest($view);
61
+		$this->addResponse($view);
62
+		$this->addTranslate($view, $locale);
63
+		$this->addUrl($view);
64 64
 
65 65
 		return $view;
66 66
 	}
@@ -73,17 +73,17 @@  discard block
 block discarded – undo
73 73
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context object
74 74
 	 * @return \Aimeos\MW\View\Iface Modified view object
75 75
 	 */
76
-	protected function addAccess( \Aimeos\MW\View\Iface $view, \Aimeos\MShop\Context\Item\Iface $context )
76
+	protected function addAccess(\Aimeos\MW\View\Iface $view, \Aimeos\MShop\Context\Item\Iface $context)
77 77
 	{
78 78
 		$container = $this->container;
79 79
 
80
-		$fcn = function() use ( $container, $context )
80
+		$fcn = function() use ($container, $context)
81 81
 		{
82
-			return $container->get( 'aimeos_support' )->getGroups( $context );
82
+			return $container->get('aimeos_support')->getGroups($context);
83 83
 		};
84 84
 
85
-		$helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, $fcn );
86
-		$view->addHelper( 'access', $helper );
85
+		$helper = new \Aimeos\MW\View\Helper\Access\Standard($view, $fcn);
86
+		$view->addHelper('access', $helper);
87 87
 
88 88
 		return $view;
89 89
 	}
@@ -96,11 +96,11 @@  discard block
 block discarded – undo
96 96
 	 * @param \Aimeos\MW\Config\Iface $config Configuration object
97 97
 	 * @return \Aimeos\MW\View\Iface Modified view object
98 98
 	 */
99
-	protected function addConfig( \Aimeos\MW\View\Iface $view, \Aimeos\MW\Config\Iface $config )
99
+	protected function addConfig(\Aimeos\MW\View\Iface $view, \Aimeos\MW\Config\Iface $config)
100 100
 	{
101
-		$config = new \Aimeos\MW\Config\Decorator\Protect( clone $config, array( 'admin', 'client' ) );
102
-		$helper = new \Aimeos\MW\View\Helper\Config\Standard( $view, $config );
103
-		$view->addHelper( 'config', $helper );
101
+		$config = new \Aimeos\MW\Config\Decorator\Protect(clone $config, array('admin', 'client'));
102
+		$helper = new \Aimeos\MW\View\Helper\Config\Standard($view, $config);
103
+		$view->addHelper('config', $helper);
104 104
 
105 105
 		return $view;
106 106
 	}
@@ -112,11 +112,11 @@  discard block
 block discarded – undo
112 112
 	 * @param \Aimeos\MW\View\Iface $view View object
113 113
 	 * @return \Aimeos\MW\View\Iface Modified view object
114 114
 	 */
115
-	protected function addCsrf( \Aimeos\MW\View\Iface $view )
115
+	protected function addCsrf(\Aimeos\MW\View\Iface $view)
116 116
 	{
117
-		$token = $this->container->get( 'security.csrf.token_manager' )->getToken( '_token' );
118
-		$helper = new \Aimeos\MW\View\Helper\Csrf\Standard( $view, '_token', $token->getValue() );
119
-		$view->addHelper( 'csrf', $helper );
117
+		$token = $this->container->get('security.csrf.token_manager')->getToken('_token');
118
+		$helper = new \Aimeos\MW\View\Helper\Csrf\Standard($view, '_token', $token->getValue());
119
+		$view->addHelper('csrf', $helper);
120 120
 
121 121
 		return $view;
122 122
 	}
@@ -129,14 +129,14 @@  discard block
 block discarded – undo
129 129
 	 * @param \Aimeos\MW\Config\Iface $config Configuration object
130 130
 	 * @return \Aimeos\MW\View\Iface Modified view object
131 131
 	 */
132
-	protected function addNumber( \Aimeos\MW\View\Iface $view, \Aimeos\MW\Config\Iface $config )
132
+	protected function addNumber(\Aimeos\MW\View\Iface $view, \Aimeos\MW\Config\Iface $config)
133 133
 	{
134
-		$sepDec = $config->get( 'client/html/common/format/seperatorDecimal', '.' );
135
-		$sep1000 = $config->get( 'client/html/common/format/seperator1000', ' ' );
136
-		$decimals = $config->get( 'client/html/common/format/decimals', 2 );
134
+		$sepDec = $config->get('client/html/common/format/seperatorDecimal', '.');
135
+		$sep1000 = $config->get('client/html/common/format/seperator1000', ' ');
136
+		$decimals = $config->get('client/html/common/format/decimals', 2);
137 137
 
138
-		$helper = new \Aimeos\MW\View\Helper\Number\Standard( $view, $sepDec, $sep1000, $decimals );
139
-		$view->addHelper( 'number', $helper );
138
+		$helper = new \Aimeos\MW\View\Helper\Number\Standard($view, $sepDec, $sep1000, $decimals);
139
+		$view->addHelper('number', $helper);
140 140
 
141 141
 		return $view;
142 142
 	}
@@ -148,17 +148,17 @@  discard block
 block discarded – undo
148 148
 	 * @param \Aimeos\MW\View\Iface $view View object
149 149
 	 * @return \Aimeos\MW\View\Iface Modified view object
150 150
 	 */
151
-	protected function addParam( \Aimeos\MW\View\Iface $view )
151
+	protected function addParam(\Aimeos\MW\View\Iface $view)
152 152
 	{
153 153
 		$params = array();
154 154
 		$request = $this->requestStack->getMasterRequest();
155 155
 
156
-		if( $request !== null ) {
157
-			$params = $request->request->all() + $request->query->all() + $request->attributes->get( '_route_params' );
156
+		if ($request !== null) {
157
+			$params = $request->request->all() + $request->query->all() + $request->attributes->get('_route_params');
158 158
 		}
159 159
 
160
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $params );
161
-		$view->addHelper( 'param', $helper );
160
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $params);
161
+		$view->addHelper('param', $helper);
162 162
 
163 163
 		return $view;
164 164
 	}
@@ -170,14 +170,14 @@  discard block
 block discarded – undo
170 170
 	 * @param \Aimeos\MW\View\Iface $view View object
171 171
 	 * @return \Aimeos\MW\View\Iface Modified view object
172 172
 	 */
173
-	protected function addRequest( \Aimeos\MW\View\Iface $view )
173
+	protected function addRequest(\Aimeos\MW\View\Iface $view)
174 174
 	{
175 175
 		$request = $this->requestStack->getMasterRequest();
176 176
 
177
-		if( $request !== null )
177
+		if ($request !== null)
178 178
 		{
179
-			$helper = new \Aimeos\MW\View\Helper\Request\Symfony2( $view, $request );
180
-			$view->addHelper( 'request', $helper );
179
+			$helper = new \Aimeos\MW\View\Helper\Request\Symfony2($view, $request);
180
+			$view->addHelper('request', $helper);
181 181
 		}
182 182
 
183 183
 		return $view;
@@ -190,10 +190,10 @@  discard block
 block discarded – undo
190 190
 	 * @param \Aimeos\MW\View\Iface $view View object
191 191
 	 * @return \Aimeos\MW\View\Iface Modified view object
192 192
 	 */
193
-	protected function addResponse( \Aimeos\MW\View\Iface $view )
193
+	protected function addResponse(\Aimeos\MW\View\Iface $view)
194 194
 	{
195
-		$helper = new \Aimeos\MW\View\Helper\Response\Symfony2( $view );
196
-		$view->addHelper( 'response', $helper );
195
+		$helper = new \Aimeos\MW\View\Helper\Response\Symfony2($view);
196
+		$view->addHelper('response', $helper);
197 197
 
198 198
 		return $view;
199 199
 	}
@@ -206,20 +206,20 @@  discard block
 block discarded – undo
206 206
 	 * @param string|null $locale ISO language code, e.g. "de" or "de_CH"
207 207
 	 * @return \Aimeos\MW\View\Iface Modified view object
208 208
 	 */
209
-	protected function addTranslate( \Aimeos\MW\View\Iface $view, $locale )
209
+	protected function addTranslate(\Aimeos\MW\View\Iface $view, $locale)
210 210
 	{
211
-		if( $locale !== null )
211
+		if ($locale !== null)
212 212
 		{
213
-			$i18n = $this->container->get( 'aimeos_i18n' )->get( array( $locale ) );
213
+			$i18n = $this->container->get('aimeos_i18n')->get(array($locale));
214 214
 			$translation = $i18n[$locale];
215 215
 		}
216 216
 		else
217 217
 		{
218
-			$translation = new \Aimeos\MW\Translation\None( 'en' );
218
+			$translation = new \Aimeos\MW\Translation\None('en');
219 219
 		}
220 220
 
221
-		$helper = new \Aimeos\MW\View\Helper\Translate\Standard( $view, $translation );
222
-		$view->addHelper( 'translate', $helper );
221
+		$helper = new \Aimeos\MW\View\Helper\Translate\Standard($view, $translation);
222
+		$view->addHelper('translate', $helper);
223 223
 
224 224
 		return $view;
225 225
 	}
@@ -231,30 +231,30 @@  discard block
 block discarded – undo
231 231
 	 * @param \Aimeos\MW\View\Iface $view View object
232 232
 	 * @return \Aimeos\MW\View\Iface Modified view object
233 233
 	 */
234
-	protected function addUrl( \Aimeos\MW\View\Iface $view )
234
+	protected function addUrl(\Aimeos\MW\View\Iface $view)
235 235
 	{
236 236
 		$fixed = array();
237 237
 		$request = $this->requestStack->getMasterRequest();
238 238
 
239
-		if( $request !== null )
239
+		if ($request !== null)
240 240
 		{
241 241
 			$attr = $request->attributes;
242 242
 
243
-			if( ( $site = $attr->get( 'site' ) ) !== null ) {
243
+			if (($site = $attr->get('site')) !== null) {
244 244
 				$fixed['site'] = $site;
245 245
 			}
246 246
 
247
-			if( ( $lang = $attr->get( 'locale' ) ) !== null ) {
247
+			if (($lang = $attr->get('locale')) !== null) {
248 248
 				$fixed['locale'] = $lang;
249 249
 			}
250 250
 
251
-			if( ( $currency = $attr->get( 'currency' ) ) !== null ) {
251
+			if (($currency = $attr->get('currency')) !== null) {
252 252
 				$fixed['currency'] = $currency;
253 253
 			}
254 254
 		}
255 255
 
256
-		$helper = new \Aimeos\MW\View\Helper\Url\Symfony2( $view, $this->container->get( 'router' ), $fixed );
257
-		$view->addHelper( 'url', $helper );
256
+		$helper = new \Aimeos\MW\View\Helper\Url\Symfony2($view, $this->container->get('router'), $fixed);
257
+		$view->addHelper('url', $helper);
258 258
 
259 259
 		return $view;
260 260
 	}
Please login to merge, or discard this patch.
Composer/ScriptHandler.php 1 patch
Spacing   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -28,18 +28,18 @@  discard block
 block discarded – undo
28 28
 	 * @param CommandEvent $event CommandEvent instance
29 29
 	 * @throws \RuntimeException If an error occured
30 30
 	 */
31
-	public static function setupDatabase( CommandEvent $event )
31
+	public static function setupDatabase(CommandEvent $event)
32 32
 	{
33 33
 		$options = $env = array();
34 34
 
35
-		if( $event->isDevMode() ) {
35
+		if ($event->isDevMode()) {
36 36
 			$options[] = '--option=setup/default/demo:1';
37 37
 		} else {
38 38
 			$env[] = '--env=prod';
39 39
 		}
40 40
 
41
-		self::executeCommand( $event, 'aimeos:setup', $options + $env );
42
-		self::executeCommand( $event, 'aimeos:cache', $env );
41
+		self::executeCommand($event, 'aimeos:setup', $options + $env);
42
+		self::executeCommand($event, 'aimeos:cache', $env);
43 43
 	}
44 44
 
45 45
 
@@ -49,20 +49,20 @@  discard block
 block discarded – undo
49 49
 	 * @param CommandEvent $event CommandEvent instance
50 50
 	 * @throws \RuntimeException If an error occured
51 51
 	 */
52
-	public static function updateConfig( CommandEvent $event )
52
+	public static function updateConfig(CommandEvent $event)
53 53
 	{
54
-		$event->getIO()->write( 'Ensure existing config and routing for the shop bundle' );
54
+		$event->getIO()->write('Ensure existing config and routing for the shop bundle');
55 55
 
56
-		$options = self::getOptions( $event );
56
+		$options = self::getOptions($event);
57 57
 
58
-		if( !isset( $options['symfony-app-dir'] ) || !is_dir( $options['symfony-app-dir'] ) )
58
+		if (!isset($options['symfony-app-dir']) || !is_dir($options['symfony-app-dir']))
59 59
 		{
60 60
 			$msg = 'An error occurred because the "%1$s" option or the "%2$s" directory isn\'t available';
61
-			throw new \RuntimeException( sprintf( $msg, 'symfony-app-dir', $options['symfony-app-dir'] ) );
61
+			throw new \RuntimeException(sprintf($msg, 'symfony-app-dir', $options['symfony-app-dir']));
62 62
 		}
63 63
 
64
-		self::updateConfigFile( $options['symfony-app-dir'] . '/config/config.yml' );
65
-		self::updateRoutingFile( $options['symfony-app-dir'] . '/config/routing.yml' );
64
+		self::updateConfigFile($options['symfony-app-dir'].'/config/config.yml');
65
+		self::updateRoutingFile($options['symfony-app-dir'].'/config/routing.yml');
66 66
 	}
67 67
 
68 68
 
@@ -72,28 +72,28 @@  discard block
 block discarded – undo
72 72
 	 * @param CommandEvent $event CommandEvent instance
73 73
 	 * @throws \RuntimeException If an error occured
74 74
 	 */
75
-	public static function installBundle( CommandEvent $event )
75
+	public static function installBundle(CommandEvent $event)
76 76
 	{
77
-		$event->getIO()->write( 'Installing the Aimeos shop bundle' );
77
+		$event->getIO()->write('Installing the Aimeos shop bundle');
78 78
 
79
-		$options = self::getOptions( $event );
79
+		$options = self::getOptions($event);
80 80
 
81
-		if( !isset( $options['symfony-app-dir'] ) || !is_dir( $options['symfony-app-dir'] ) )
81
+		if (!isset($options['symfony-app-dir']) || !is_dir($options['symfony-app-dir']))
82 82
 		{
83 83
 			$msg = 'An error occurred because the "%1$s" option or the "%2$s" directory isn\'t available';
84
-			throw new \RuntimeException( sprintf( $msg, 'symfony-app-dir', $options['symfony-app-dir'] ) );
84
+			throw new \RuntimeException(sprintf($msg, 'symfony-app-dir', $options['symfony-app-dir']));
85 85
 		}
86 86
 
87
-		if( !isset( $options['symfony-web-dir'] ) || !is_dir( $options['symfony-web-dir'] ) )
87
+		if (!isset($options['symfony-web-dir']) || !is_dir($options['symfony-web-dir']))
88 88
 		{
89 89
 			$msg = 'An error occurred because the "%1$s" option or the "%2$s" directory isn\'t available';
90
-			throw new \RuntimeException( sprintf( $msg, 'symfony-web-dir', $options['symfony-web-dir'] ) );
90
+			throw new \RuntimeException(sprintf($msg, 'symfony-web-dir', $options['symfony-web-dir']));
91 91
 		}
92 92
 
93
-		self::createDirectory( $options['symfony-app-dir'] . '/secure' );
94
-		self::createDirectory( $options['symfony-web-dir'] . '/uploads' );
95
-		self::createDirectory( $options['symfony-web-dir'] . '/preview' );
96
-		self::createDirectory( $options['symfony-web-dir'] . '/files' );
93
+		self::createDirectory($options['symfony-app-dir'].'/secure');
94
+		self::createDirectory($options['symfony-web-dir'].'/uploads');
95
+		self::createDirectory($options['symfony-web-dir'].'/preview');
96
+		self::createDirectory($options['symfony-web-dir'].'/files');
97 97
 	}
98 98
 
99 99
 
@@ -103,14 +103,14 @@  discard block
 block discarded – undo
103 103
 	 * @param string $dir Absolute path of the new directory
104 104
 	 * @throws \RuntimeException If directory couldn't be created
105 105
 	 */
106
-	protected static function createDirectory( $dir )
106
+	protected static function createDirectory($dir)
107 107
 	{
108 108
 		$perm = 0755;
109 109
 
110
-		if( !is_dir( $dir ) && !mkdir( $dir, $perm, true ) )
110
+		if (!is_dir($dir) && !mkdir($dir, $perm, true))
111 111
 		{
112 112
 			$msg = 'Unable to create directory "%1$s" with permission "%2$s"';
113
-			throw new \RuntimeException( sprintf( $msg, $dir, $perm ) );
113
+			throw new \RuntimeException(sprintf($msg, $dir, $perm));
114 114
 		}
115 115
 	}
116 116
 
@@ -123,28 +123,28 @@  discard block
 block discarded – undo
123 123
 	 * @param array List of configuration options for the given command
124 124
 	 * @throws \RuntimeException If the command couldn't be executed
125 125
 	 */
126
-	protected static function executeCommand( CommandEvent $event, $cmd, array $options = array() )
126
+	protected static function executeCommand(CommandEvent $event, $cmd, array $options = array())
127 127
 	{
128
-		$php = escapeshellarg( self::getPhp() );
129
-		$console = escapeshellarg( self::getConsoleDir( $event ) . '/console' );
130
-		$cmd = escapeshellarg( $cmd );
128
+		$php = escapeshellarg(self::getPhp());
129
+		$console = escapeshellarg(self::getConsoleDir($event).'/console');
130
+		$cmd = escapeshellarg($cmd);
131 131
 
132
-		foreach( $options as $key => $option ) {
133
-			$options[$key] = escapeshellarg( $option );
132
+		foreach ($options as $key => $option) {
133
+			$options[$key] = escapeshellarg($option);
134 134
 		}
135 135
 
136
-		if( $event->getIO()->isDecorated() ) {
136
+		if ($event->getIO()->isDecorated()) {
137 137
 			$console .= ' --ansi';
138 138
 		}
139 139
 
140
-		$process = new Process( $php . ' ' . $console . ' ' . $cmd . ' ' . implode( ' ', $options ), null, null, null, 3600 );
140
+		$process = new Process($php.' '.$console.' '.$cmd.' '.implode(' ', $options), null, null, null, 3600);
141 141
 
142
-		$process->run( function( $type, $buffer ) use ( $event ) {
143
-			$event->getIO()->write( $buffer, false );
142
+		$process->run(function($type, $buffer) use ($event) {
143
+			$event->getIO()->write($buffer, false);
144 144
 		} );
145 145
 
146
-		if( !$process->isSuccessful() ) {
147
-			throw new \RuntimeException( sprintf( 'An error occurred when executing the "%s" command', escapeshellarg( $cmd ) ) );
146
+		if (!$process->isSuccessful()) {
147
+			throw new \RuntimeException(sprintf('An error occurred when executing the "%s" command', escapeshellarg($cmd)));
148 148
 		}
149 149
 	}
150 150
 
@@ -157,19 +157,19 @@  discard block
 block discarded – undo
157 157
 	 * @return string The path to the console directory
158 158
 	 * @throws \RuntimeException If console directory couldn't be found
159 159
 	 */
160
-	protected static function getConsoleDir( CommandEvent $event )
160
+	protected static function getConsoleDir(CommandEvent $event)
161 161
 	{
162
-		$options = self::getOptions( $event );
162
+		$options = self::getOptions($event);
163 163
 
164
-		if( isset( $options['symfony-bin-dir'] ) && is_dir( $options['symfony-bin-dir'] ) ) {
164
+		if (isset($options['symfony-bin-dir']) && is_dir($options['symfony-bin-dir'])) {
165 165
 			return $options['symfony-bin-dir'];
166 166
 		}
167 167
 
168
-		if( isset( $options['symfony-app-dir'] ) && is_dir( $options['symfony-app-dir'] ) ) {
168
+		if (isset($options['symfony-app-dir']) && is_dir($options['symfony-app-dir'])) {
169 169
 			return $options['symfony-app-dir'];
170 170
 		}
171 171
 
172
-		throw new \RuntimeException( sprintf( 'Console directory not found. Neither %1$s nor %2$s option exist', 'symfony-app-dir', 'symfony-bin-dir' ) );
172
+		throw new \RuntimeException(sprintf('Console directory not found. Neither %1$s nor %2$s option exist', 'symfony-app-dir', 'symfony-bin-dir'));
173 173
 	}
174 174
 
175 175
 
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 	 * @param CommandEvent $event Command event object
180 180
 	 * @return array Associative list of option keys and values
181 181
 	 */
182
-	protected static function getOptions( CommandEvent $event )
182
+	protected static function getOptions(CommandEvent $event)
183 183
 	{
184 184
 		return $event->getComposer()->getPackage()->getExtra();
185 185
 	}
@@ -195,8 +195,8 @@  discard block
 block discarded – undo
195 195
 	{
196 196
 		$phpFinder = new PhpExecutableFinder;
197 197
 
198
-		if( !( $phpPath = $phpFinder->find() ) ) {
199
-			throw new \RuntimeException( 'The php executable could not be found, add it to your PATH environment variable and try again' );
198
+		if (!($phpPath = $phpFinder->find())) {
199
+			throw new \RuntimeException('The php executable could not be found, add it to your PATH environment variable and try again');
200 200
 		}
201 201
 
202 202
 		return $phpPath;
@@ -209,15 +209,15 @@  discard block
 block discarded – undo
209 209
 	 * @param string $filename Name of the YAML config file
210 210
 	 * @throws \RuntimeException If file is not found
211 211
 	 */
212
-	protected static function updateConfigFile( $filename )
212
+	protected static function updateConfigFile($filename)
213 213
 	{
214
-		if( ( $content = file_get_contents( $filename ) ) === false ) {
215
-			throw new \RuntimeException( sprintf( 'File "%1$s" not found', $filename ) );
214
+		if (($content = file_get_contents($filename)) === false) {
215
+			throw new \RuntimeException(sprintf('File "%1$s" not found', $filename));
216 216
 		}
217 217
 
218
-		if( self::addAsseticBundle( $content ) === true ) {
218
+		if (self::addAsseticBundle($content) === true) {
219 219
 			$fs = new Filesystem();
220
-			$fs->dumpFile( $filename, $content );
220
+			$fs->dumpFile($filename, $content);
221 221
 		}
222 222
 	}
223 223
 
@@ -228,36 +228,36 @@  discard block
 block discarded – undo
228 228
 	 * @param string $filename Name of the YAML config file
229 229
 	 * @throws \RuntimeException If file is not found
230 230
 	 */
231
-	protected static function updateRoutingFile( $filename )
231
+	protected static function updateRoutingFile($filename)
232 232
 	{
233 233
 		$update = false;
234 234
 
235
-		if( ( $content = file_get_contents( $filename ) ) === false ) {
236
-			throw new \RuntimeException( sprintf( 'File "%1$s" not found', $filename ) );
235
+		if (($content = file_get_contents($filename)) === false) {
236
+			throw new \RuntimeException(sprintf('File "%1$s" not found', $filename));
237 237
 		}
238 238
 
239
-		if( strpos( $content, 'aimeos_shop:' ) === false )
239
+		if (strpos($content, 'aimeos_shop:') === false)
240 240
 		{
241
-			$content .= "\n" . 'aimeos_shop:
241
+			$content .= "\n".'aimeos_shop:
242 242
     resource: "@AimeosShopBundle/Resources/config/routing.yml"
243 243
     prefix: /';
244 244
 
245 245
 			$update = true;
246 246
 		}
247 247
 
248
-		if( strpos( $content, 'aimeos_shop_adm:' ) === false )
248
+		if (strpos($content, 'aimeos_shop_adm:') === false)
249 249
 		{
250
-			$content .= "\n" . 'aimeos_shop_adm:
250
+			$content .= "\n".'aimeos_shop_adm:
251 251
     resource: "@AimeosShopBundle/Resources/config/routing_adm.yml"
252 252
     prefix: /';
253 253
 
254 254
 			$update = true;
255 255
 		}
256 256
 
257
-		if( $update === true )
257
+		if ($update === true)
258 258
 		{
259 259
 			$fs = new Filesystem();
260
-			$fs->dumpFile( $filename, $content );
260
+			$fs->dumpFile($filename, $content);
261 261
 		}
262 262
 	}
263 263
 
@@ -268,14 +268,14 @@  discard block
 block discarded – undo
268 268
 	 * @param string &$content Content of the config.yml file
269 269
 	 * @return boolean True if modified, false if not
270 270
 	 */
271
-	protected static function addAsseticBundle( &$content )
271
+	protected static function addAsseticBundle(&$content)
272 272
 	{
273
-		if( preg_match( "/    bundles:[ ]*\[.*'AimeosShopBundle'.*\]/", $content ) !== 1 )
273
+		if (preg_match("/    bundles:[ ]*\[.*'AimeosShopBundle'.*\]/", $content) !== 1)
274 274
 		{
275
-			$search = array( "/    bundles:[ ]*\[([^\]]+)\]/", "/    bundles:[ ]*\[([ ]*)\]/" );
276
-			$replace = array( "    bundles: [$1,'AimeosShopBundle']", "    bundles: ['AimeosShopBundle']" );
275
+			$search = array("/    bundles:[ ]*\[([^\]]+)\]/", "/    bundles:[ ]*\[([ ]*)\]/");
276
+			$replace = array("    bundles: [$1,'AimeosShopBundle']", "    bundles: ['AimeosShopBundle']");
277 277
 
278
-			if( ( $content = preg_replace( $search, $replace, $content ) ) !== null ) {
278
+			if (($content = preg_replace($search, $replace, $content)) !== null) {
279 279
 				return true;
280 280
 			}
281 281
 		}
Please login to merge, or discard this patch.
Command/AccountCommand.php 1 patch
Spacing   +66 added lines, -66 removed lines patch added patch discarded remove patch
@@ -29,13 +29,13 @@  discard block
 block discarded – undo
29 29
 	 */
30 30
 	protected function configure()
31 31
 	{
32
-		$this->setName( 'aimeos:account');
33
-		$this->setDescription( 'Creates new (admin) accounts' );
34
-		$this->addArgument( 'email', InputArgument::REQUIRED, 'E-mail address of the account that should be created' );
35
-		$this->addArgument( 'site', InputArgument::OPTIONAL, 'Site codes to create accounts for like "default unittest" (none for all)' );
36
-		$this->addOption( 'password', null, InputOption::VALUE_REQUIRED, 'Optional password for the account (will ask for if not given)' );
37
-		$this->addOption( 'admin', null, InputOption::VALUE_NONE, 'If account should have administrator privileges' );
38
-		$this->addOption( 'editor', null, InputOption::VALUE_NONE, 'If account should have limited editor privileges' );
32
+		$this->setName('aimeos:account');
33
+		$this->setDescription('Creates new (admin) accounts');
34
+		$this->addArgument('email', InputArgument::REQUIRED, 'E-mail address of the account that should be created');
35
+		$this->addArgument('site', InputArgument::OPTIONAL, 'Site codes to create accounts for like "default unittest" (none for all)');
36
+		$this->addOption('password', null, InputOption::VALUE_REQUIRED, 'Optional password for the account (will ask for if not given)');
37
+		$this->addOption('admin', null, InputOption::VALUE_NONE, 'If account should have administrator privileges');
38
+		$this->addOption('editor', null, InputOption::VALUE_NONE, 'If account should have limited editor privileges');
39 39
 	}
40 40
 
41 41
 
@@ -45,32 +45,32 @@  discard block
 block discarded – undo
45 45
 	 * @param InputInterface $input Input object
46 46
 	 * @param OutputInterface $output Output object
47 47
 	 */
48
-	protected function execute( InputInterface $input, OutputInterface $output )
48
+	protected function execute(InputInterface $input, OutputInterface $output)
49 49
 	{
50
-		$code = $input->getArgument( 'email' );
51
-		if( ( $password = $input->getOption( 'password' ) ) === null )
50
+		$code = $input->getArgument('email');
51
+		if (($password = $input->getOption('password')) === null)
52 52
 		{
53
-			$helper = $this->getHelper( 'question' );
54
-			$question = new Question( 'Password' );
55
-			$question->setHidden( true );
53
+			$helper = $this->getHelper('question');
54
+			$question = new Question('Password');
55
+			$question->setHidden(true);
56 56
 
57
-			$password = $helper->ask( $input, $output, $question );
57
+			$password = $helper->ask($input, $output, $question);
58 58
 		}
59 59
 
60
-		$context = $this->getContainer()->get( 'aimeos_context' )->get( false, 'backend' );
61
-		$context->setEditor( 'aimeos:account' );
60
+		$context = $this->getContainer()->get('aimeos_context')->get(false, 'backend');
61
+		$context->setEditor('aimeos:account');
62 62
 
63
-		$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context );
64
-		$context->setLocale( $localeManager->createItem() );
63
+		$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context);
64
+		$context->setLocale($localeManager->createItem());
65 65
 
66
-		$user = $this->createCustomerItem( $context, $code, $password );
66
+		$user = $this->createCustomerItem($context, $code, $password);
67 67
 
68
-		if( $input->getOption( 'admin' ) ) {
69
-			$this->addGroup( $input, $output, $context, $user, 'admin' );
68
+		if ($input->getOption('admin')) {
69
+			$this->addGroup($input, $output, $context, $user, 'admin');
70 70
 		}
71 71
 
72
-		if( $input->getOption( 'editor' ) ) {
73
-			$this->addGroup( $input, $output, $context, $user, 'editor' );
72
+		if ($input->getOption('editor')) {
73
+			$this->addGroup($input, $output, $context, $user, 'editor');
74 74
 		}
75 75
 	}
76 76
 
@@ -84,24 +84,24 @@  discard block
 block discarded – undo
84 84
 	 * @param \Aimeos\MShop\Customer\Item\Iface $user Aimeos customer object
85 85
 	 * @param string $group Unique customer group code
86 86
 	 */
87
-	protected function addGroup( InputInterface $input, OutputInterface $output,
88
-		\Aimeos\MShop\Context\Item\Iface $context, \Aimeos\MShop\Customer\Item\Iface $user, $group )
87
+	protected function addGroup(InputInterface $input, OutputInterface $output,
88
+		\Aimeos\MShop\Context\Item\Iface $context, \Aimeos\MShop\Customer\Item\Iface $user, $group)
89 89
 	{
90
-		$output->writeln( sprintf( 'Add "%1$s" group to user "%2$s" for sites', $group, $user->getCode() ) );
90
+		$output->writeln(sprintf('Add "%1$s" group to user "%2$s" for sites', $group, $user->getCode()));
91 91
 
92
-		$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context );
92
+		$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context);
93 93
 
94
-		foreach( $this->getSiteItems( $context, $input ) as $siteItem )
94
+		foreach ($this->getSiteItems($context, $input) as $siteItem)
95 95
 		{
96
-			$localeItem = $localeManager->bootstrap( $siteItem->getCode(), '', '', false );
96
+			$localeItem = $localeManager->bootstrap($siteItem->getCode(), '', '', false);
97 97
 
98 98
 			$lcontext = clone $context;
99
-			$lcontext->setLocale( $localeItem );
99
+			$lcontext->setLocale($localeItem);
100 100
 
101
-			$output->writeln( '- ' . $siteItem->getCode() );
101
+			$output->writeln('- '.$siteItem->getCode());
102 102
 
103
-			$groupItem = $this->getGroupItem( $lcontext, $group );
104
-			$this->addListItem( $lcontext, $user->getId(), $groupItem->getId() );
103
+			$groupItem = $this->getGroupItem($lcontext, $group);
104
+			$this->addListItem($lcontext, $user->getId(), $groupItem->getId());
105 105
 		}
106 106
 	}
107 107
 
@@ -113,31 +113,31 @@  discard block
 block discarded – undo
113 113
 	 * @param string $userid Unique user ID
114 114
 	 * @param string $groupid Unique group ID
115 115
 	 */
116
-	protected function addListItem( \Aimeos\MShop\Context\Item\Iface $context, $userid, $groupid )
116
+	protected function addListItem(\Aimeos\MShop\Context\Item\Iface $context, $userid, $groupid)
117 117
 	{
118
-		$manager = \Aimeos\MShop\Customer\Manager\Factory::createManager( $context )->getSubmanager( 'lists' );
119
-		$typeid = $manager->getSubmanager( 'type' )->findItem( 'default', array(), 'customer/group' )->getId();
118
+		$manager = \Aimeos\MShop\Customer\Manager\Factory::createManager($context)->getSubmanager('lists');
119
+		$typeid = $manager->getSubmanager('type')->findItem('default', array(), 'customer/group')->getId();
120 120
 
121 121
 		$search = $manager->createSearch();
122 122
 		$expr = array(
123
-			$search->compare( '==', 'customer.lists.parentid', $userid ),
124
-			$search->compare( '==', 'customer.lists.refid', $groupid ),
125
-			$search->compare( '==', 'customer.lists.domain', 'customer/group' ),
126
-			$search->compare( '==', 'customer.lists.typeid', $typeid ),
123
+			$search->compare('==', 'customer.lists.parentid', $userid),
124
+			$search->compare('==', 'customer.lists.refid', $groupid),
125
+			$search->compare('==', 'customer.lists.domain', 'customer/group'),
126
+			$search->compare('==', 'customer.lists.typeid', $typeid),
127 127
 		);
128
-		$search->setConditions( $search->combine( '&&', $expr ) );
129
-		$search->setSlice( 0, 1 );
128
+		$search->setConditions($search->combine('&&', $expr));
129
+		$search->setSlice(0, 1);
130 130
 
131
-		if( count( $manager->searchItems( $search ) ) === 0 )
131
+		if (count($manager->searchItems($search)) === 0)
132 132
 		{
133 133
 			$item = $manager->createItem();
134
-			$item->setDomain( 'customer/group' );
135
-			$item->setParentId( $userid );
136
-			$item->setTypeId( $typeid );
137
-			$item->setRefId( $groupid );
138
-			$item->setStatus( 1 );
134
+			$item->setDomain('customer/group');
135
+			$item->setParentId($userid);
136
+			$item->setTypeId($typeid);
137
+			$item->setRefId($groupid);
138
+			$item->setStatus(1);
139 139
 
140
-			$manager->saveItem( $item, false );
140
+			$manager->saveItem($item, false);
141 141
 		}
142 142
 	}
143 143
 
@@ -152,23 +152,23 @@  discard block
 block discarded – undo
152 152
 	 * @param string $password New user password
153 153
 	 * @return \Aimeos\MShop\Customer\Item\Iface Aimeos customer item object
154 154
 	 */
155
-	protected function createCustomerItem( \Aimeos\MShop\Context\Item\Iface $context, $email, $password )
155
+	protected function createCustomerItem(\Aimeos\MShop\Context\Item\Iface $context, $email, $password)
156 156
 	{
157
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'customer' );
157
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'customer');
158 158
 
159 159
 		try {
160
-			$item = $manager->findItem( $email );
161
-		} catch( \Aimeos\MShop\Exception $e ) {
160
+			$item = $manager->findItem($email);
161
+		} catch (\Aimeos\MShop\Exception $e) {
162 162
 			$item = $manager->createItem();
163 163
 		}
164 164
 
165
-		$item->setCode( $email );
166
-		$item->setLabel( $email );
167
-		$item->getPaymentAddress()->setEmail( $email );
168
-		$item->setPassword( $password );
169
-		$item->setStatus( 1 );
165
+		$item->setCode($email);
166
+		$item->setLabel($email);
167
+		$item->getPaymentAddress()->setEmail($email);
168
+		$item->setPassword($password);
169
+		$item->setStatus(1);
170 170
 
171
-		$manager->saveItem( $item );
171
+		$manager->saveItem($item);
172 172
 
173 173
 		return $item;
174 174
 	}
@@ -181,21 +181,21 @@  discard block
 block discarded – undo
181 181
 	 * @param string $code Unique customer group code
182 182
 	 * @return \Aimeos\MShop\Customer\Item\Group\Iface Aimeos customer group item object
183 183
 	 */
184
-	protected function getGroupItem( \Aimeos\MShop\Context\Item\Iface $context, $code )
184
+	protected function getGroupItem(\Aimeos\MShop\Context\Item\Iface $context, $code)
185 185
 	{
186
-		$manager = \Aimeos\MShop\Customer\Manager\Factory::createManager( $context )->getSubmanager( 'group' );
186
+		$manager = \Aimeos\MShop\Customer\Manager\Factory::createManager($context)->getSubmanager('group');
187 187
 
188 188
 		try
189 189
 		{
190
-			$item = $manager->findItem( $code );
190
+			$item = $manager->findItem($code);
191 191
 		}
192
-		catch( \Aimeos\MShop\Exception $e )
192
+		catch (\Aimeos\MShop\Exception $e)
193 193
 		{
194 194
 			$item = $manager->createItem();
195
-			$item->setLabel( $code );
196
-			$item->setCode( $code );
195
+			$item->setLabel($code);
196
+			$item->setCode($code);
197 197
 
198
-			$manager->saveItem( $item );
198
+			$manager->saveItem($item);
199 199
 		}
200 200
 
201 201
 		return $item;
Please login to merge, or discard this patch.
Tests/Controller/JqadmControllerTest.php 1 patch
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -12,12 +12,12 @@  discard block
 block discarded – undo
12 12
 		$client = static::createClient(array(), array(
13 13
 			'PHP_AUTH_USER' => 'admin',
14 14
 			'PHP_AUTH_PW'   => 'adminpass',
15
-		) );
15
+		));
16 16
 
17
-		$client->request( 'GET', '/unittest/jqadm/file/css' );
17
+		$client->request('GET', '/unittest/jqadm/file/css');
18 18
 
19
-		$this->assertEquals( 200, $client->getResponse()->getStatusCode() );
20
-		$this->assertContains( '.aimeos', $client->getResponse()->getContent() );
19
+		$this->assertEquals(200, $client->getResponse()->getStatusCode());
20
+		$this->assertContains('.aimeos', $client->getResponse()->getContent());
21 21
 	}
22 22
 
23 23
 
@@ -26,12 +26,12 @@  discard block
 block discarded – undo
26 26
 		$client = static::createClient(array(), array(
27 27
 			'PHP_AUTH_USER' => 'admin',
28 28
 			'PHP_AUTH_PW'   => 'adminpass',
29
-		) );
29
+		));
30 30
 
31
-		$client->request( 'GET', '/unittest/jqadm/file/js' );
31
+		$client->request('GET', '/unittest/jqadm/file/js');
32 32
 
33
-		$this->assertEquals( 200, $client->getResponse()->getStatusCode() );
34
-		$this->assertContains( 'Aimeos = {', $client->getResponse()->getContent() );
33
+		$this->assertEquals(200, $client->getResponse()->getStatusCode());
34
+		$this->assertContains('Aimeos = {', $client->getResponse()->getContent());
35 35
 	}
36 36
 
37 37
 
@@ -40,13 +40,13 @@  discard block
 block discarded – undo
40 40
 		$client = static::createClient(array(), array(
41 41
 			'PHP_AUTH_USER' => 'admin',
42 42
 			'PHP_AUTH_PW'   => 'adminpass',
43
-		) );
43
+		));
44 44
 
45
-		$client->request( 'GET', '/unittest/jqadm/copy/product/0' );
45
+		$client->request('GET', '/unittest/jqadm/copy/product/0');
46 46
 		$response = $client->getResponse();
47 47
 
48
-		$this->assertEquals( 200, $response->getStatusCode() );
49
-		$this->assertContains( '<div class="product-item', $response->getContent() );
48
+		$this->assertEquals(200, $response->getStatusCode());
49
+		$this->assertContains('<div class="product-item', $response->getContent());
50 50
 	}
51 51
 
52 52
 
@@ -55,13 +55,13 @@  discard block
 block discarded – undo
55 55
 		$client = static::createClient(array(), array(
56 56
 			'PHP_AUTH_USER' => 'admin',
57 57
 			'PHP_AUTH_PW'   => 'adminpass',
58
-		) );
58
+		));
59 59
 
60
-		$client->request( 'GET', '/unittest/jqadm/create/product' );
60
+		$client->request('GET', '/unittest/jqadm/create/product');
61 61
 		$response = $client->getResponse();
62 62
 
63
-		$this->assertEquals( 200, $response->getStatusCode() );
64
-		$this->assertContains( '<div class="product-item', $response->getContent() );
63
+		$this->assertEquals(200, $response->getStatusCode());
64
+		$this->assertContains('<div class="product-item', $response->getContent());
65 65
 	}
66 66
 
67 67
 
@@ -70,13 +70,13 @@  discard block
 block discarded – undo
70 70
 		$client = static::createClient(array(), array(
71 71
 			'PHP_AUTH_USER' => 'admin',
72 72
 			'PHP_AUTH_PW'   => 'adminpass',
73
-		) );
73
+		));
74 74
 
75
-		$client->request( 'GET', '/unittest/jqadm/delete/product/0' );
75
+		$client->request('GET', '/unittest/jqadm/delete/product/0');
76 76
 		$response = $client->getResponse();
77 77
 
78
-		$this->assertEquals( 200, $response->getStatusCode() );
79
-		$this->assertContains( '<table class="list-items', $response->getContent() );
78
+		$this->assertEquals(200, $response->getStatusCode());
79
+		$this->assertContains('<table class="list-items', $response->getContent());
80 80
 	}
81 81
 
82 82
 
@@ -85,13 +85,13 @@  discard block
 block discarded – undo
85 85
 		$client = static::createClient(array(), array(
86 86
 			'PHP_AUTH_USER' => 'admin',
87 87
 			'PHP_AUTH_PW'   => 'adminpass',
88
-		) );
88
+		));
89 89
 
90
-		$client->request( 'GET', '/unittest/jqadm/get/product/0' );
90
+		$client->request('GET', '/unittest/jqadm/get/product/0');
91 91
 		$response = $client->getResponse();
92 92
 
93
-		$this->assertEquals( 200, $response->getStatusCode() );
94
-		$this->assertContains( '<div class="product-item', $response->getContent() );
93
+		$this->assertEquals(200, $response->getStatusCode());
94
+		$this->assertContains('<div class="product-item', $response->getContent());
95 95
 	}
96 96
 
97 97
 
@@ -100,13 +100,13 @@  discard block
 block discarded – undo
100 100
 		$client = static::createClient(array(), array(
101 101
 			'PHP_AUTH_USER' => 'admin',
102 102
 			'PHP_AUTH_PW'   => 'adminpass',
103
-		) );
103
+		));
104 104
 
105
-		$client->request( 'POST', '/unittest/jqadm/save/product/0' );
105
+		$client->request('POST', '/unittest/jqadm/save/product/0');
106 106
 		$response = $client->getResponse();
107 107
 
108
-		$this->assertEquals( 200, $response->getStatusCode() );
109
-		$this->assertContains( '<div class="product-item', $response->getContent() );
108
+		$this->assertEquals(200, $response->getStatusCode());
109
+		$this->assertContains('<div class="product-item', $response->getContent());
110 110
 	}
111 111
 
112 112
 
@@ -115,13 +115,13 @@  discard block
 block discarded – undo
115 115
 		$client = static::createClient(array(), array(
116 116
 			'PHP_AUTH_USER' => 'admin',
117 117
 			'PHP_AUTH_PW'   => 'adminpass',
118
-		) );
118
+		));
119 119
 
120
-		$client->request( 'GET', '/unittest/jqadm/search/product' );
120
+		$client->request('GET', '/unittest/jqadm/search/product');
121 121
 		$response = $client->getResponse();
122 122
 
123
-		$this->assertEquals( 200, $response->getStatusCode() );
124
-		$this->assertContains( '<table class="list-items', $response->getContent() );
123
+		$this->assertEquals(200, $response->getStatusCode());
124
+		$this->assertContains('<table class="list-items', $response->getContent());
125 125
 	}
126 126
 
127 127
 
@@ -130,12 +130,12 @@  discard block
 block discarded – undo
130 130
 		$client = static::createClient(array(), array(
131 131
 			'PHP_AUTH_USER' => 'admin',
132 132
 			'PHP_AUTH_PW'   => 'adminpass',
133
-		) );
133
+		));
134 134
 
135
-		$client->request( 'GET', '/invalid/jqadm/search/product' );
135
+		$client->request('GET', '/invalid/jqadm/search/product');
136 136
 		$response = $client->getResponse();
137 137
 
138
-		$this->assertEquals( 200, $response->getStatusCode() );
139
-		$this->assertContains( '<table class="list-items', $response->getContent() );
138
+		$this->assertEquals(200, $response->getStatusCode());
139
+		$this->assertContains('<table class="list-items', $response->getContent());
140 140
 	}
141 141
 }
Please login to merge, or discard this patch.