Completed
Pull Request — master (#5)
by
unknown
22:46
created
src/Base/Page.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 	 *
31 31
 	 * @param ContainerInterface $container Dependency container
32 32
 	 */
33
-	public function __construct( ContainerInterface $container )
33
+	public function __construct(ContainerInterface $container)
34 34
 	{
35 35
 		$this->container = $container;
36 36
 	}
@@ -45,24 +45,24 @@  discard block
 block discarded – undo
45 45
 	 * @param array Associative list of URI attributes
46 46
 	 * @return array Associative list with body and header output separated by client name
47 47
 	 */
48
-	public function getSections( $pageName, ServerRequestInterface $request, ResponseInterface $response, array $attr )
48
+	public function getSections($pageName, ServerRequestInterface $request, ResponseInterface $response, array $attr)
49 49
 	{
50
-		$tmplPaths = $this->container->get( 'aimeos' )->getCustomPaths( 'client/html/templates' );
51
-		$context = $this->container->get( 'aimeos_context' )->get( true, $attr );
50
+		$tmplPaths = $this->container->get('aimeos')->getCustomPaths('client/html/templates');
51
+		$context = $this->container->get('aimeos_context')->get(true, $attr);
52 52
 		$langid = $context->getLocale()->getLanguageId();
53 53
 
54
-		$view = $this->container->get( 'aimeos_view' )->create( $request, $response, $attr, $tmplPaths, $langid );
55
-		$context->setView( $view );
54
+		$view = $this->container->get('aimeos_view')->create($request, $response, $attr, $tmplPaths, $langid);
55
+		$context->setView($view);
56 56
 
57
-		$pagesConfig = $this->container->get( 'aimeos_config' )->get( 'page', array() );
58
-		$result = array( 'aibody' => array(), 'aiheader' => array() );
57
+		$pagesConfig = $this->container->get('aimeos_config')->get('page', array());
58
+		$result = array('aibody' => array(), 'aiheader' => array());
59 59
 
60
-		if( isset( $pagesConfig[$pageName] ) )
60
+		if (isset($pagesConfig[$pageName]))
61 61
 		{
62
-			foreach( (array) $pagesConfig[$pageName] as $clientName )
62
+			foreach ((array) $pagesConfig[$pageName] as $clientName)
63 63
 			{
64
-				$client = \Aimeos\Client\Html\Factory::createClient( $context, $tmplPaths, $clientName );
65
-				$client->setView( clone $view );
64
+				$client = \Aimeos\Client\Html\Factory::createClient($context, $tmplPaths, $clientName);
65
+				$client->setView(clone $view);
66 66
 				$client->process();
67 67
 
68 68
 				$result['aibody'][$clientName] = $client->getBody();
Please login to merge, or discard this patch.
src/Controller/Checkout.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -30,10 +30,10 @@  discard block
 block discarded – undo
30 30
 	 * @param ResponseInterface $response Response object
31 31
 	 * @return ResponseInterface $response Modified response object with generated output
32 32
 	 */
33
-	public static function confirmAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
33
+	public static function confirmAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
34 34
 	{
35
-		$contents = $container->get( 'aimeos_page' )->getSections( 'checkout-confirm', $request, $response, $args );
36
-		return $container->get( 'view' )->render( $response, 'Checkout/confirm.html.twig', $contents );
35
+		$contents = $container->get('aimeos_page')->getSections('checkout-confirm', $request, $response, $args);
36
+		return $container->get('view')->render($response, 'Checkout/confirm.html.twig', $contents);
37 37
 	}
38 38
 
39 39
 
@@ -45,10 +45,10 @@  discard block
 block discarded – undo
45 45
 	 * @param ResponseInterface $response Response object
46 46
 	 * @return ResponseInterface $response Modified response object with generated output
47 47
 	 */
48
-	public static function indexAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
48
+	public static function indexAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
49 49
 	{
50
-		$contents = $container->get( 'aimeos_page' )->getSections( 'checkout-index', $request, $response, $args );
51
-		return $container->get( 'view' )->render( $response, 'Checkout/index.html.twig', $contents );
50
+		$contents = $container->get('aimeos_page')->getSections('checkout-index', $request, $response, $args);
51
+		return $container->get('view')->render($response, 'Checkout/index.html.twig', $contents);
52 52
 	}
53 53
 
54 54
 
@@ -60,9 +60,9 @@  discard block
 block discarded – undo
60 60
 	 * @param ResponseInterface $response Response object
61 61
 	 * @return ResponseInterface $response Modified response object with generated output
62 62
 	 */
63
-	public static function updateAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
63
+	public static function updateAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
64 64
 	{
65
-		$contents = $container->get( 'aimeos_page' )->getSections( 'checkout-update', $request, $response, $args );
66
-		return $container->get( 'view' )->render( $response, 'Checkout/update.html.twig', $contents );
65
+		$contents = $container->get('aimeos_page')->getSections('checkout-update', $request, $response, $args);
66
+		return $container->get('view')->render($response, 'Checkout/update.html.twig', $contents);
67 67
 	}
68 68
 }
69 69
\ No newline at end of file
Please login to merge, or discard this patch.
src/Controller/Basket.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,9 +30,9 @@
 block discarded – undo
30 30
 	 * @param ResponseInterface $response Response object
31 31
 	 * @return ResponseInterface $response Modified response object with generated output
32 32
 	 */
33
-	public static function indexAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
33
+	public static function indexAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
34 34
 	{
35
-		$contents = $container->get( 'aimeos_page' )->getSections( 'basket-index', $request, $response, $args );
36
-		return $container->get( 'view' )->render( $response, 'Basket/index.html.twig', $contents );
35
+		$contents = $container->get('aimeos_page')->getSections('basket-index', $request, $response, $args);
36
+		return $container->get('view')->render($response, 'Basket/index.html.twig', $contents);
37 37
 	}
38 38
 }
39 39
\ No newline at end of file
Please login to merge, or discard this patch.
src/Controller/Account.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -30,10 +30,10 @@  discard block
 block discarded – undo
30 30
 	 * @param ResponseInterface $response Response object
31 31
 	 * @return ResponseInterface $response Modified response object with generated output
32 32
 	 */
33
-	public static function indexAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
33
+	public static function indexAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
34 34
 	{
35
-		$contents = $container->get( 'aimeos_page' )->getSections( 'account-index', $request, $response, $args );
36
-		return $container->get( 'view' )->render( $response, 'Account/index.html.twig', $contents );
35
+		$contents = $container->get('aimeos_page')->getSections('account-index', $request, $response, $args);
36
+		return $container->get('view')->render($response, 'Account/index.html.twig', $contents);
37 37
 	}
38 38
 
39 39
 
@@ -45,16 +45,16 @@  discard block
 block discarded – undo
45 45
 	 * @param ResponseInterface $response Response object
46 46
 	 * @return ResponseInterface $response Modified response object with generated output
47 47
 	 */
48
-	public static function downloadAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
48
+	public static function downloadAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
49 49
 	{
50
-		$context = $container->get( 'aimeos_context' )->get( true, $args );
50
+		$context = $container->get('aimeos_context')->get(true, $args);
51 51
 		$langid = $context->getLocale()->getLanguageId();
52 52
 
53
-		$view = $container->get( 'aimeos_view' )->create( $request, $response, $args, array(), $langid );
54
-		$context->setView( $view );
53
+		$view = $container->get('aimeos_view')->create($request, $response, $args, array(), $langid);
54
+		$context->setView($view);
55 55
 
56
-		$client = \Aimeos\Client\Html\Factory::createClient( $context, array(), 'account/download' );
57
-		$client->setView( $view );
56
+		$client = \Aimeos\Client\Html\Factory::createClient($context, array(), 'account/download');
57
+		$client->setView($view);
58 58
 		$client->process();
59 59
 
60 60
 		return $view->response();
Please login to merge, or discard this patch.
src/Controller/Catalog.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -30,14 +30,14 @@  discard block
 block discarded – undo
30 30
 	 * @param ResponseInterface $response Response object
31 31
 	 * @return ResponseInterface $response Modified response object with generated output
32 32
 	 */
33
-	public static function countAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
33
+	public static function countAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
34 34
 	{
35
-		$contents = $container->get( 'aimeos_page' )->getSections( 'catalog-count', $request, $response, $args );
35
+		$contents = $container->get('aimeos_page')->getSections('catalog-count', $request, $response, $args);
36 36
 
37
-		$response = $response->withStatus( 200 );
38
-		$response = $response->withHeader( 'Content-Type', 'application/javascript' );
37
+		$response = $response->withStatus(200);
38
+		$response = $response->withHeader('Content-Type', 'application/javascript');
39 39
 
40
-		return $container->get( 'view' )->render( $response, 'Catalog/count.html.twig', $contents );
40
+		return $container->get('view')->render($response, 'Catalog/count.html.twig', $contents);
41 41
 	}
42 42
 
43 43
 
@@ -49,10 +49,10 @@  discard block
 block discarded – undo
49 49
 	 * @param ResponseInterface $response Response object
50 50
 	 * @return ResponseInterface $response Modified response object with generated output
51 51
 	 */
52
-	public static function detailAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
52
+	public static function detailAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
53 53
 	{
54
-		$contents = $container->get( 'aimeos_page' )->getSections( 'catalog-detail', $request, $response, $args );
55
-		return $container->get( 'view' )->render( $response, 'Catalog/detail.html.twig', $contents );
54
+		$contents = $container->get('aimeos_page')->getSections('catalog-detail', $request, $response, $args);
55
+		return $container->get('view')->render($response, 'Catalog/detail.html.twig', $contents);
56 56
 	}
57 57
 
58 58
 
@@ -64,10 +64,10 @@  discard block
 block discarded – undo
64 64
 	 * @param ResponseInterface $response Response object
65 65
 	 * @return ResponseInterface $response Modified response object with generated output
66 66
 	 */
67
-	public static function listAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
67
+	public static function listAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
68 68
 	{
69
-		$contents = $container->get( 'aimeos_page' )->getSections( 'catalog-list', $request, $response, $args );
70
-		return $container->get( 'view' )->render( $response, 'Catalog/list.html.twig', $contents );
69
+		$contents = $container->get('aimeos_page')->getSections('catalog-list', $request, $response, $args);
70
+		return $container->get('view')->render($response, 'Catalog/list.html.twig', $contents);
71 71
 	}
72 72
 
73 73
 
@@ -79,14 +79,14 @@  discard block
 block discarded – undo
79 79
 	 * @param ResponseInterface $response Response object
80 80
 	 * @return ResponseInterface $response Modified response object with generated output
81 81
 	 */
82
-	public static function stockAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
82
+	public static function stockAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
83 83
 	{
84
-		$contents = $container->get( 'aimeos_page' )->getSections( 'catalog-stock', $request, $response, $args );
84
+		$contents = $container->get('aimeos_page')->getSections('catalog-stock', $request, $response, $args);
85 85
 
86
-		$response = $response->withStatus( 200 );
87
-		$response = $response->withHeader( 'Content-Type', 'application/javascript' );
86
+		$response = $response->withStatus(200);
87
+		$response = $response->withHeader('Content-Type', 'application/javascript');
88 88
 
89
-		return $container->get( 'view' )->render( $response, 'Catalog/stock.html.twig', $contents );
89
+		return $container->get('view')->render($response, 'Catalog/stock.html.twig', $contents);
90 90
 	}
91 91
 
92 92
 
@@ -98,13 +98,13 @@  discard block
 block discarded – undo
98 98
 	 * @param ResponseInterface $response Response object
99 99
 	 * @return ResponseInterface $response Modified response object with generated output
100 100
 	 */
101
-	public static function suggestAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
101
+	public static function suggestAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
102 102
 	{
103
-		$contents = $container->get( 'aimeos_page' )->getSections( 'catalog-suggest', $request, $response, $args );
103
+		$contents = $container->get('aimeos_page')->getSections('catalog-suggest', $request, $response, $args);
104 104
 
105
-		$response = $response->withStatus( 200 );
106
-		$response = $response->withHeader( 'Content-Type', 'application/json' );
105
+		$response = $response->withStatus(200);
106
+		$response = $response->withHeader('Content-Type', 'application/json');
107 107
 
108
-		return $container->get( 'view' )->render( $response, 'Catalog/suggest.html.twig', $contents );
108
+		return $container->get('view')->render($response, 'Catalog/suggest.html.twig', $contents);
109 109
 	}
110 110
 }
111 111
\ No newline at end of file
Please login to merge, or discard this patch.
src/Command/Iface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
 	 *
24 24
 	 * @param array $argv Associative array from $_SERVER['argv']
25 25
 	 */
26
-	public static function run( array $argv );
26
+	public static function run(array $argv);
27 27
 
28 28
 	/**
29 29
 	 * Returns the command usage and options
Please login to merge, or discard this patch.
src/Command/Cache.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -34,19 +34,19 @@  discard block
 block discarded – undo
34 34
 	 *
35 35
 	 * @param array $argv Associative array from $_SERVER['argv']
36 36
 	 */
37
-	public static function run( array $argv )
37
+	public static function run(array $argv)
38 38
 	{
39
-		array_shift( $argv );
40
-		$options = self::getOptions( $argv );
41
-		$sites = array_shift( $argv );
39
+		array_shift($argv);
40
+		$options = self::getOptions($argv);
41
+		$sites = array_shift($argv);
42 42
 
43
-		$extdirs = ( isset( $options['extdir'] ) ? (array) $options['extdir'] : array() );
44
-		$aimeos = new \Aimeos\Bootstrap( $extdirs );
43
+		$extdirs = (isset($options['extdir']) ? (array) $options['extdir'] : array());
44
+		$aimeos = new \Aimeos\Bootstrap($extdirs);
45 45
 
46
-		$ctx = self::getContext( $aimeos->getConfigPaths(), $options );
47
-		$siteItems = self::getSiteItems( $ctx, $sites );
46
+		$ctx = self::getContext($aimeos->getConfigPaths(), $options);
47
+		$siteItems = self::getSiteItems($ctx, $sites);
48 48
 
49
-		self::clear( $ctx, $siteItems );
49
+		self::clear($ctx, $siteItems);
50 50
 	}
51 51
 
52 52
 
@@ -57,32 +57,32 @@  discard block
 block discarded – undo
57 57
 	 * @param array $options Associative list of configuration options as key/value pairs
58 58
 	 * @return \Aimeos\MShop\Context\Item\Iface Context object
59 59
 	 */
60
-	protected static function getContext( array $confPaths, array $options )
60
+	protected static function getContext(array $confPaths, array $options)
61 61
 	{
62 62
 		$config = array();
63 63
 		$ctx = new \Aimeos\MShop\Context\Item\Standard();
64 64
 
65
-		if( isset( $options['config'] ) )
65
+		if (isset($options['config']))
66 66
 		{
67
-			foreach( (array) $options['config'] as $path )
67
+			foreach ((array) $options['config'] as $path)
68 68
 			{
69
-				if( is_file( $path ) ) {
70
-					$config = array_replace_recursive( $config, require $path );
69
+				if (is_file($path)) {
70
+					$config = array_replace_recursive($config, require $path);
71 71
 				} else {
72 72
 					$confPaths[] = $path;
73 73
 				}
74 74
 			}
75 75
 		}
76 76
 
77
-		$conf = new \Aimeos\MW\Config\PHPArray( $config, $confPaths );
78
-		$conf = new \Aimeos\MW\Config\Decorator\Memory( $conf );
79
-		$ctx->setConfig( $conf );
77
+		$conf = new \Aimeos\MW\Config\PHPArray($config, $confPaths);
78
+		$conf = new \Aimeos\MW\Config\Decorator\Memory($conf);
79
+		$ctx->setConfig($conf);
80 80
 
81
-		$dbm = new \Aimeos\MW\DB\Manager\PDO( $conf );
82
-		$ctx->setDatabaseManager( $dbm );
81
+		$dbm = new \Aimeos\MW\DB\Manager\PDO($conf);
82
+		$ctx->setDatabaseManager($dbm);
83 83
 
84
-		$logger = new \Aimeos\MW\Logger\Errorlog( \Aimeos\MW\Logger\Base::INFO );
85
-		$ctx->setLogger( $logger );
84
+		$logger = new \Aimeos\MW\Logger\Errorlog(\Aimeos\MW\Logger\Base::INFO);
85
+		$ctx->setLogger($logger);
86 86
 
87 87
 		return $ctx;
88 88
 	}
@@ -94,23 +94,23 @@  discard block
 block discarded – undo
94 94
 	 * @param \Aimeos\MShop\Context\Item\Iface $ctx Context object
95 95
 	 * @param array $siteItems List of site items implementing \Aimeos\MShop\Locale\Site\Iface
96 96
 	 */
97
-	protected static function clear( \Aimeos\MShop\Context\Item\Iface $ctx, array $siteItems )
97
+	protected static function clear(\Aimeos\MShop\Context\Item\Iface $ctx, array $siteItems)
98 98
 	{
99
-		$localeManager = \Aimeos\MShop\Factory::createManager( $ctx, 'locale' );
99
+		$localeManager = \Aimeos\MShop\Factory::createManager($ctx, 'locale');
100 100
 
101
-		foreach( $siteItems as $siteItem )
101
+		foreach ($siteItems as $siteItem)
102 102
 		{
103
-			$localeItem = $localeManager->bootstrap( $siteItem->getCode(), '', '', false );
103
+			$localeItem = $localeManager->bootstrap($siteItem->getCode(), '', '', false);
104 104
 
105 105
 			$lcontext = clone $ctx;
106
-			$lcontext->setLocale( $localeItem );
106
+			$lcontext->setLocale($localeItem);
107 107
 
108
-			$cache = new \Aimeos\MAdmin\Cache\Proxy\Standard( $lcontext );
109
-			$lcontext->setCache( $cache );
108
+			$cache = new \Aimeos\MAdmin\Cache\Proxy\Standard($lcontext);
109
+			$lcontext->setCache($cache);
110 110
 
111
-			printf( "Clearing the Aimeos cache for site \"%1\$s\"\n", $siteItem->getCode() );
111
+			printf("Clearing the Aimeos cache for site \"%1\$s\"\n", $siteItem->getCode());
112 112
 
113
-			\Aimeos\MAdmin\Cache\Manager\Factory::createManager( $lcontext )->getCache()->flush();
113
+			\Aimeos\MAdmin\Cache\Manager\Factory::createManager($lcontext)->getCache()->flush();
114 114
 		}
115 115
 	}
116 116
 }
117 117
\ No newline at end of file
Please login to merge, or discard this patch.
src/Command/Jobs.php 1 patch
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -34,27 +34,27 @@  discard block
 block discarded – undo
34 34
 	 *
35 35
 	 * @return string Command usage and options
36 36
 	 */
37
-	public static function run( array $argv )
37
+	public static function run(array $argv)
38 38
 	{
39
-		array_shift( $argv );
40
-		$options = self::getOptions( $argv );
39
+		array_shift($argv);
40
+		$options = self::getOptions($argv);
41 41
 
42
-		if( ( $jobs = array_shift( $argv ) ) === null ) {
42
+		if (($jobs = array_shift($argv)) === null) {
43 43
 			throw new \Aimeos\Slim\Command\Exception();
44 44
 		}
45
-		$sites = array_shift( $argv );
45
+		$sites = array_shift($argv);
46 46
 
47
-		$config = self::getConfig( $options );
47
+		$config = self::getConfig($options);
48 48
 
49
-		$app = new \Slim\App( $config );
50
-		$aimeos = new \Aimeos\Slim\Bootstrap( $app, $config );
51
-		$aimeos->setup( ( isset( $options['extdir'] ) ? $options['extdir'] : './ext' ) );
49
+		$app = new \Slim\App($config);
50
+		$aimeos = new \Aimeos\Slim\Bootstrap($app, $config);
51
+		$aimeos->setup((isset($options['extdir']) ? $options['extdir'] : './ext'));
52 52
 
53 53
 		$container = $app->getContainer();
54
-		$context = self::getContext( $container );
54
+		$context = self::getContext($container);
55 55
 
56
-		$siteItems = self::getSiteItems( $context, $sites );
57
-		self::execute( $container->get( 'aimeos' ), $context, $siteItems, $jobs );
56
+		$siteItems = self::getSiteItems($context, $sites);
57
+		self::execute($container->get('aimeos'), $context, $siteItems, $jobs);
58 58
 	}
59 59
 
60 60
 
@@ -64,16 +64,16 @@  discard block
 block discarded – undo
64 64
 	 * @param array $options Associative list of given options
65 65
 	 * @return array Multi-dimensional array of configuration settings
66 66
 	 */
67
-	protected static function getConfig( array $options )
67
+	protected static function getConfig(array $options)
68 68
 	{
69 69
 		$config = array();
70 70
 
71
-		if( isset( $options['config'] ) )
71
+		if (isset($options['config']))
72 72
 		{
73
-			foreach( (array) $options['config'] as $path )
73
+			foreach ((array) $options['config'] as $path)
74 74
 			{
75
-				if( is_file( $path ) ) {
76
-					$config = array_replace_recursive( $config, require $path );
75
+				if (is_file($path)) {
76
+					$config = array_replace_recursive($config, require $path);
77 77
 				}
78 78
 			}
79 79
 		}
@@ -88,25 +88,25 @@  discard block
 block discarded – undo
88 88
 	 * @param \Interop\Container\ContainerInterface $container Dependency injection container
89 89
 	 * @return \Aimeos\MShop\Context\Item\Standard Context object
90 90
 	 */
91
-	protected static function getContext( \Interop\Container\ContainerInterface $container )
91
+	protected static function getContext(\Interop\Container\ContainerInterface $container)
92 92
 	{
93
-		$aimeos = $container->get( 'aimeos' );
94
-		$context = $container->get( 'aimeos_context' )->get( false );
93
+		$aimeos = $container->get('aimeos');
94
+		$context = $container->get('aimeos_context')->get(false);
95 95
 
96 96
 		$env = \Slim\Http\Environment::mock();
97
-		$request = \Slim\Http\Request::createFromEnvironment( $env );
97
+		$request = \Slim\Http\Request::createFromEnvironment($env);
98 98
 		$response = new \Slim\Http\Response();
99 99
 
100
-		$tmplPaths = $aimeos->getCustomPaths( 'controller/jobs/templates' );
101
-		$view = $container->get( 'aimeos_view' )->create( $request, $response, array(), $tmplPaths );
100
+		$tmplPaths = $aimeos->getCustomPaths('controller/jobs/templates');
101
+		$view = $container->get('aimeos_view')->create($request, $response, array(), $tmplPaths);
102 102
 
103
-		$langManager = \Aimeos\MShop\Factory::createManager( $context, 'locale/language' );
104
-		$langids = array_keys( $langManager->searchItems( $langManager->createSearch( true ) ) );
105
-		$i18n = $container->get( 'aimeos_i18n' )->get( $langids );
103
+		$langManager = \Aimeos\MShop\Factory::createManager($context, 'locale/language');
104
+		$langids = array_keys($langManager->searchItems($langManager->createSearch(true)));
105
+		$i18n = $container->get('aimeos_i18n')->get($langids);
106 106
 
107
-		$context->setEditor( 'aimeos:jobs' );
108
-		$context->setView( $view );
109
-		$context->setI18n( $i18n );
107
+		$context->setEditor('aimeos:jobs');
108
+		$context->setView($view);
109
+		$context->setI18n($i18n);
110 110
 
111 111
 		return $context;
112 112
 	}
@@ -119,19 +119,19 @@  discard block
 block discarded – undo
119 119
 	 * @param \Aimeos\MShop\Context\Item\Iface $ctx Context object
120 120
 	 * @param array $siteItems List of site items implementing \Aimeos\MShop\Locale\Site\Iface
121 121
 	 */
122
-	protected static function execute( \Aimeos\Bootstrap $aimeos, \Aimeos\MShop\Context\Item\Iface $ctx, array $siteItems, $jobs )
122
+	protected static function execute(\Aimeos\Bootstrap $aimeos, \Aimeos\MShop\Context\Item\Iface $ctx, array $siteItems, $jobs)
123 123
 	{
124
-		$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $ctx );
124
+		$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($ctx);
125 125
 
126
-		foreach( $siteItems as $siteItem )
126
+		foreach ($siteItems as $siteItem)
127 127
 		{
128
-			$localeItem = $localeManager->bootstrap( $siteItem->getCode(), 'en', '', false );
129
-			$ctx->setLocale( $localeItem );
128
+			$localeItem = $localeManager->bootstrap($siteItem->getCode(), 'en', '', false);
129
+			$ctx->setLocale($localeItem);
130 130
 
131
-			printf( "Executing the Aimeos jobs for \"%s\"\n", $siteItem->getCode() );
131
+			printf("Executing the Aimeos jobs for \"%s\"\n", $siteItem->getCode());
132 132
 
133
-			foreach( (array) explode( ' ', $jobs ) as $jobname ) {
134
-				\Aimeos\Controller\Jobs\Factory::createController( $ctx, $aimeos, $jobname )->run();
133
+			foreach ((array) explode(' ', $jobs) as $jobname) {
134
+				\Aimeos\Controller\Jobs\Factory::createController($ctx, $aimeos, $jobname)->run();
135 135
 			}
136 136
 		}
137 137
 	}
Please login to merge, or discard this patch.
src/Command/Base.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -24,31 +24,31 @@  discard block
 block discarded – undo
24 24
 	 * @param array &$params List of parameters
25 25
 	 * @return array Associative list of option name and value(s)
26 26
 	 */
27
-	protected static function getOptions( array &$params )
27
+	protected static function getOptions(array &$params)
28 28
 	{
29 29
 		$options = array();
30 30
 
31
-		foreach( $params as $key => $option )
31
+		foreach ($params as $key => $option)
32 32
 		{
33
-			if( $option === '--help' ) {
33
+			if ($option === '--help') {
34 34
 				throw new Exception();
35 35
 			}
36 36
 
37
-			if( strncmp( $option, '--', 2 ) === 0 && ( $pos = strpos( $option, '=', 2 ) ) !== false )
37
+			if (strncmp($option, '--', 2) === 0 && ($pos = strpos($option, '=', 2)) !== false)
38 38
 			{
39
-				$name = substr( $option, 2, $pos - 2 );
39
+				$name = substr($option, 2, $pos - 2);
40 40
 
41
-				if( isset( $options[$name] ) )
41
+				if (isset($options[$name]))
42 42
 				{
43 43
 					$options[$name] = (array) $options[$name];
44
-					$options[$name][] = substr( $option, $pos + 1 );
44
+					$options[$name][] = substr($option, $pos + 1);
45 45
 				}
46 46
 				else
47 47
 				{
48
-					$options[$name] = substr( $option, $pos + 1 );
48
+					$options[$name] = substr($option, $pos + 1);
49 49
 				}
50 50
 
51
-				unset( $params[$key] );
51
+				unset($params[$key]);
52 52
 			}
53 53
 		}
54 54
 
@@ -62,19 +62,19 @@  discard block
 block discarded – undo
62 62
 	 * @param \Aimeos\MShop\Context\Item\Iface $ctx Context object
63 63
 	 * @param string|null $sites List of site codes separated by a space
64 64
 	 */
65
-	protected static function getSiteItems( \Aimeos\MShop\Context\Item\Iface $ctx, $sites )
65
+	protected static function getSiteItems(\Aimeos\MShop\Context\Item\Iface $ctx, $sites)
66 66
 	{
67
-		$manager = \Aimeos\MShop\Factory::createManager( $ctx, 'locale/site' );
67
+		$manager = \Aimeos\MShop\Factory::createManager($ctx, 'locale/site');
68 68
 		$search = $manager->createSearch();
69 69
 
70
-		if( is_scalar( $sites ) && $sites != '' ) {
71
-			$sites = explode( ' ', $sites );
70
+		if (is_scalar($sites) && $sites != '') {
71
+			$sites = explode(' ', $sites);
72 72
 		}
73 73
 
74
-		if( !empty( $sites ) ) {
75
-			$search->setConditions( $search->compare( '==', 'locale.site.code', $sites ) );
74
+		if (!empty($sites)) {
75
+			$search->setConditions($search->compare('==', 'locale.site.code', $sites));
76 76
 		}
77 77
 
78
-		return $manager->searchItems( $search );
78
+		return $manager->searchItems($search);
79 79
 	}
80 80
 }
81 81
\ No newline at end of file
Please login to merge, or discard this patch.