@@ -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 | } |
@@ -45,5 +45,5 @@ |
||
45 | 45 | ; |
46 | 46 | |
47 | 47 | return $treeBuilder; |
48 | - } |
|
48 | + } |
|
49 | 49 | } |
@@ -29,23 +29,23 @@ |
||
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() |
|
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 | 49 | ->end() |
50 | 50 | ; |
51 | 51 |
@@ -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 | } |
@@ -23,9 +23,9 @@ discard block |
||
23 | 23 | */ |
24 | 24 | protected function configure() |
25 | 25 | { |
26 | - $this->setName( 'aimeos:cache' ); |
|
27 | - $this->setDescription( 'Clears the content cache' ); |
|
28 | - $this->addArgument( 'site', InputArgument::OPTIONAL, 'Site codes to clear the cache like "default unittest" (none for all)' ); |
|
26 | + $this->setName('aimeos:cache'); |
|
27 | + $this->setDescription('Clears the content cache'); |
|
28 | + $this->addArgument('site', InputArgument::OPTIONAL, 'Site codes to clear the cache like "default unittest" (none for all)'); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | |
@@ -35,26 +35,26 @@ discard block |
||
35 | 35 | * @param InputInterface $input Input object |
36 | 36 | * @param OutputInterface $output Output object |
37 | 37 | */ |
38 | - protected function execute( InputInterface $input, OutputInterface $output ) |
|
38 | + protected function execute(InputInterface $input, OutputInterface $output) |
|
39 | 39 | { |
40 | - $context = $this->getContainer()->get( 'aimeos_context' )->get( false ); |
|
41 | - $context->setEditor( 'aimeos:cache' ); |
|
40 | + $context = $this->getContainer()->get('aimeos_context')->get(false); |
|
41 | + $context->setEditor('aimeos:cache'); |
|
42 | 42 | |
43 | - $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context ); |
|
43 | + $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context); |
|
44 | 44 | |
45 | - foreach( $this->getSiteItems( $context, $input ) as $siteItem ) |
|
45 | + foreach ($this->getSiteItems($context, $input) as $siteItem) |
|
46 | 46 | { |
47 | - $localeItem = $localeManager->bootstrap( $siteItem->getCode(), '', '', false ); |
|
47 | + $localeItem = $localeManager->bootstrap($siteItem->getCode(), '', '', false); |
|
48 | 48 | |
49 | 49 | $lcontext = clone $context; |
50 | - $lcontext->setLocale( $localeItem ); |
|
50 | + $lcontext->setLocale($localeItem); |
|
51 | 51 | |
52 | - $cache = new \Aimeos\MAdmin\Cache\Proxy\Standard( $lcontext ); |
|
53 | - $lcontext->setCache( $cache ); |
|
52 | + $cache = new \Aimeos\MAdmin\Cache\Proxy\Standard($lcontext); |
|
53 | + $lcontext->setCache($cache); |
|
54 | 54 | |
55 | - $output->writeln( sprintf( 'Clearing the Aimeos cache for site <info>%1$s</info>', $siteItem->getCode() ) ); |
|
55 | + $output->writeln(sprintf('Clearing the Aimeos cache for site <info>%1$s</info>', $siteItem->getCode())); |
|
56 | 56 | |
57 | - \Aimeos\MAdmin\Cache\Manager\Factory::createManager( $lcontext )->getCache()->flush(); |
|
57 | + \Aimeos\MAdmin\Cache\Manager\Factory::createManager($lcontext)->getCache()->flush(); |
|
58 | 58 | } |
59 | 59 | } |
60 | 60 | } |
@@ -24,19 +24,19 @@ discard block |
||
24 | 24 | protected function configure() |
25 | 25 | { |
26 | 26 | $names = ''; |
27 | - $aimeos = new \Aimeos\Bootstrap( array() ); |
|
28 | - $cntlPaths = $aimeos->getCustomPaths( 'controller/jobs' ); |
|
29 | - $controllers = \Aimeos\Controller\Jobs\Factory::getControllers( $this->getBareContext(), $aimeos, $cntlPaths ); |
|
27 | + $aimeos = new \Aimeos\Bootstrap(array()); |
|
28 | + $cntlPaths = $aimeos->getCustomPaths('controller/jobs'); |
|
29 | + $controllers = \Aimeos\Controller\Jobs\Factory::getControllers($this->getBareContext(), $aimeos, $cntlPaths); |
|
30 | 30 | |
31 | - foreach( $controllers as $key => $controller ) { |
|
32 | - $names .= str_pad( $key, 30 ) . $controller->getName() . PHP_EOL; |
|
31 | + foreach ($controllers as $key => $controller) { |
|
32 | + $names .= str_pad($key, 30) . $controller->getName() . PHP_EOL; |
|
33 | 33 | } |
34 | 34 | |
35 | - $this->setName( 'aimeos:jobs' ); |
|
36 | - $this->setDescription( 'Executes the job controllers' ); |
|
37 | - $this->addArgument( 'jobs', InputArgument::REQUIRED, 'One or more job controller names like "admin/job customer/email/watch"' ); |
|
38 | - $this->addArgument( 'site', InputArgument::OPTIONAL, 'Site codes to execute the jobs for like "default unittest" (none for all)' ); |
|
39 | - $this->setHelp( "Available jobs are:\n" . $names ); |
|
35 | + $this->setName('aimeos:jobs'); |
|
36 | + $this->setDescription('Executes the job controllers'); |
|
37 | + $this->addArgument('jobs', InputArgument::REQUIRED, 'One or more job controller names like "admin/job customer/email/watch"'); |
|
38 | + $this->addArgument('site', InputArgument::OPTIONAL, 'Site codes to execute the jobs for like "default unittest" (none for all)'); |
|
39 | + $this->setHelp("Available jobs are:\n" . $names); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | |
@@ -46,23 +46,23 @@ discard block |
||
46 | 46 | * @param InputInterface $input Input object |
47 | 47 | * @param OutputInterface $output Output object |
48 | 48 | */ |
49 | - protected function execute( InputInterface $input, OutputInterface $output ) |
|
49 | + protected function execute(InputInterface $input, OutputInterface $output) |
|
50 | 50 | { |
51 | 51 | $context = $this->getContext(); |
52 | - $aimeos = $this->getContainer()->get( 'aimeos' )->get(); |
|
52 | + $aimeos = $this->getContainer()->get('aimeos')->get(); |
|
53 | 53 | |
54 | - $jobs = explode( ' ', $input->getArgument( 'jobs' ) ); |
|
55 | - $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context ); |
|
54 | + $jobs = explode(' ', $input->getArgument('jobs')); |
|
55 | + $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context); |
|
56 | 56 | |
57 | - foreach( $this->getSiteItems( $context, $input ) as $siteItem ) |
|
57 | + foreach ($this->getSiteItems($context, $input) as $siteItem) |
|
58 | 58 | { |
59 | - $localeItem = $localeManager->bootstrap( $siteItem->getCode(), 'en', '', false ); |
|
60 | - $context->setLocale( $localeItem ); |
|
59 | + $localeItem = $localeManager->bootstrap($siteItem->getCode(), 'en', '', false); |
|
60 | + $context->setLocale($localeItem); |
|
61 | 61 | |
62 | - $output->writeln( sprintf( 'Executing the Aimeos jobs for "<info>%s</info>"', $siteItem->getCode() ) ); |
|
62 | + $output->writeln(sprintf('Executing the Aimeos jobs for "<info>%s</info>"', $siteItem->getCode())); |
|
63 | 63 | |
64 | - foreach( $jobs as $jobname ) { |
|
65 | - \Aimeos\Controller\Jobs\Factory::createController( $context, $aimeos, $jobname )->run(); |
|
64 | + foreach ($jobs as $jobname) { |
|
65 | + \Aimeos\Controller\Jobs\Factory::createController($context, $aimeos, $jobname)->run(); |
|
66 | 66 | } |
67 | 67 | } |
68 | 68 | } |
@@ -77,15 +77,15 @@ discard block |
||
77 | 77 | { |
78 | 78 | $ctx = new \Aimeos\MShop\Context\Item\Standard(); |
79 | 79 | |
80 | - $conf = new \Aimeos\MW\Config\PHPArray( array(), array() ); |
|
81 | - $ctx->setConfig( $conf ); |
|
80 | + $conf = new \Aimeos\MW\Config\PHPArray(array(), array()); |
|
81 | + $ctx->setConfig($conf); |
|
82 | 82 | |
83 | - $locale = \Aimeos\MShop\Factory::createManager( $ctx, 'locale' )->createItem(); |
|
84 | - $locale->setLanguageId( 'en' ); |
|
85 | - $ctx->setLocale( $locale ); |
|
83 | + $locale = \Aimeos\MShop\Factory::createManager($ctx, 'locale')->createItem(); |
|
84 | + $locale->setLanguageId('en'); |
|
85 | + $ctx->setLocale($locale); |
|
86 | 86 | |
87 | - $i18n = new \Aimeos\MW\Translation\Zend2( array(), 'gettext', 'en', array( 'disableNotices' => true ) ); |
|
88 | - $ctx->setI18n( array( 'en' => $i18n ) ); |
|
87 | + $i18n = new \Aimeos\MW\Translation\Zend2(array(), 'gettext', 'en', array('disableNotices' => true)); |
|
88 | + $ctx->setI18n(array('en' => $i18n)); |
|
89 | 89 | |
90 | 90 | return $ctx; |
91 | 91 | } |
@@ -99,18 +99,18 @@ discard block |
||
99 | 99 | protected function getContext() |
100 | 100 | { |
101 | 101 | $container = $this->getContainer(); |
102 | - $context = $container->get( 'aimeos_context' )->get( false ); |
|
102 | + $context = $container->get('aimeos_context')->get(false); |
|
103 | 103 | |
104 | - $tmplPaths = $container->get('aimeos')->get()->getCustomPaths( 'controller/jobs/layouts' ); |
|
105 | - $view = $container->get('aimeos_view')->create( $context->getConfig(), $tmplPaths ); |
|
104 | + $tmplPaths = $container->get('aimeos')->get()->getCustomPaths('controller/jobs/layouts'); |
|
105 | + $view = $container->get('aimeos_view')->create($context->getConfig(), $tmplPaths); |
|
106 | 106 | |
107 | - $langManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context )->getSubManager( 'language' ); |
|
108 | - $langids = array_keys( $langManager->searchItems( $langManager->createSearch( true ) ) ); |
|
109 | - $i18n = $this->getContainer()->get( 'aimeos_i18n' )->get( $langids ); |
|
107 | + $langManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context)->getSubManager('language'); |
|
108 | + $langids = array_keys($langManager->searchItems($langManager->createSearch(true))); |
|
109 | + $i18n = $this->getContainer()->get('aimeos_i18n')->get($langids); |
|
110 | 110 | |
111 | - $context->setEditor( 'aimeos:jobs' ); |
|
112 | - $context->setView( $view ); |
|
113 | - $context->setI18n( $i18n ); |
|
111 | + $context->setEditor('aimeos:jobs'); |
|
112 | + $context->setView($view); |
|
113 | + $context->setI18n($i18n); |
|
114 | 114 | |
115 | 115 | return $context; |
116 | 116 | } |
@@ -14,13 +14,13 @@ |
||
14 | 14 | $kernel = $this->createKernel(); |
15 | 15 | $kernel->boot(); |
16 | 16 | |
17 | - $application = new Application( $kernel ); |
|
18 | - $application->add( new Command\JobsCommand() ); |
|
17 | + $application = new Application($kernel); |
|
18 | + $application->add(new Command\JobsCommand()); |
|
19 | 19 | |
20 | - $command = $application->find( 'aimeos:jobs' ); |
|
21 | - $commandTester = new CommandTester( $command ); |
|
22 | - $commandTester->execute( array( 'command' => $command->getName(), 'site' => 'unittest', 'jobs' => 'index/rebuild' ) ); |
|
20 | + $command = $application->find('aimeos:jobs'); |
|
21 | + $commandTester = new CommandTester($command); |
|
22 | + $commandTester->execute(array('command' => $command->getName(), 'site' => 'unittest', 'jobs' => 'index/rebuild')); |
|
23 | 23 | |
24 | - $this->assertEquals( 0, $commandTester->getStatusCode() ); |
|
24 | + $this->assertEquals(0, $commandTester->getStatusCode()); |
|
25 | 25 | } |
26 | 26 | } |
@@ -14,13 +14,13 @@ |
||
14 | 14 | $kernel = $this->createKernel(); |
15 | 15 | $kernel->boot(); |
16 | 16 | |
17 | - $application = new Application( $kernel ); |
|
18 | - $application->add( new Command\CacheCommand() ); |
|
17 | + $application = new Application($kernel); |
|
18 | + $application->add(new Command\CacheCommand()); |
|
19 | 19 | |
20 | - $command = $application->find( 'aimeos:cache' ); |
|
21 | - $commandTester = new CommandTester( $command ); |
|
22 | - $commandTester->execute( array( 'command' => $command->getName(), 'site' => 'unittest' ) ); |
|
20 | + $command = $application->find('aimeos:cache'); |
|
21 | + $commandTester = new CommandTester($command); |
|
22 | + $commandTester->execute(array('command' => $command->getName(), 'site' => 'unittest')); |
|
23 | 23 | |
24 | - $this->assertEquals( 0, $commandTester->getStatusCode() ); |
|
24 | + $this->assertEquals(0, $commandTester->getStatusCode()); |
|
25 | 25 | } |
26 | 26 | } |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | */ |
210 | 210 | public function getRoles() |
211 | 211 | { |
212 | - return array( 'ROLE_USER' ); |
|
212 | + return array('ROLE_USER'); |
|
213 | 213 | } |
214 | 214 | |
215 | 215 | |
@@ -226,23 +226,23 @@ discard block |
||
226 | 226 | */ |
227 | 227 | public function serialize() |
228 | 228 | { |
229 | - return serialize( array( |
|
229 | + return serialize(array( |
|
230 | 230 | $this->id, |
231 | 231 | $this->username, |
232 | 232 | $this->password, |
233 | - ) ); |
|
233 | + )); |
|
234 | 234 | } |
235 | 235 | |
236 | 236 | |
237 | 237 | /** |
238 | 238 | * @see \Serializable::unserialize() |
239 | 239 | */ |
240 | - public function unserialize( $serialized ) |
|
240 | + public function unserialize($serialized) |
|
241 | 241 | { |
242 | 242 | list ( |
243 | 243 | $this->id, |
244 | 244 | $this->username, |
245 | 245 | $this->password, |
246 | - ) = unserialize( $serialized ); |
|
246 | + ) = unserialize($serialized); |
|
247 | 247 | } |
248 | 248 | } |