Completed
Push — master ( bb40c4...edeae0 )
by Aimeos
03:18
created
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.
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.
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.
Command/SetupCommand.php 1 patch
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -30,18 +30,18 @@  discard block
 block discarded – undo
30 30
 	 * @param string $classname Name of the setup task class
31 31
 	 * @return boolean True if class is found, false if not
32 32
 	 */
33
-	public static function autoload( $classname )
33
+	public static function autoload($classname)
34 34
 	{
35
-		if( strncmp( $classname, 'Aimeos\\MW\\Setup\\Task\\', 21 ) === 0 )
35
+		if (strncmp($classname, 'Aimeos\\MW\\Setup\\Task\\', 21) === 0)
36 36
 		{
37
-			$fileName = substr( $classname, 21 ) . '.php';
38
-			$paths = explode( PATH_SEPARATOR, get_include_path() );
37
+			$fileName = substr($classname, 21).'.php';
38
+			$paths = explode(PATH_SEPARATOR, get_include_path());
39 39
 
40
-			foreach( $paths as $path )
40
+			foreach ($paths as $path)
41 41
 			{
42
-				$file = $path . DIRECTORY_SEPARATOR . $fileName;
42
+				$file = $path.DIRECTORY_SEPARATOR.$fileName;
43 43
 
44
-				if( file_exists( $file ) === true && ( include_once $file ) !== false ) {
44
+				if (file_exists($file) === true && (include_once $file) !== false) {
45 45
 					return true;
46 46
 				}
47 47
 			}
@@ -56,13 +56,13 @@  discard block
 block discarded – undo
56 56
 	 */
57 57
 	protected function configure()
58 58
 	{
59
-		$this->setName( 'aimeos:setup');
60
-		$this->setDescription( 'Initialize or update the Aimeos database tables' );
61
-		$this->addArgument( 'site', InputArgument::OPTIONAL, 'Site for updating database entries', 'default' );
62
-		$this->addArgument( 'tplsite', InputArgument::OPTIONAL, 'Template site for creating or updating database entries', 'default' );
63
-		$this->addOption( 'option', null, InputOption::VALUE_REQUIRED, 'Optional setup configuration, name and value are separated by ":" like "setup/default/demo:1"', array() );
64
-		$this->addOption( 'action', null, InputOption::VALUE_REQUIRED, 'Action name that should be executed, i.e. "migrate", "rollback", "clean"', 'migrate' );
65
-		$this->addOption( 'task', null, InputOption::VALUE_REQUIRED, 'Name of the setup task that should be executed', null );
59
+		$this->setName('aimeos:setup');
60
+		$this->setDescription('Initialize or update the Aimeos database tables');
61
+		$this->addArgument('site', InputArgument::OPTIONAL, 'Site for updating database entries', 'default');
62
+		$this->addArgument('tplsite', InputArgument::OPTIONAL, 'Template site for creating or updating database entries', 'default');
63
+		$this->addOption('option', null, InputOption::VALUE_REQUIRED, 'Optional setup configuration, name and value are separated by ":" like "setup/default/demo:1"', array());
64
+		$this->addOption('action', null, InputOption::VALUE_REQUIRED, 'Action name that should be executed, i.e. "migrate", "rollback", "clean"', 'migrate');
65
+		$this->addOption('task', null, InputOption::VALUE_REQUIRED, 'Name of the setup task that should be executed', null);
66 66
 	}
67 67
 
68 68
 
@@ -72,51 +72,51 @@  discard block
 block discarded – undo
72 72
 	 * @param InputInterface $input Input object
73 73
 	 * @param OutputInterface $output Output object
74 74
 	 */
75
-	protected function execute( InputInterface $input, OutputInterface $output )
75
+	protected function execute(InputInterface $input, OutputInterface $output)
76 76
 	{
77
-		$ctx = $this->getContainer()->get( 'aimeos_context' )->get( false, 'command' );
78
-		$ctx->setEditor( 'aimeos:setup' );
77
+		$ctx = $this->getContainer()->get('aimeos_context')->get(false, 'command');
78
+		$ctx->setEditor('aimeos:setup');
79 79
 
80 80
 		$config = $ctx->getConfig();
81
-		$site = $input->getArgument( 'site' );
82
-		$tplsite = $input->getArgument( 'tplsite' );
81
+		$site = $input->getArgument('site');
82
+		$tplsite = $input->getArgument('tplsite');
83 83
 
84
-		$config->set( 'setup/site', $site );
85
-		$dbconfig = $this->getDbConfig( $config );
86
-		$this->setOptions( $config, $input );
84
+		$config->set('setup/site', $site);
85
+		$dbconfig = $this->getDbConfig($config);
86
+		$this->setOptions($config, $input);
87 87
 
88
-		$taskPaths = $this->getContainer()->get( 'aimeos' )->get()->getSetupPaths( $tplsite );
88
+		$taskPaths = $this->getContainer()->get('aimeos')->get()->getSetupPaths($tplsite);
89 89
 
90 90
 		$includePaths = $taskPaths;
91 91
 		$includePaths[] = get_include_path();
92 92
 
93
-		if( set_include_path( implode( PATH_SEPARATOR, $includePaths ) ) === false ) {
94
-			throw new \Exception( 'Unable to extend include path' );
93
+		if (set_include_path(implode(PATH_SEPARATOR, $includePaths)) === false) {
94
+			throw new \Exception('Unable to extend include path');
95 95
 		}
96 96
 
97
-		spl_autoload_register( '\Aimeos\ShopBundle\Command\SetupCommand::autoload', true );
97
+		spl_autoload_register('\Aimeos\ShopBundle\Command\SetupCommand::autoload', true);
98 98
 
99
-		$manager = new \Aimeos\MW\Setup\Manager\Multiple( $ctx->getDatabaseManager(), $dbconfig, $taskPaths, $ctx );
99
+		$manager = new \Aimeos\MW\Setup\Manager\Multiple($ctx->getDatabaseManager(), $dbconfig, $taskPaths, $ctx);
100 100
 
101
-		$output->writeln( sprintf( 'Initializing or updating the Aimeos database tables for site <info>%1$s</info>', $site ) );
101
+		$output->writeln(sprintf('Initializing or updating the Aimeos database tables for site <info>%1$s</info>', $site));
102 102
 
103
-		if( ( $task = $input->getOption( 'task' ) ) && is_array( $task ) ) {
104
-			$task = reset( $task );
103
+		if (($task = $input->getOption('task')) && is_array($task)) {
104
+			$task = reset($task);
105 105
 		}
106 106
 
107
-		switch( $input->getOption( 'action' ) )
107
+		switch ($input->getOption('action'))
108 108
 		{
109 109
 			case 'migrate':
110
-				$manager->migrate( $task );
110
+				$manager->migrate($task);
111 111
 				break;
112 112
 			case 'rollback':
113
-				$manager->rollback( $task );
113
+				$manager->rollback($task);
114 114
 				break;
115 115
 			case 'clean':
116
-				$manager->clean( $task );
116
+				$manager->clean($task);
117 117
 				break;
118 118
 			default:
119
-				throw new \Exception( sprintf( 'Invalid setup action "%1$s"', $input->getOption( 'action' ) ) );
119
+				throw new \Exception(sprintf('Invalid setup action "%1$s"', $input->getOption('action')));
120 120
 		}
121 121
 	}
122 122
 
@@ -127,14 +127,14 @@  discard block
 block discarded – undo
127 127
 	 * @param \Aimeos\MW\Config\Iface $conf Config object
128 128
 	 * @return array Multi-dimensional associative list of database configuration parameters
129 129
 	 */
130
-	protected function getDbConfig( \Aimeos\MW\Config\Iface $conf )
130
+	protected function getDbConfig(\Aimeos\MW\Config\Iface $conf)
131 131
 	{
132
-		$dbconfig = $conf->get( 'resource', array() );
132
+		$dbconfig = $conf->get('resource', array());
133 133
 
134
-		foreach( $dbconfig as $rname => $dbconf )
134
+		foreach ($dbconfig as $rname => $dbconf)
135 135
 		{
136
-			if( strncmp( $rname, 'db', 2 ) !== 0 ) {
137
-				unset( $dbconfig[$rname] );
136
+			if (strncmp($rname, 'db', 2) !== 0) {
137
+				unset($dbconfig[$rname]);
138 138
 			}
139 139
 		}
140 140
 
@@ -150,12 +150,12 @@  discard block
 block discarded – undo
150 150
 	 * @param array Associative list of database configurations
151 151
 	 * @throws \RuntimeException If the format of the options is invalid
152 152
 	 */
153
-	protected function setOptions( \Aimeos\MW\Config\Iface $conf, InputInterface $input )
153
+	protected function setOptions(\Aimeos\MW\Config\Iface $conf, InputInterface $input)
154 154
 	{
155
-		foreach( (array) $input->getOption( 'option' ) as $option )
155
+		foreach ((array) $input->getOption('option') as $option)
156 156
 		{
157
-			list( $name, $value ) = explode( ':', $option );
158
-			$conf->set( str_replace( '\\', '/', $name ), $value );
157
+			list($name, $value) = explode(':', $option);
158
+			$conf->set(str_replace('\\', '/', $name), $value);
159 159
 		}
160 160
 	}
161 161
 }
Please login to merge, or discard this patch.
Command/JobsCommand.php 1 patch
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -29,19 +29,19 @@  discard block
 block discarded – undo
29 29
 	protected function configure()
30 30
 	{
31 31
 		$names = '';
32
-		$aimeos = new \Aimeos\Bootstrap( array() );
33
-		$cntlPaths = $aimeos->getCustomPaths( 'controller/jobs' );
34
-		$controllers = \Aimeos\Controller\Jobs\Factory::getControllers( $this->getBareContext(), $aimeos, $cntlPaths );
32
+		$aimeos = new \Aimeos\Bootstrap(array());
33
+		$cntlPaths = $aimeos->getCustomPaths('controller/jobs');
34
+		$controllers = \Aimeos\Controller\Jobs\Factory::getControllers($this->getBareContext(), $aimeos, $cntlPaths);
35 35
 
36
-		foreach( $controllers as $key => $controller ) {
37
-			$names .= str_pad( $key, 30 ) . $controller->getName() . PHP_EOL;
36
+		foreach ($controllers as $key => $controller) {
37
+			$names .= str_pad($key, 30).$controller->getName().PHP_EOL;
38 38
 		}
39 39
 
40
-		$this->setName( 'aimeos:jobs' );
41
-		$this->setDescription( 'Executes the job controllers' );
42
-		$this->addArgument( 'jobs', InputArgument::REQUIRED, 'One or more job controller names like "admin/job customer/email/watch"' );
43
-		$this->addArgument( 'site', InputArgument::OPTIONAL, 'Site codes to execute the jobs for like "default unittest" (none for all)' );
44
-		$this->setHelp( "Available jobs are:\n" . $names );
40
+		$this->setName('aimeos:jobs');
41
+		$this->setDescription('Executes the job controllers');
42
+		$this->addArgument('jobs', InputArgument::REQUIRED, 'One or more job controller names like "admin/job customer/email/watch"');
43
+		$this->addArgument('site', InputArgument::OPTIONAL, 'Site codes to execute the jobs for like "default unittest" (none for all)');
44
+		$this->setHelp("Available jobs are:\n".$names);
45 45
 	}
46 46
 
47 47
 
@@ -51,26 +51,26 @@  discard block
 block discarded – undo
51 51
 	 * @param InputInterface $input Input object
52 52
 	 * @param OutputInterface $output Output object
53 53
 	 */
54
-	protected function execute( InputInterface $input, OutputInterface $output )
54
+	protected function execute(InputInterface $input, OutputInterface $output)
55 55
 	{
56 56
 		$context = $this->getContext();
57
-		$aimeos = $this->getContainer()->get( 'aimeos' )->get();
57
+		$aimeos = $this->getContainer()->get('aimeos')->get();
58 58
 
59
-		$jobs = explode( ' ', $input->getArgument( 'jobs' ) );
60
-		$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context );
59
+		$jobs = explode(' ', $input->getArgument('jobs'));
60
+		$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context);
61 61
 
62
-		foreach( $this->getSiteItems( $context, $input ) as $siteItem )
62
+		foreach ($this->getSiteItems($context, $input) as $siteItem)
63 63
 		{
64
-			$localeItem = $localeManager->bootstrap( $siteItem->getCode(), '', '', false );
65
-			$localeItem->setLanguageId( null );
66
-			$localeItem->setCurrencyId( null );
64
+			$localeItem = $localeManager->bootstrap($siteItem->getCode(), '', '', false);
65
+			$localeItem->setLanguageId(null);
66
+			$localeItem->setCurrencyId(null);
67 67
 
68
-			$context->setLocale( $localeItem );
68
+			$context->setLocale($localeItem);
69 69
 
70
-			$output->writeln( sprintf( 'Executing the Aimeos jobs for "<info>%s</info>"', $siteItem->getCode() ) );
70
+			$output->writeln(sprintf('Executing the Aimeos jobs for "<info>%s</info>"', $siteItem->getCode()));
71 71
 
72
-			foreach( $jobs as $jobname ) {
73
-				\Aimeos\Controller\Jobs\Factory::createController( $context, $aimeos, $jobname )->run();
72
+			foreach ($jobs as $jobname) {
73
+				\Aimeos\Controller\Jobs\Factory::createController($context, $aimeos, $jobname)->run();
74 74
 			}
75 75
 		}
76 76
 	}
@@ -85,15 +85,15 @@  discard block
 block discarded – undo
85 85
 	{
86 86
 		$ctx = new \Aimeos\MShop\Context\Item\Standard();
87 87
 
88
-		$conf = new \Aimeos\MW\Config\PHPArray( array(), array() );
89
-		$ctx->setConfig( $conf );
88
+		$conf = new \Aimeos\MW\Config\PHPArray(array(), array());
89
+		$ctx->setConfig($conf);
90 90
 
91
-		$locale = \Aimeos\MShop\Factory::createManager( $ctx, 'locale' )->createItem();
92
-		$locale->setLanguageId( 'en' );
93
-		$ctx->setLocale( $locale );
91
+		$locale = \Aimeos\MShop\Factory::createManager($ctx, 'locale')->createItem();
92
+		$locale->setLanguageId('en');
93
+		$ctx->setLocale($locale);
94 94
 
95
-		$i18n = new \Aimeos\MW\Translation\None( 'en' );
96
-		$ctx->setI18n( array( 'en' => $i18n ) );
95
+		$i18n = new \Aimeos\MW\Translation\None('en');
96
+		$ctx->setI18n(array('en' => $i18n));
97 97
 
98 98
 		return $ctx;
99 99
 	}
@@ -108,19 +108,19 @@  discard block
 block discarded – undo
108 108
 	{
109 109
 		$container = $this->getContainer();
110 110
 		$aimeos = $container->get('aimeos')->get();
111
-		$context = $container->get( 'aimeos_context' )->get( false, 'command' );
111
+		$context = $container->get('aimeos_context')->get(false, 'command');
112 112
 
113
-		$tmplPaths = $aimeos->getCustomPaths( 'controller/jobs/templates' );
114
-		$tmplPaths = array_merge( $tmplPaths, $aimeos->getCustomPaths( 'client/html/templates' ) );
115
-		$view = $container->get('aimeos_view')->create( $context, $tmplPaths );
113
+		$tmplPaths = $aimeos->getCustomPaths('controller/jobs/templates');
114
+		$tmplPaths = array_merge($tmplPaths, $aimeos->getCustomPaths('client/html/templates'));
115
+		$view = $container->get('aimeos_view')->create($context, $tmplPaths);
116 116
 
117
-		$langManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context )->getSubManager( 'language' );
118
-		$langids = array_keys( $langManager->searchItems( $langManager->createSearch( true ) ) );
119
-		$i18n = $this->getContainer()->get( 'aimeos_i18n' )->get( $langids );
117
+		$langManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context)->getSubManager('language');
118
+		$langids = array_keys($langManager->searchItems($langManager->createSearch(true)));
119
+		$i18n = $this->getContainer()->get('aimeos_i18n')->get($langids);
120 120
 
121
-		$context->setEditor( 'aimeos:jobs' );
122
-		$context->setView( $view );
123
-		$context->setI18n( $i18n );
121
+		$context->setEditor('aimeos:jobs');
122
+		$context->setView($view);
123
+		$context->setI18n($i18n);
124 124
 
125 125
 		return $context;
126 126
 	}
Please login to merge, or discard this patch.
Command/CacheCommand.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -28,9 +28,9 @@  discard block
 block discarded – undo
28 28
 	 */
29 29
 	protected function configure()
30 30
 	{
31
-		$this->setName( 'aimeos:cache' );
32
-		$this->setDescription( 'Clears the content cache' );
33
-		$this->addArgument( 'site', InputArgument::OPTIONAL, 'Site codes to clear the cache like "default unittest" (none for all)' );
31
+		$this->setName('aimeos:cache');
32
+		$this->setDescription('Clears the content cache');
33
+		$this->addArgument('site', InputArgument::OPTIONAL, 'Site codes to clear the cache like "default unittest" (none for all)');
34 34
 	}
35 35
 
36 36
 
@@ -40,26 +40,26 @@  discard block
 block discarded – undo
40 40
 	 * @param InputInterface $input Input object
41 41
 	 * @param OutputInterface $output Output object
42 42
 	 */
43
-	protected function execute( InputInterface $input, OutputInterface $output )
43
+	protected function execute(InputInterface $input, OutputInterface $output)
44 44
 	{
45
-		$context = $this->getContainer()->get( 'aimeos_context' )->get( false, 'command' );
46
-		$context->setEditor( 'aimeos:cache' );
45
+		$context = $this->getContainer()->get('aimeos_context')->get(false, 'command');
46
+		$context->setEditor('aimeos:cache');
47 47
 
48
-		$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context );
48
+		$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context);
49 49
 
50
-		foreach( $this->getSiteItems( $context, $input ) as $siteItem )
50
+		foreach ($this->getSiteItems($context, $input) as $siteItem)
51 51
 		{
52
-			$localeItem = $localeManager->bootstrap( $siteItem->getCode(), '', '', false );
52
+			$localeItem = $localeManager->bootstrap($siteItem->getCode(), '', '', false);
53 53
 
54 54
 			$lcontext = clone $context;
55
-			$lcontext->setLocale( $localeItem );
55
+			$lcontext->setLocale($localeItem);
56 56
 
57
-			$cache = new \Aimeos\MAdmin\Cache\Proxy\Standard( $lcontext );
58
-			$lcontext->setCache( $cache );
57
+			$cache = new \Aimeos\MAdmin\Cache\Proxy\Standard($lcontext);
58
+			$lcontext->setCache($cache);
59 59
 
60
-			$output->writeln( sprintf( 'Clearing the Aimeos cache for site <info>%1$s</info>', $siteItem->getCode() ) );
60
+			$output->writeln(sprintf('Clearing the Aimeos cache for site <info>%1$s</info>', $siteItem->getCode()));
61 61
 
62
-			\Aimeos\MAdmin\Cache\Manager\Factory::createManager( $lcontext )->getCache()->flush();
62
+			\Aimeos\MAdmin\Cache\Manager\Factory::createManager($lcontext)->getCache()->flush();
63 63
 		}
64 64
 	}
65 65
 }
Please login to merge, or discard this patch.
DependencyInjection/Configuration.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -29,26 +29,26 @@
 block discarded – undo
29 29
 	public function getConfigTreeBuilder()
30 30
 	{
31 31
 		$treeBuilder = new TreeBuilder();
32
-		$rootNode = $treeBuilder->root( 'aimeos_shop' );
32
+		$rootNode = $treeBuilder->root('aimeos_shop');
33 33
 
34 34
 		$rootNode
35 35
 			->children()
36
-				->booleanNode('disable_sites')->defaultValue( true )->end()
37
-				->booleanNode('apc_enable')->defaultValue( false )->end()
38
-				->scalarNode('apc_prefix')->defaultValue( 'sf2:' )->end()
36
+				->booleanNode('disable_sites')->defaultValue(true)->end()
37
+				->booleanNode('apc_enable')->defaultValue(false)->end()
38
+				->scalarNode('apc_prefix')->defaultValue('sf2:')->end()
39 39
 				->scalarNode('extdir')->end()
40 40
 				->scalarNode('uploaddir')->end()
41
-				->variableNode('admin')->defaultValue( array() )->end()
42
-				->variableNode('client')->defaultValue( array() )->end()
43
-				->variableNode('controller')->defaultValue( array() )->end()
44
-				->variableNode('i18n')->defaultValue( array() )->end()
45
-				->variableNode('madmin')->defaultValue( array() )->end()
46
-				->variableNode('mshop')->defaultValue( array() )->end()
47
-				->variableNode('resource')->defaultValue( array() )->end()
48
-				->variableNode('page')->defaultValue( array() )->end()
49
-				->variableNode('backend')->defaultValue( array() )->end()
50
-				->variableNode('frontend')->defaultValue( array() )->end()
51
-				->variableNode('command')->defaultValue( array() )->end()
41
+				->variableNode('admin')->defaultValue(array())->end()
42
+				->variableNode('client')->defaultValue(array())->end()
43
+				->variableNode('controller')->defaultValue(array())->end()
44
+				->variableNode('i18n')->defaultValue(array())->end()
45
+				->variableNode('madmin')->defaultValue(array())->end()
46
+				->variableNode('mshop')->defaultValue(array())->end()
47
+				->variableNode('resource')->defaultValue(array())->end()
48
+				->variableNode('page')->defaultValue(array())->end()
49
+				->variableNode('backend')->defaultValue(array())->end()
50
+				->variableNode('frontend')->defaultValue(array())->end()
51
+				->variableNode('command')->defaultValue(array())->end()
52 52
 			->end()
53 53
 		;
54 54
 
Please login to merge, or discard this patch.