@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | * |
29 | 29 | * @param Container $container Container object to access parameters |
30 | 30 | */ |
31 | - public function __construct( Container $container ) |
|
31 | + public function __construct(Container $container) |
|
32 | 32 | { |
33 | 33 | $this->container = $container; |
34 | 34 | } |
@@ -40,23 +40,23 @@ discard block |
||
40 | 40 | * @param string $pageName Name of the configured page |
41 | 41 | * @return array Associative list with body and header output separated by client name |
42 | 42 | */ |
43 | - public function getSections( $pageName ) |
|
43 | + public function getSections($pageName) |
|
44 | 44 | { |
45 | 45 | $context = $this->container->get('aimeos_context')->get(); |
46 | - $pagesConfig = $this->container->getParameter( 'aimeos_shop.page' ); |
|
47 | - $result = array( 'aibody' => array(), 'aiheader' => array() ); |
|
46 | + $pagesConfig = $this->container->getParameter('aimeos_shop.page'); |
|
47 | + $result = array('aibody' => array(), 'aiheader' => array()); |
|
48 | 48 | |
49 | 49 | $langid = $context->getLocale()->getLanguageId(); |
50 | - $tmplPaths = $this->container->get('aimeos')->get()->getCustomPaths( 'client/html/templates' ); |
|
51 | - $view = $this->container->get('aimeos_view')->create( $context->getConfig(), $tmplPaths, $langid ); |
|
52 | - $context->setView( $view ); |
|
50 | + $tmplPaths = $this->container->get('aimeos')->get()->getCustomPaths('client/html/templates'); |
|
51 | + $view = $this->container->get('aimeos_view')->create($context->getConfig(), $tmplPaths, $langid); |
|
52 | + $context->setView($view); |
|
53 | 53 | |
54 | - if( isset( $pagesConfig[$pageName] ) ) |
|
54 | + if (isset($pagesConfig[$pageName])) |
|
55 | 55 | { |
56 | - foreach( (array) $pagesConfig[$pageName] as $clientName ) |
|
56 | + foreach ((array) $pagesConfig[$pageName] as $clientName) |
|
57 | 57 | { |
58 | - $client = \Aimeos\Client\Html\Factory::createClient( $context, $tmplPaths, $clientName ); |
|
59 | - $client->setView( clone $view ); |
|
58 | + $client = \Aimeos\Client\Html\Factory::createClient($context, $tmplPaths, $clientName); |
|
59 | + $client->setView(clone $view); |
|
60 | 60 | $client->process(); |
61 | 61 | |
62 | 62 | $result['aibody'][$clientName] = $client->getBody(); |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | * |
30 | 30 | * @param Container $container Container object to access parameters |
31 | 31 | */ |
32 | - public function __construct( Container $container ) |
|
32 | + public function __construct(Container $container) |
|
33 | 33 | { |
34 | 34 | $this->container = $container; |
35 | 35 | } |
@@ -41,27 +41,27 @@ discard block |
||
41 | 41 | * @param array $languageIds List of two letter ISO language IDs |
42 | 42 | * @return \Aimeos\MW\Translation\Interface[] List of translation objects |
43 | 43 | */ |
44 | - public function get( array $languageIds ) |
|
44 | + public function get(array $languageIds) |
|
45 | 45 | { |
46 | - $i18nPaths = $this->container->get( 'aimeos' )->get()->getI18nPaths(); |
|
46 | + $i18nPaths = $this->container->get('aimeos')->get()->getI18nPaths(); |
|
47 | 47 | |
48 | - foreach( $languageIds as $langid ) |
|
48 | + foreach ($languageIds as $langid) |
|
49 | 49 | { |
50 | - if( !isset( $this->i18n[$langid] ) ) |
|
50 | + if (!isset($this->i18n[$langid])) |
|
51 | 51 | { |
52 | - $i18n = new \Aimeos\MW\Translation\Zend2( $i18nPaths, 'gettext', $langid, array( 'disableNotices' => true ) ); |
|
52 | + $i18n = new \Aimeos\MW\Translation\Zend2($i18nPaths, 'gettext', $langid, array('disableNotices' => true)); |
|
53 | 53 | |
54 | - $apc = (bool) $this->container->getParameter( 'aimeos_shop.apc_enable' ); |
|
55 | - $prefix = $this->container->getParameter( 'aimeos_shop.apc_prefix' ); |
|
54 | + $apc = (bool) $this->container->getParameter('aimeos_shop.apc_enable'); |
|
55 | + $prefix = $this->container->getParameter('aimeos_shop.apc_prefix'); |
|
56 | 56 | |
57 | - if( function_exists( 'apc_store' ) === true && $apc === true ) { |
|
58 | - $i18n = new \Aimeos\MW\Translation\Decorator\APC( $i18n, $prefix ); |
|
57 | + if (function_exists('apc_store') === true && $apc === true) { |
|
58 | + $i18n = new \Aimeos\MW\Translation\Decorator\APC($i18n, $prefix); |
|
59 | 59 | } |
60 | 60 | |
61 | - $translations = $this->container->getParameter( 'aimeos_shop.i18n' ); |
|
61 | + $translations = $this->container->getParameter('aimeos_shop.i18n'); |
|
62 | 62 | |
63 | - if( isset( $translations[$langid] ) ) { |
|
64 | - $i18n = new \Aimeos\MW\Translation\Decorator\Memory( $i18n, $translations[$langid] ); |
|
63 | + if (isset($translations[$langid])) { |
|
64 | + $i18n = new \Aimeos\MW\Translation\Decorator\Memory($i18n, $translations[$langid]); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | $this->i18n[$langid] = $i18n; |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | * @param RequestStack $requestStack Current request stack |
32 | 32 | * @param Container $container Container object to access parameters |
33 | 33 | */ |
34 | - public function __construct( RequestStack $requestStack, Container $container ) |
|
34 | + public function __construct(RequestStack $requestStack, Container $container) |
|
35 | 35 | { |
36 | 36 | $this->requestStack = $requestStack; |
37 | 37 | $this->container = $container; |
@@ -46,53 +46,53 @@ discard block |
||
46 | 46 | * @param string|null $locale Code of the current language or null for no translation |
47 | 47 | * @return \Aimeos\MW\View\Iface View object |
48 | 48 | */ |
49 | - public function create( \Aimeos\MW\Config\Iface $config, array $templatePaths, $locale = null ) |
|
49 | + public function create(\Aimeos\MW\Config\Iface $config, array $templatePaths, $locale = null) |
|
50 | 50 | { |
51 | 51 | $params = $fixed = array(); |
52 | 52 | $request = $this->requestStack->getMasterRequest(); |
53 | 53 | |
54 | - if( $locale !== null ) |
|
54 | + if ($locale !== null) |
|
55 | 55 | { |
56 | - $params = $request->request->all() + $request->query->all() + $request->attributes->get( '_route_params' ); |
|
56 | + $params = $request->request->all() + $request->query->all() + $request->attributes->get('_route_params'); |
|
57 | 57 | $fixed = $this->getFixedParams(); |
58 | 58 | |
59 | - $i18n = $this->container->get('aimeos_i18n')->get( array( $locale ) ); |
|
59 | + $i18n = $this->container->get('aimeos_i18n')->get(array($locale)); |
|
60 | 60 | $translation = $i18n[$locale]; |
61 | 61 | } |
62 | 62 | else |
63 | 63 | { |
64 | - $translation = new \Aimeos\MW\Translation\None( 'en' ); |
|
64 | + $translation = new \Aimeos\MW\Translation\None('en'); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | |
68 | - $view = new \Aimeos\MW\View\Standard( $templatePaths ); |
|
68 | + $view = new \Aimeos\MW\View\Standard($templatePaths); |
|
69 | 69 | |
70 | - $helper = new \Aimeos\MW\View\Helper\Translate\Standard( $view, $translation ); |
|
71 | - $view->addHelper( 'translate', $helper ); |
|
70 | + $helper = new \Aimeos\MW\View\Helper\Translate\Standard($view, $translation); |
|
71 | + $view->addHelper('translate', $helper); |
|
72 | 72 | |
73 | - $helper = new \Aimeos\MW\View\Helper\Url\Symfony2( $view, $this->container->get( 'router' ), $fixed ); |
|
74 | - $view->addHelper( 'url', $helper ); |
|
73 | + $helper = new \Aimeos\MW\View\Helper\Url\Symfony2($view, $this->container->get('router'), $fixed); |
|
74 | + $view->addHelper('url', $helper); |
|
75 | 75 | |
76 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $params ); |
|
77 | - $view->addHelper( 'param', $helper ); |
|
76 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $params); |
|
77 | + $view->addHelper('param', $helper); |
|
78 | 78 | |
79 | - $helper = new \Aimeos\MW\View\Helper\Config\Standard( $view, $config ); |
|
80 | - $view->addHelper( 'config', $helper ); |
|
79 | + $helper = new \Aimeos\MW\View\Helper\Config\Standard($view, $config); |
|
80 | + $view->addHelper('config', $helper); |
|
81 | 81 | |
82 | - $sepDec = $config->get( 'client/html/common/format/seperatorDecimal', '.' ); |
|
83 | - $sep1000 = $config->get( 'client/html/common/format/seperator1000', ' ' ); |
|
84 | - $helper = new \Aimeos\MW\View\Helper\Number\Standard( $view, $sepDec, $sep1000 ); |
|
85 | - $view->addHelper( 'number', $helper ); |
|
82 | + $sepDec = $config->get('client/html/common/format/seperatorDecimal', '.'); |
|
83 | + $sep1000 = $config->get('client/html/common/format/seperator1000', ' '); |
|
84 | + $helper = new \Aimeos\MW\View\Helper\Number\Standard($view, $sepDec, $sep1000); |
|
85 | + $view->addHelper('number', $helper); |
|
86 | 86 | |
87 | - if( $request !== null ) |
|
87 | + if ($request !== null) |
|
88 | 88 | { |
89 | - $helper = new \Aimeos\MW\View\Helper\Request\Symfony2( $view, $request ); |
|
90 | - $view->addHelper( 'request', $helper ); |
|
89 | + $helper = new \Aimeos\MW\View\Helper\Request\Symfony2($view, $request); |
|
90 | + $view->addHelper('request', $helper); |
|
91 | 91 | } |
92 | 92 | |
93 | - $token = $this->container->get( 'security.csrf.token_manager' )->getToken( '_token' ); |
|
94 | - $helper = new \Aimeos\MW\View\Helper\Csrf\Standard( $view, '_token', $token->getValue() ); |
|
95 | - $view->addHelper( 'csrf', $helper ); |
|
93 | + $token = $this->container->get('security.csrf.token_manager')->getToken('_token'); |
|
94 | + $helper = new \Aimeos\MW\View\Helper\Csrf\Standard($view, '_token', $token->getValue()); |
|
95 | + $view->addHelper('csrf', $helper); |
|
96 | 96 | |
97 | 97 | return $view; |
98 | 98 | } |
@@ -108,15 +108,15 @@ discard block |
||
108 | 108 | $urlparams = array(); |
109 | 109 | $attr = $this->requestStack->getMasterRequest()->attributes; |
110 | 110 | |
111 | - if( ( $site = $attr->get( 'site' ) ) !== null ) { |
|
111 | + if (($site = $attr->get('site')) !== null) { |
|
112 | 112 | $urlparams['site'] = $site; |
113 | 113 | } |
114 | 114 | |
115 | - if( ( $lang = $attr->get( 'locale' ) ) !== null ) { |
|
115 | + if (($lang = $attr->get('locale')) !== null) { |
|
116 | 116 | $urlparams['locale'] = $lang; |
117 | 117 | } |
118 | 118 | |
119 | - if( ( $currency = $attr->get( 'currency' ) ) !== null ) { |
|
119 | + if (($currency = $attr->get('currency')) !== null) { |
|
120 | 120 | $urlparams['currency'] = $currency; |
121 | 121 | } |
122 | 122 |
@@ -28,8 +28,8 @@ discard block |
||
28 | 28 | */ |
29 | 29 | public function confirmAction() |
30 | 30 | { |
31 | - $params = $this->get( 'aimeos_page' )->getSections( 'checkout-confirm' ); |
|
32 | - return $this->render( 'AimeosShopBundle:Checkout:confirm.html.twig', $params ); |
|
31 | + $params = $this->get('aimeos_page')->getSections('checkout-confirm'); |
|
32 | + return $this->render('AimeosShopBundle:Checkout:confirm.html.twig', $params); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | |
@@ -40,8 +40,8 @@ discard block |
||
40 | 40 | */ |
41 | 41 | public function indexAction() |
42 | 42 | { |
43 | - $params = $this->get( 'aimeos_page' )->getSections( 'checkout-index' ); |
|
44 | - return $this->render( 'AimeosShopBundle:Checkout:index.html.twig', $params ); |
|
43 | + $params = $this->get('aimeos_page')->getSections('checkout-index'); |
|
44 | + return $this->render('AimeosShopBundle:Checkout:index.html.twig', $params); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | */ |
53 | 53 | public function updateAction() |
54 | 54 | { |
55 | - $params = $this->get( 'aimeos_page' )->getSections( 'checkout-update' ); |
|
56 | - return $this->render( 'AimeosShopBundle:Checkout:update.html.twig', $params ); |
|
55 | + $params = $this->get('aimeos_page')->getSections('checkout-update'); |
|
56 | + return $this->render('AimeosShopBundle:Checkout:update.html.twig', $params); |
|
57 | 57 | } |
58 | 58 | } |
@@ -28,7 +28,7 @@ |
||
28 | 28 | */ |
29 | 29 | public function indexAction() |
30 | 30 | { |
31 | - $params = $this->get( 'aimeos_page' )->getSections( 'basket-index' ); |
|
32 | - return $this->render( 'AimeosShopBundle:Basket:index.html.twig', $params ); |
|
31 | + $params = $this->get('aimeos_page')->getSections('basket-index'); |
|
32 | + return $this->render('AimeosShopBundle:Basket:index.html.twig', $params); |
|
33 | 33 | } |
34 | 34 | } |
@@ -28,8 +28,8 @@ discard block |
||
28 | 28 | */ |
29 | 29 | public function countAction() |
30 | 30 | { |
31 | - $params = $this->get( 'aimeos_page' )->getSections( 'catalog-count' ); |
|
32 | - return $this->render( 'AimeosShopBundle:Catalog:count.html.twig', $params ); |
|
31 | + $params = $this->get('aimeos_page')->getSections('catalog-count'); |
|
32 | + return $this->render('AimeosShopBundle:Catalog:count.html.twig', $params); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | |
@@ -40,8 +40,8 @@ discard block |
||
40 | 40 | */ |
41 | 41 | public function detailAction() |
42 | 42 | { |
43 | - $params = $this->get( 'aimeos_page' )->getSections( 'catalog-detail' ); |
|
44 | - return $this->render( 'AimeosShopBundle:Catalog:detail.html.twig', $params ); |
|
43 | + $params = $this->get('aimeos_page')->getSections('catalog-detail'); |
|
44 | + return $this->render('AimeosShopBundle:Catalog:detail.html.twig', $params); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | |
@@ -52,8 +52,8 @@ discard block |
||
52 | 52 | */ |
53 | 53 | public function listAction() |
54 | 54 | { |
55 | - $params = $this->get( 'aimeos_page' )->getSections( 'catalog-list' ); |
|
56 | - return $this->render( 'AimeosShopBundle:Catalog:list.html.twig', $params ); |
|
55 | + $params = $this->get('aimeos_page')->getSections('catalog-list'); |
|
56 | + return $this->render('AimeosShopBundle:Catalog:list.html.twig', $params); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | |
@@ -64,8 +64,8 @@ discard block |
||
64 | 64 | */ |
65 | 65 | public function stockAction() |
66 | 66 | { |
67 | - $params = $this->get( 'aimeos_page' )->getSections( 'catalog-stock' ); |
|
68 | - return $this->render( 'AimeosShopBundle:Catalog:stock.html.twig', $params ); |
|
67 | + $params = $this->get('aimeos_page')->getSections('catalog-stock'); |
|
68 | + return $this->render('AimeosShopBundle:Catalog:stock.html.twig', $params); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | */ |
77 | 77 | public function suggestAction() |
78 | 78 | { |
79 | - $params = $this->get( 'aimeos_page' )->getSections( 'catalog-suggest' ); |
|
80 | - return $this->render( 'AimeosShopBundle:Catalog:suggest.html.twig', $params ); |
|
79 | + $params = $this->get('aimeos_page')->getSections('catalog-suggest'); |
|
80 | + return $this->render('AimeosShopBundle:Catalog:suggest.html.twig', $params); |
|
81 | 81 | } |
82 | 82 | } |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | */ |
29 | 29 | public function privacyAction() |
30 | 30 | { |
31 | - return $this->render( 'AimeosShopBundle:Page:privacy.html.twig' ); |
|
31 | + return $this->render('AimeosShopBundle:Page:privacy.html.twig'); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | |
@@ -39,6 +39,6 @@ discard block |
||
39 | 39 | */ |
40 | 40 | public function termsAction() |
41 | 41 | { |
42 | - return $this->render( 'AimeosShopBundle:Page:terms.html.twig' ); |
|
42 | + return $this->render('AimeosShopBundle:Page:terms.html.twig'); |
|
43 | 43 | } |
44 | 44 | } |
@@ -27,21 +27,21 @@ discard block |
||
27 | 27 | /** |
28 | 28 | * {@inheritDoc} |
29 | 29 | */ |
30 | - public function load( array $configs, ContainerBuilder $container ) |
|
30 | + public function load(array $configs, ContainerBuilder $container) |
|
31 | 31 | { |
32 | 32 | $configuration = new Configuration(); |
33 | - $config = $this->processConfiguration( $configuration, $configs ); |
|
33 | + $config = $this->processConfiguration($configuration, $configs); |
|
34 | 34 | |
35 | - foreach( $configs as $list ) { |
|
36 | - $this->merge( $config, $list ); |
|
35 | + foreach ($configs as $list) { |
|
36 | + $this->merge($config, $list); |
|
37 | 37 | } |
38 | 38 | |
39 | - foreach( $config as $key => $value ) { |
|
40 | - $container->setParameter( 'aimeos_shop.' . $key, $value ); |
|
39 | + foreach ($config as $key => $value) { |
|
40 | + $container->setParameter('aimeos_shop.' . $key, $value); |
|
41 | 41 | } |
42 | 42 | |
43 | - $loader = new Loader\YamlFileLoader( $container, new FileLocator( dirname( __DIR__ ) . '/Resources/config' ) ); |
|
44 | - $loader->load( 'services.yml' ); |
|
43 | + $loader = new Loader\YamlFileLoader($container, new FileLocator(dirname(__DIR__) . '/Resources/config')); |
|
44 | + $loader->load('services.yml'); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | |
@@ -50,13 +50,13 @@ discard block |
||
50 | 50 | * |
51 | 51 | * @param ContainerBuilder $container ContainerBuilder object |
52 | 52 | */ |
53 | - public function prepend( ContainerBuilder $container ) |
|
53 | + public function prepend(ContainerBuilder $container) |
|
54 | 54 | { |
55 | - $configFile = dirname( __DIR__ ) . '/Resources/config/aimeos_shop.yml'; |
|
56 | - $config = Yaml::parse( file_get_contents( $configFile ) ); |
|
55 | + $configFile = dirname(__DIR__) . '/Resources/config/aimeos_shop.yml'; |
|
56 | + $config = Yaml::parse(file_get_contents($configFile)); |
|
57 | 57 | |
58 | - $container->prependExtensionConfig( 'aimeos_shop', $config ); |
|
59 | - $container->addResource( new FileResource( $configFile ) ); |
|
58 | + $container->prependExtensionConfig('aimeos_shop', $config); |
|
59 | + $container->addResource(new FileResource($configFile)); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | |
@@ -66,15 +66,15 @@ discard block |
||
66 | 66 | * @param array &$original Associative list of original values |
67 | 67 | * @param array $overrule Associative list of new values |
68 | 68 | */ |
69 | - protected function merge( array &$original, array $overrule ) |
|
69 | + protected function merge(array &$original, array $overrule) |
|
70 | 70 | { |
71 | - foreach( array_keys( $overrule ) as $key ) |
|
71 | + foreach (array_keys($overrule) as $key) |
|
72 | 72 | { |
73 | - if( isset( $original[$key] ) && is_array( $original[$key] ) ) { |
|
74 | - if( is_array( $overrule[$key] ) ) { |
|
75 | - $this->merge( $original[$key], $overrule[$key] ); |
|
73 | + if (isset($original[$key]) && is_array($original[$key])) { |
|
74 | + if (is_array($overrule[$key])) { |
|
75 | + $this->merge($original[$key], $overrule[$key]); |
|
76 | 76 | } |
77 | - } elseif( isset( $overrule[$key] ) ) { |
|
77 | + } elseif (isset($overrule[$key])) { |
|
78 | 78 | $original[$key] = $overrule[$key]; |
79 | 79 | } |
80 | 80 | } |
@@ -25,15 +25,15 @@ |
||
25 | 25 | * @param InputInterface $input Input object |
26 | 26 | * @return \Aimeos\MShop\Locale\Item\Site\Interface[] List of site items |
27 | 27 | */ |
28 | - protected function getSiteItems( \Aimeos\MShop\Context\Item\Iface $context, InputInterface $input ) |
|
28 | + protected function getSiteItems(\Aimeos\MShop\Context\Item\Iface $context, InputInterface $input) |
|
29 | 29 | { |
30 | - $manager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context )->getSubManager( 'site' ); |
|
30 | + $manager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context)->getSubManager('site'); |
|
31 | 31 | $search = $manager->createSearch(); |
32 | 32 | |
33 | - if( ( $codes = (string) $input->getArgument( 'site' ) ) !== '' ) { |
|
34 | - $search->setConditions( $search->compare( '==', 'locale.site.code', explode( ' ', $codes ) ) ); |
|
33 | + if (($codes = (string) $input->getArgument('site')) !== '') { |
|
34 | + $search->setConditions($search->compare('==', 'locale.site.code', explode(' ', $codes))); |
|
35 | 35 | } |
36 | 36 | |
37 | - return $manager->searchItems( $search ); |
|
37 | + return $manager->searchItems($search); |
|
38 | 38 | } |
39 | 39 | } |