Completed
Push — master ( 0d3193...23d509 )
by Aimeos
18:01
created
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/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.
jobs.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -6,28 +6,28 @@  discard block
 block discarded – undo
6 6
  */
7 7
 
8 8
 
9
-if( php_sapi_name() != 'cli' ) {
10
-	exit( 'Setup can only be started via command line for security reasons' );
9
+if (php_sapi_name() != 'cli') {
10
+	exit('Setup can only be started via command line for security reasons');
11 11
 }
12 12
 
13
-ini_set( 'display_errors', 1 );
14
-date_default_timezone_set( 'UTC' );
13
+ini_set('display_errors', 1);
14
+date_default_timezone_set('UTC');
15 15
 
16 16
 
17 17
 
18 18
 try
19 19
 {
20
-	require 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
20
+	require 'vendor'.DIRECTORY_SEPARATOR.'autoload.php';
21 21
 
22
-	\Aimeos\Slim\Command\Jobs::run( $_SERVER['argv'] );
22
+	\Aimeos\Slim\Command\Jobs::run($_SERVER['argv']);
23 23
 }
24
-catch( \Aimeos\Slim\Command\Exception $e )
24
+catch (\Aimeos\Slim\Command\Exception $e)
25 25
 {
26
-	echo $e->getMessage() . "\n";
26
+	echo $e->getMessage()."\n";
27 27
 	echo \Aimeos\Slim\Command\Jobs::usage();
28
-	exit( 1 );
28
+	exit(1);
29 29
 }
30
-catch( \Throwable $t )
30
+catch (\Throwable $t)
31 31
 {
32 32
 	echo "\n\nCaught PHP error while processing setup";
33 33
 	echo "\n\nMessage:\n";
@@ -35,9 +35,9 @@  discard block
 block discarded – undo
35 35
 	echo "\n\nStack trace:\n";
36 36
 	echo $t->getTraceAsString();
37 37
 	echo "\n\n";
38
-	exit( 1 );
38
+	exit(1);
39 39
 }
40
-catch( \Exception $e )
40
+catch (\Exception $e)
41 41
 {
42 42
 	echo "\n\nCaught exception while processing setup";
43 43
 	echo "\n\nMessage:\n";
@@ -45,5 +45,5 @@  discard block
 block discarded – undo
45 45
 	echo "\n\nStack trace:\n";
46 46
 	echo $e->getTraceAsString();
47 47
 	echo "\n\n";
48
-	exit( 1 );
48
+	exit(1);
49 49
 }
Please login to merge, or discard this patch.
cache.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -6,27 +6,27 @@  discard block
 block discarded – undo
6 6
  */
7 7
 
8 8
 
9
-if( php_sapi_name() != 'cli' ) {
10
-	exit( 'Setup can only be started via command line for security reasons' );
9
+if (php_sapi_name() != 'cli') {
10
+	exit('Setup can only be started via command line for security reasons');
11 11
 }
12 12
 
13
-ini_set( 'display_errors', 1 );
14
-date_default_timezone_set( 'UTC' );
13
+ini_set('display_errors', 1);
14
+date_default_timezone_set('UTC');
15 15
 
16 16
 
17 17
 try
18 18
 {
19
-	require 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
19
+	require 'vendor'.DIRECTORY_SEPARATOR.'autoload.php';
20 20
 
21
-	\Aimeos\Slim\Command\Cache::run( $_SERVER['argv'] );
21
+	\Aimeos\Slim\Command\Cache::run($_SERVER['argv']);
22 22
 }
23
-catch( \Aimeos\Slim\Command\Exception $e )
23
+catch (\Aimeos\Slim\Command\Exception $e)
24 24
 {
25
-	echo $e->getMessage() . "\n";
25
+	echo $e->getMessage()."\n";
26 26
 	echo \Aimeos\Slim\Command\Cache::usage();
27
-	exit( 1 );
27
+	exit(1);
28 28
 }
29
-catch( \Throwable $t )
29
+catch (\Throwable $t)
30 30
 {
31 31
 	echo "\n\nCaught PHP error";
32 32
 	echo "\n\nMessage:\n";
@@ -34,9 +34,9 @@  discard block
 block discarded – undo
34 34
 	echo "\n\nStack trace:\n";
35 35
 	echo $t->getTraceAsString();
36 36
 	echo "\n\n";
37
-	exit( 1 );
37
+	exit(1);
38 38
 }
39
-catch( \Exception $e )
39
+catch (\Exception $e)
40 40
 {
41 41
 	echo "\n\nCaught exception";
42 42
 	echo "\n\nMessage:\n";
@@ -44,5 +44,5 @@  discard block
 block discarded – undo
44 44
 	echo "\n\nStack trace:\n";
45 45
 	echo $e->getTraceAsString();
46 46
 	echo "\n\n";
47
-	exit( 1 );
47
+	exit(1);
48 48
 }
Please login to merge, or discard this patch.
src/Base/Locale.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	 *
30 30
 	 * @param ContainerInterface $container Dependency container
31 31
 	 */
32
-	public function __construct( ContainerInterface $container )
32
+	public function __construct(ContainerInterface $container)
33 33
 	{
34 34
 		$this->container = $container;
35 35
 	}
@@ -42,18 +42,18 @@  discard block
 block discarded – undo
42 42
 	 * @param array $attributes Associative list of URL parameter
43 43
 	 * @return \Aimeos\MShop\Locale\Item\Iface Locale item object
44 44
 	 */
45
-	public function get( \Aimeos\MShop\Context\Item\Iface $context, array $attributes )
45
+	public function get(\Aimeos\MShop\Context\Item\Iface $context, array $attributes)
46 46
 	{
47
-		if( $this->locale === null )
47
+		if ($this->locale === null)
48 48
 		{
49
-			$disableSites = $this->container->get( 'aimeos_config' )->get( 'disableSites', true );
49
+			$disableSites = $this->container->get('aimeos_config')->get('disableSites', true);
50 50
 
51
-			$site = ( isset( $attributes['site'] ) ? $attributes['site'] : 'default' );
52
-			$lang = ( isset( $attributes['locale'] ) ? $attributes['locale'] : '' );
53
-			$currency = ( isset( $attributes['currency'] ) ? $attributes['currency'] : '' );
51
+			$site = (isset($attributes['site']) ? $attributes['site'] : 'default');
52
+			$lang = (isset($attributes['locale']) ? $attributes['locale'] : '');
53
+			$currency = (isset($attributes['currency']) ? $attributes['currency'] : '');
54 54
 
55
-			$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context );
56
-			$this->locale = $localeManager->bootstrap( $site, $lang, $currency, $disableSites );
55
+			$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context);
56
+			$this->locale = $localeManager->bootstrap($site, $lang, $currency, $disableSites);
57 57
 		}
58 58
 
59 59
 		return $this->locale;
@@ -67,17 +67,17 @@  discard block
 block discarded – undo
67 67
 	 * @param string $site Unique site code
68 68
 	 * @return \Aimeos\MShop\Locale\Item\Iface Locale item object
69 69
 	 */
70
-	public function getBackend( \Aimeos\MShop\Context\Item\Iface $context, $site )
70
+	public function getBackend(\Aimeos\MShop\Context\Item\Iface $context, $site)
71 71
 	{
72
-		$localeManager = \Aimeos\MShop\Factory::createManager( $context, 'locale' );
72
+		$localeManager = \Aimeos\MShop\Factory::createManager($context, 'locale');
73 73
 
74 74
 		try
75 75
 		{
76
-			$localeItem = $localeManager->bootstrap( $site, '', '', false );
77
-			$localeItem->setLanguageId( null );
78
-			$localeItem->setCurrencyId( null );
76
+			$localeItem = $localeManager->bootstrap($site, '', '', false);
77
+			$localeItem->setLanguageId(null);
78
+			$localeItem->setCurrencyId(null);
79 79
 		}
80
-		catch( \Aimeos\MShop\Locale\Exception $e )
80
+		catch (\Aimeos\MShop\Locale\Exception $e)
81 81
 		{
82 82
 			$localeItem = $localeManager->createItem();
83 83
 		}
Please login to merge, or discard this patch.
src/Command/Cache.php 1 patch
Spacing   +32 added lines, -32 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,38 +57,38 @@  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 );
77
+		$conf = new \Aimeos\MW\Config\PHPArray($config, $confPaths);
78
+		$conf = new \Aimeos\MW\Config\Decorator\Memory($conf);
79 79
 
80
-		if( ( $cfg = $conf->get( 'command' ) ) !== null ) {
81
-			$conf = new \Aimeos\MW\Config\Decorator\Memory( $conf, $cfg );
80
+		if (($cfg = $conf->get('command')) !== null) {
81
+			$conf = new \Aimeos\MW\Config\Decorator\Memory($conf, $cfg);
82 82
 		}
83 83
 
84
-		$ctx->setConfig( $conf );
84
+		$ctx->setConfig($conf);
85 85
 
86 86
 
87
-		$dbm = new \Aimeos\MW\DB\Manager\PDO( $conf );
88
-		$ctx->setDatabaseManager( $dbm );
87
+		$dbm = new \Aimeos\MW\DB\Manager\PDO($conf);
88
+		$ctx->setDatabaseManager($dbm);
89 89
 
90
-		$logger = new \Aimeos\MW\Logger\Errorlog( \Aimeos\MW\Logger\Base::INFO );
91
-		$ctx->setLogger( $logger );
90
+		$logger = new \Aimeos\MW\Logger\Errorlog(\Aimeos\MW\Logger\Base::INFO);
91
+		$ctx->setLogger($logger);
92 92
 
93 93
 		return $ctx;
94 94
 	}
@@ -100,23 +100,23 @@  discard block
 block discarded – undo
100 100
 	 * @param \Aimeos\MShop\Context\Item\Iface $ctx Context object
101 101
 	 * @param array $siteItems List of site items implementing \Aimeos\MShop\Locale\Site\Iface
102 102
 	 */
103
-	protected static function clear( \Aimeos\MShop\Context\Item\Iface $ctx, array $siteItems )
103
+	protected static function clear(\Aimeos\MShop\Context\Item\Iface $ctx, array $siteItems)
104 104
 	{
105
-		$localeManager = \Aimeos\MShop\Factory::createManager( $ctx, 'locale' );
105
+		$localeManager = \Aimeos\MShop\Factory::createManager($ctx, 'locale');
106 106
 
107
-		foreach( $siteItems as $siteItem )
107
+		foreach ($siteItems as $siteItem)
108 108
 		{
109
-			$localeItem = $localeManager->bootstrap( $siteItem->getCode(), '', '', false );
109
+			$localeItem = $localeManager->bootstrap($siteItem->getCode(), '', '', false);
110 110
 
111 111
 			$lcontext = clone $ctx;
112
-			$lcontext->setLocale( $localeItem );
112
+			$lcontext->setLocale($localeItem);
113 113
 
114
-			$cache = new \Aimeos\MAdmin\Cache\Proxy\Standard( $lcontext );
115
-			$lcontext->setCache( $cache );
114
+			$cache = new \Aimeos\MAdmin\Cache\Proxy\Standard($lcontext);
115
+			$lcontext->setCache($cache);
116 116
 
117
-			printf( "Clearing the Aimeos cache for site \"%1\$s\"\n", $siteItem->getCode() );
117
+			printf("Clearing the Aimeos cache for site \"%1\$s\"\n", $siteItem->getCode());
118 118
 
119
-			\Aimeos\MAdmin\Cache\Manager\Factory::createManager( $lcontext )->getCache()->clear();
119
+			\Aimeos\MAdmin\Cache\Manager\Factory::createManager($lcontext)->getCache()->clear();
120 120
 		}
121 121
 	}
122 122
 }
123 123
\ No newline at end of file
Please login to merge, or discard this patch.
src/Base/Config.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	 *
30 30
 	 * @param ContainerInterface $container Dependency container
31 31
 	 */
32
-	public function __construct( ContainerInterface $container, $settings )
32
+	public function __construct(ContainerInterface $container, $settings)
33 33
 	{
34 34
 		$this->container = $container;
35 35
 		$this->settings = $settings;
@@ -42,19 +42,19 @@  discard block
 block discarded – undo
42 42
 	 * @param string $type Configuration type ("frontend" or "backend")
43 43
 	 * @return \Aimeos\MW\Config\Iface Config object
44 44
 	 */
45
-	public function get( $type = 'frontend' )
45
+	public function get($type = 'frontend')
46 46
 	{
47
-		$paths = $this->container->get( 'aimeos' )->getConfigPaths();
48
-		$config = new \Aimeos\MW\Config\PHPArray( array(), $paths );
47
+		$paths = $this->container->get('aimeos')->getConfigPaths();
48
+		$config = new \Aimeos\MW\Config\PHPArray(array(), $paths);
49 49
 
50
-		if( function_exists( 'apcu_store' ) === true && $config->get( 'apc_enabled', false ) == true ) {
51
-			$config = new \Aimeos\MW\Config\Decorator\APC( $config, $config->get( 'apc_prefix', 'slim:' ) );
50
+		if (function_exists('apcu_store') === true && $config->get('apc_enabled', false) == true) {
51
+			$config = new \Aimeos\MW\Config\Decorator\APC($config, $config->get('apc_prefix', 'slim:'));
52 52
 		}
53 53
 
54
-		$config = new \Aimeos\MW\Config\Decorator\Memory( $config, $this->settings );
54
+		$config = new \Aimeos\MW\Config\Decorator\Memory($config, $this->settings);
55 55
 
56
-		if( isset( $this->settings[$type] ) ) {
57
-			$config = new \Aimeos\MW\Config\Decorator\Memory( $config, $this->settings[$type] );
56
+		if (isset($this->settings[$type])) {
57
+			$config = new \Aimeos\MW\Config\Decorator\Memory($config, $this->settings[$type]);
58 58
 		}
59 59
 
60 60
 		return $config;
Please login to merge, or discard this patch.
src/Base/I18n.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	 *
30 30
 	 * @param ContainerInterface $container Dependency container
31 31
 	 */
32
-	public function __construct( ContainerInterface $container )
32
+	public function __construct(ContainerInterface $container)
33 33
 	{
34 34
 		$this->container = $container;
35 35
 	}
@@ -41,23 +41,23 @@  discard block
 block discarded – undo
41 41
 	 * @param array $languageIds List of two letter ISO language IDs
42 42
 	 * @return \Aimeos\MW\Translation\Iface[] List of translation objects
43 43
 	 */
44
-	public function get( array $languageIds )
44
+	public function get(array $languageIds)
45 45
 	{
46
-		$config = $this->container->get( 'aimeos_config' )->get();
47
-		$i18nPaths = $this->container->get( 'aimeos' )->getI18nPaths();
46
+		$config = $this->container->get('aimeos_config')->get();
47
+		$i18nPaths = $this->container->get('aimeos')->getI18nPaths();
48 48
 
49
-		foreach( $languageIds as $langid )
49
+		foreach ($languageIds as $langid)
50 50
 		{
51
-			if( !isset( $this->i18n[$langid] ) )
51
+			if (!isset($this->i18n[$langid]))
52 52
 			{
53
-				$i18n = new \Aimeos\MW\Translation\Gettext( $i18nPaths, $langid );
53
+				$i18n = new \Aimeos\MW\Translation\Gettext($i18nPaths, $langid);
54 54
 
55
-				if( function_exists( 'apcu_store' ) === true && $config->get( 'apc_enabled', false ) == true ) {
56
-					$i18n = new \Aimeos\MW\Translation\Decorator\APC( $i18n, $config->get( 'apc_prefix', 'slim:' ) );
55
+				if (function_exists('apcu_store') === true && $config->get('apc_enabled', false) == true) {
56
+					$i18n = new \Aimeos\MW\Translation\Decorator\APC($i18n, $config->get('apc_prefix', 'slim:'));
57 57
 				}
58 58
 
59
-				if( ( $cfg = $config->get( 'i18n/' . $langid, array() ) ) !== array() ) {
60
-					$i18n = new \Aimeos\MW\Translation\Decorator\Memory( $i18n, $cfg );
59
+				if (($cfg = $config->get('i18n/'.$langid, array())) !== array()) {
60
+					$i18n = new \Aimeos\MW\Translation\Decorator\Memory($i18n, $cfg);
61 61
 				}
62 62
 
63 63
 				$this->i18n[$langid] = $i18n;
Please login to merge, or discard this patch.
src/Controller/Basket.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -31,11 +31,11 @@
 block discarded – undo
31 31
 	 * @param array $args Associative list of route parameters
32 32
 	 * @return ResponseInterface $response Modified response object with generated output
33 33
 	 */
34
-	public static function indexAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args )
34
+	public static function indexAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args)
35 35
 	{
36
-		$contents = $container->get( 'aimeos_page' )->getSections( 'basket-index', $request, $response, $args );
37
-		$response = $container->get( 'view' )->render( $response, 'Basket/index.html.twig', $contents );
36
+		$contents = $container->get('aimeos_page')->getSections('basket-index', $request, $response, $args);
37
+		$response = $container->get('view')->render($response, 'Basket/index.html.twig', $contents);
38 38
 
39
-		return $response->withHeader( 'Cache-Control', 'no-store' );
39
+		return $response->withHeader('Cache-Control', 'no-store');
40 40
 	}
41 41
 }
42 42
\ No newline at end of file
Please login to merge, or discard this patch.