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/Controller/Extadm.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -160,7 +160,7 @@
 block discarded – undo
160 160
 	 * Creates a list of all available translations
161 161
 	 *
162 162
 	 * @param \Aimeos\Bootstrap $aimeos Aimeos object
163
-	 * @return array List of language IDs with labels
163
+	 * @return string List of language IDs with labels
164 164
 	 */
165 165
 	protected static function getJsonLanguages( \Aimeos\Bootstrap $aimeos )
166 166
 	{
Please login to merge, or discard this patch.
Spacing   +73 added lines, -73 removed lines patch added patch discarded remove patch
@@ -32,62 +32,62 @@  discard block
 block discarded – undo
32 32
 	 * @param array $args Associative list of route parameters
33 33
 	 * @return ResponseInterface $response Modified response object with generated output
34 34
 	 */
35
-	public static function indexAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
35
+	public static function indexAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
36 36
 	{
37
-		$site = ( isset( $args['site'] ) ? $args['site'] : 'default' );
38
-		$lang = ( isset( $args['lang'] ) ? $args['lang'] : 'en' );
39
-		$tab = ( isset( $args['tab'] ) ? $args['tab'] : 0 );
37
+		$site = (isset($args['site']) ? $args['site'] : 'default');
38
+		$lang = (isset($args['lang']) ? $args['lang'] : 'en');
39
+		$tab = (isset($args['tab']) ? $args['tab'] : 0);
40 40
 
41
-		$aimeos = $container->get( 'aimeos' );
42
-		$cntlPaths = $aimeos->getCustomPaths( 'controller/extjs' );
41
+		$aimeos = $container->get('aimeos');
42
+		$cntlPaths = $aimeos->getCustomPaths('controller/extjs');
43 43
 
44
-		$context = $container->get( 'aimeos_context' )->get( false, $args );
45
-		$context = self::setLocale( $context, $site, $lang );
44
+		$context = $container->get('aimeos_context')->get(false, $args);
45
+		$context = self::setLocale($context, $site, $lang);
46 46
 
47
-		$controller = new \Aimeos\Controller\ExtJS\JsonRpc( $context, $cntlPaths );
47
+		$controller = new \Aimeos\Controller\ExtJS\JsonRpc($context, $cntlPaths);
48 48
 		$cssFiles = array();
49 49
 
50
-		foreach( $aimeos->getCustomPaths( 'admin/extjs' ) as $base => $paths )
50
+		foreach ($aimeos->getCustomPaths('admin/extjs') as $base => $paths)
51 51
 		{
52
-			foreach( $paths as $path )
52
+			foreach ($paths as $path)
53 53
 			{
54
-				$jsbAbsPath = $base . '/' . $path;
54
+				$jsbAbsPath = $base.'/'.$path;
55 55
 
56
-				if( !is_file( $jsbAbsPath ) ) {
57
-					throw new \Exception( sprintf( 'JSB2 file "%1$s" not found', $jsbAbsPath ) );
56
+				if (!is_file($jsbAbsPath)) {
57
+					throw new \Exception(sprintf('JSB2 file "%1$s" not found', $jsbAbsPath));
58 58
 				}
59 59
 
60
-				$jsb2 = new \Aimeos\MW\Jsb2\Standard( $jsbAbsPath, dirname( $path ) );
61
-				$cssFiles = array_merge( $cssFiles, $jsb2->getUrls( 'css' ) );
60
+				$jsb2 = new \Aimeos\MW\Jsb2\Standard($jsbAbsPath, dirname($path));
61
+				$cssFiles = array_merge($cssFiles, $jsb2->getUrls('css'));
62 62
 			}
63 63
 		}
64 64
 
65
-		$csrfname = $request->getAttribute( 'csrf_name' );
66
-		$csrfvalue = $request->getAttribute( 'csrf_value' );
65
+		$csrfname = $request->getAttribute('csrf_name');
66
+		$csrfvalue = $request->getAttribute('csrf_value');
67 67
 
68
-		$router = $container->get( 'router' );
69
-		$jqadmUrl = $router->pathFor( 'aimeos_shop_jqadm_search', array( 'site' => $site, 'resource' => 'product' ) );
70
-		$jsonUrl = $router->pathFor( 'aimeos_shop_extadm_json', array( 'site' => $site, $csrfname => $csrfvalue ) );
71
-		$adminUrl = $router->pathFor( 'aimeos_shop_extadm', array( 'site' => '<site>', 'lang' => '<lang>', 'tab' => '<tab>' ) );
68
+		$router = $container->get('router');
69
+		$jqadmUrl = $router->pathFor('aimeos_shop_jqadm_search', array('site' => $site, 'resource' => 'product'));
70
+		$jsonUrl = $router->pathFor('aimeos_shop_extadm_json', array('site' => $site, $csrfname => $csrfvalue));
71
+		$adminUrl = $router->pathFor('aimeos_shop_extadm', array('site' => '<site>', 'lang' => '<lang>', 'tab' => '<tab>'));
72 72
 
73 73
 		$vars = array(
74 74
 			'lang' => $lang,
75 75
 			'cssFiles' => $cssFiles,
76
-			'languages' => self::getJsonLanguages( $aimeos ),
77
-			'config' => self::getJsonClientConfig( $context ),
78
-			'site' => self::getJsonSiteItem( $context, $site ),
79
-			'i18nContent' => self::getJsonClientI18n( $aimeos->getI18nPaths(), $lang ),
80
-			'uploaddir' => $context->getConfig()->get( 'uploaddir', '/.' ),
76
+			'languages' => self::getJsonLanguages($aimeos),
77
+			'config' => self::getJsonClientConfig($context),
78
+			'site' => self::getJsonSiteItem($context, $site),
79
+			'i18nContent' => self::getJsonClientI18n($aimeos->getI18nPaths(), $lang),
80
+			'uploaddir' => $context->getConfig()->get('uploaddir', '/.'),
81 81
 			'searchSchemas' => $controller->getJsonSearchSchemas(),
82 82
 			'itemSchemas' => $controller->getJsonItemSchemas(),
83
-			'smd' => $controller->getJsonSmd( $jsonUrl ),
83
+			'smd' => $controller->getJsonSmd($jsonUrl),
84 84
 			'urlTemplate' => $adminUrl,
85 85
 			'jqadmurl' => $jqadmUrl,
86 86
 			'activeTab' => $tab,
87 87
 			'version' => \Aimeos\Slim\Bootstrap::getVersion(),
88 88
 		);
89 89
 
90
-		return $container->get( 'view' )->render( $response, 'Extadm/index.html.twig', $vars );
90
+		return $container->get('view')->render($response, 'Extadm/index.html.twig', $vars);
91 91
 	}
92 92
 
93 93
 
@@ -100,22 +100,22 @@  discard block
 block discarded – undo
100 100
 	 * @param array $args Associative list of route parameters
101 101
 	 * @return ResponseInterface $response Modified response object with generated output
102 102
 	 */
103
-	public static function doAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
103
+	public static function doAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
104 104
 	{
105
-		$cntlPaths = $container->get( 'aimeos' )->getCustomPaths( 'controller/extjs' );
105
+		$cntlPaths = $container->get('aimeos')->getCustomPaths('controller/extjs');
106 106
 
107
-		$context = $container->get( 'aimeos_context' )->get( false, $args );
108
-		$context->setView( $container->get( 'aimeos_view' )->create( $request, $response, $args, array() ) );
109
-		$context = self::setLocale( $context );
107
+		$context = $container->get('aimeos_context')->get(false, $args);
108
+		$context->setView($container->get('aimeos_view')->create($request, $response, $args, array()));
109
+		$context = self::setLocale($context);
110 110
 
111 111
 		$params = $request->getQueryParams();
112
-		if( ( $post = $request->getParsedBody() ) !== null ) {
113
-			$params = array_merge( $params, (array) $post );
112
+		if (($post = $request->getParsedBody()) !== null) {
113
+			$params = array_merge($params, (array) $post);
114 114
 		}
115 115
 
116
-		$controller = new \Aimeos\Controller\ExtJS\JsonRpc( $context, $cntlPaths );
117
-		$output = $controller->process( $params, (string) $request->getBody() );
118
-		$response->getBody()->write( $output );
116
+		$controller = new \Aimeos\Controller\ExtJS\JsonRpc($context, $cntlPaths);
117
+		$output = $controller->process($params, (string) $request->getBody());
118
+		$response->getBody()->write($output);
119 119
 
120 120
 		return $response;
121 121
 	}
@@ -130,30 +130,30 @@  discard block
 block discarded – undo
130 130
 	 * @param array $args Associative list of route parameters
131 131
 	 * @return ResponseInterface $response Modified response object with generated output
132 132
 	 */
133
-	public static function fileAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
133
+	public static function fileAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
134 134
 	{
135 135
 		$contents = '';
136 136
 		$jsFiles = array();
137
-		$aimeos = $container->get( 'aimeos' );
137
+		$aimeos = $container->get('aimeos');
138 138
 
139
-		foreach( $aimeos->getCustomPaths( 'admin/extjs' ) as $base => $paths )
139
+		foreach ($aimeos->getCustomPaths('admin/extjs') as $base => $paths)
140 140
 		{
141
-			foreach( $paths as $path )
141
+			foreach ($paths as $path)
142 142
 			{
143
-				$jsbAbsPath = $base . '/' . $path;
144
-				$jsb2 = new \Aimeos\MW\Jsb2\Standard( $jsbAbsPath, dirname( $jsbAbsPath ) );
145
-				$jsFiles = array_merge( $jsFiles, $jsb2->getFiles( 'js' ) );
143
+				$jsbAbsPath = $base.'/'.$path;
144
+				$jsb2 = new \Aimeos\MW\Jsb2\Standard($jsbAbsPath, dirname($jsbAbsPath));
145
+				$jsFiles = array_merge($jsFiles, $jsb2->getFiles('js'));
146 146
 			}
147 147
 		}
148 148
 
149
-		foreach( $jsFiles as $file )
149
+		foreach ($jsFiles as $file)
150 150
 		{
151
-			if( ( $content = file_get_contents( $file ) ) !== false ) {
151
+			if (($content = file_get_contents($file)) !== false) {
152 152
 				$contents .= $content;
153 153
 			}
154 154
 		}
155 155
 
156
-		return $response->withHeader( 'Content-Type', 'application/javascript' )->getBody()->write( $contents );
156
+		return $response->withHeader('Content-Type', 'application/javascript')->getBody()->write($contents);
157 157
 	}
158 158
 
159 159
 
@@ -163,15 +163,15 @@  discard block
 block discarded – undo
163 163
 	 * @param \Aimeos\Bootstrap $aimeos Aimeos object
164 164
 	 * @return array List of language IDs with labels
165 165
 	 */
166
-	protected static function getJsonLanguages( \Aimeos\Bootstrap $aimeos )
166
+	protected static function getJsonLanguages(\Aimeos\Bootstrap $aimeos)
167 167
 	{
168 168
 		$result = array();
169 169
 
170
-		foreach( $aimeos->getI18nList( 'admin' ) as $id ) {
171
-			$result[] = array( 'id' => $id, 'label' => $id );
170
+		foreach ($aimeos->getI18nList('admin') as $id) {
171
+			$result[] = array('id' => $id, 'label' => $id);
172 172
 		}
173 173
 
174
-		return json_encode( $result );
174
+		return json_encode($result);
175 175
 	}
176 176
 
177 177
 
@@ -181,10 +181,10 @@  discard block
 block discarded – undo
181 181
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context item object
182 182
 	 * @return string JSON encoded configuration object
183 183
 	 */
184
-	protected static function getJsonClientConfig( \Aimeos\MShop\Context\Item\Iface $context )
184
+	protected static function getJsonClientConfig(\Aimeos\MShop\Context\Item\Iface $context)
185 185
 	{
186
-		$config = $context->getConfig()->get( 'admin/extjs', array() );
187
-		return json_encode( array( 'admin' => array( 'extjs' => $config ) ), JSON_FORCE_OBJECT );
186
+		$config = $context->getConfig()->get('admin/extjs', array());
187
+		return json_encode(array('admin' => array('extjs' => $config)), JSON_FORCE_OBJECT);
188 188
 	}
189 189
 
190 190
 
@@ -195,16 +195,16 @@  discard block
 block discarded – undo
195 195
 	 * @param string $lang ISO language code like "en" or "en_GB"
196 196
 	 * @return string JSON encoded translation object
197 197
 	 */
198
-	protected static function getJsonClientI18n( array $i18nPaths, $lang )
198
+	protected static function getJsonClientI18n(array $i18nPaths, $lang)
199 199
 	{
200
-		$i18n = new \Aimeos\MW\Translation\Gettext( $i18nPaths, $lang );
200
+		$i18n = new \Aimeos\MW\Translation\Gettext($i18nPaths, $lang);
201 201
 
202 202
 		$content = array(
203
-			'admin' => $i18n->getAll( 'admin' ),
204
-			'admin/ext' => $i18n->getAll( 'admin/ext' ),
203
+			'admin' => $i18n->getAll('admin'),
204
+			'admin/ext' => $i18n->getAll('admin/ext'),
205 205
 		);
206 206
 
207
-		return json_encode( $content, JSON_FORCE_OBJECT );
207
+		return json_encode($content, JSON_FORCE_OBJECT);
208 208
 	}
209 209
 
210 210
 
@@ -216,19 +216,19 @@  discard block
 block discarded – undo
216 216
 	 * @return string JSON encoded site item object
217 217
 	 * @throws Exception If no site item was found for the code
218 218
 	 */
219
-	protected static function getJsonSiteItem( \Aimeos\MShop\Context\Item\Iface $context, $site )
219
+	protected static function getJsonSiteItem(\Aimeos\MShop\Context\Item\Iface $context, $site)
220 220
 	{
221
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'locale/site' );
221
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'locale/site');
222 222
 
223 223
 		$criteria = $manager->createSearch();
224
-		$criteria->setConditions( $criteria->compare( '==', 'locale.site.code', $site ) );
225
-		$items = $manager->searchItems( $criteria );
224
+		$criteria->setConditions($criteria->compare('==', 'locale.site.code', $site));
225
+		$items = $manager->searchItems($criteria);
226 226
 
227
-		if( ( $item = reset( $items ) ) === false ) {
228
-			throw new \Exception( sprintf( 'No site found for code "%1$s"', $site ) );
227
+		if (($item = reset($items)) === false) {
228
+			throw new \Exception(sprintf('No site found for code "%1$s"', $site));
229 229
 		}
230 230
 
231
-		return json_encode( $item->toArray() );
231
+		return json_encode($item->toArray());
232 232
 	}
233 233
 
234 234
 
@@ -240,17 +240,17 @@  discard block
 block discarded – undo
240 240
 	 * @param string $locale ISO language code, e.g. "en" or "en_GB"
241 241
 	 * @return \Aimeos\MShop\Context\Item\Iface Modified context object
242 242
 	 */
243
-	protected static function setLocale( \Aimeos\MShop\Context\Item\Iface $context, $sitecode = 'default', $locale = null )
243
+	protected static function setLocale(\Aimeos\MShop\Context\Item\Iface $context, $sitecode = 'default', $locale = null)
244 244
 	{
245
-		$localeManager = \Aimeos\MShop\Factory::createManager( $context, 'locale' );
245
+		$localeManager = \Aimeos\MShop\Factory::createManager($context, 'locale');
246 246
 
247 247
 		try {
248
-			$localeItem = $localeManager->bootstrap( $sitecode, $locale, '', false );
249
-		} catch( \Aimeos\MShop\Locale\Exception $e ) {
248
+			$localeItem = $localeManager->bootstrap($sitecode, $locale, '', false);
249
+		} catch (\Aimeos\MShop\Locale\Exception $e) {
250 250
 			$localeItem = $localeManager->createItem();
251 251
 		}
252 252
 
253
-		$context->setLocale( $localeItem );
253
+		$context->setLocale($localeItem);
254 254
 
255 255
 		return $context;
256 256
 	}
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.