Completed
Push — master ( 9bf8ab...afe8d8 )
by Aimeos
07:50
created
controller/frontend/tests/Controller/Frontend/Common/Factory/BaseTest.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -20,33 +20,33 @@
 block discarded – undo
20 20
 		$this->context = \TestHelperFrontend::getContext();
21 21
 		$config = $this->context->getConfig();
22 22
 
23
-		$config->set( 'controller/frontend/common/decorators/default', [] );
24
-		$config->set( 'controller/frontend/catalog/decorators/global', [] );
25
-		$config->set( 'controller/frontend/catalog/decorators/local', [] );
23
+		$config->set('controller/frontend/common/decorators/default', []);
24
+		$config->set('controller/frontend/catalog/decorators/global', []);
25
+		$config->set('controller/frontend/catalog/decorators/local', []);
26 26
 
27 27
 	}
28 28
 
29 29
 
30 30
 	public function testInjectController()
31 31
 	{
32
-		$controller = \Aimeos\Controller\Frontend\Catalog\Factory::createController( $this->context, 'Standard' );
33
-		\Aimeos\Controller\Frontend\Catalog\Factory::injectController( '\\Aimeos\\Controller\\Frontend\\Catalog\\Standard', $controller );
32
+		$controller = \Aimeos\Controller\Frontend\Catalog\Factory::createController($this->context, 'Standard');
33
+		\Aimeos\Controller\Frontend\Catalog\Factory::injectController('\\Aimeos\\Controller\\Frontend\\Catalog\\Standard', $controller);
34 34
 
35
-		$injectedController = \Aimeos\Controller\Frontend\Catalog\Factory::createController( $this->context, 'Standard' );
35
+		$injectedController = \Aimeos\Controller\Frontend\Catalog\Factory::createController($this->context, 'Standard');
36 36
 
37
-		$this->assertSame( $controller, $injectedController );
37
+		$this->assertSame($controller, $injectedController);
38 38
 	}
39 39
 
40 40
 
41 41
 	public function testInjectControllerReset()
42 42
 	{
43
-		$controller = \Aimeos\Controller\Frontend\Catalog\Factory::createController( $this->context, 'Standard' );
44
-		\Aimeos\Controller\Frontend\Catalog\Factory::injectController( '\\Aimeos\\Controller\\Frontend\\Catalog\\Standard', $controller );
45
-		\Aimeos\Controller\Frontend\Catalog\Factory::injectController( '\\Aimeos\\Controller\\Frontend\\Catalog\\Standard', null );
43
+		$controller = \Aimeos\Controller\Frontend\Catalog\Factory::createController($this->context, 'Standard');
44
+		\Aimeos\Controller\Frontend\Catalog\Factory::injectController('\\Aimeos\\Controller\\Frontend\\Catalog\\Standard', $controller);
45
+		\Aimeos\Controller\Frontend\Catalog\Factory::injectController('\\Aimeos\\Controller\\Frontend\\Catalog\\Standard', null);
46 46
 
47
-		$new = \Aimeos\Controller\Frontend\Catalog\Factory::createController( $this->context, 'Standard' );
47
+		$new = \Aimeos\Controller\Frontend\Catalog\Factory::createController($this->context, 'Standard');
48 48
 
49
-		$this->assertNotSame( $controller, $new );
49
+		$this->assertNotSame($controller, $new);
50 50
 	}
51 51
 
52 52
 }
53 53
\ No newline at end of file
Please login to merge, or discard this patch.
controller/frontend/tests/Controller/Frontend/Stock/StandardTest.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -16,13 +16,13 @@  discard block
 block discarded – undo
16 16
 
17 17
 	protected function setUp()
18 18
 	{
19
-		$this->object = new \Aimeos\Controller\Frontend\Stock\Standard( \TestHelperFrontend::getContext() );
19
+		$this->object = new \Aimeos\Controller\Frontend\Stock\Standard(\TestHelperFrontend::getContext());
20 20
 	}
21 21
 
22 22
 
23 23
 	protected function tearDown()
24 24
 	{
25
-		unset( $this->object );
25
+		unset($this->object);
26 26
 	}
27 27
 
28 28
 
@@ -30,66 +30,66 @@  discard block
 block discarded – undo
30 30
 	{
31 31
 		$filter = $this->object->createFilter();
32 32
 
33
-		$this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Iface', $filter );
34
-		$this->assertEquals( [], $filter->getSortations() );
35
-		$this->assertEquals( 0, $filter->getSliceStart() );
36
-		$this->assertEquals( 100, $filter->getSliceSize() );
33
+		$this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Iface', $filter);
34
+		$this->assertEquals([], $filter->getSortations());
35
+		$this->assertEquals(0, $filter->getSliceStart());
36
+		$this->assertEquals(100, $filter->getSliceSize());
37 37
 	}
38 38
 
39 39
 
40 40
 	public function testAddFilterCodes()
41 41
 	{
42 42
 		$filter = $this->object->createFilter();
43
-		$filter = $this->object->addFilterCodes( $filter, ['CNC', 'CNE'] );
43
+		$filter = $this->object->addFilterCodes($filter, ['CNC', 'CNE']);
44 44
 
45 45
 		$list = $filter->getConditions()->getExpressions();
46 46
 
47
-		if( !isset( $list[0] ) || !( $list[0] instanceof \Aimeos\MW\Criteria\Expression\Compare\Iface ) ) {
48
-			throw new \RuntimeException( 'Wrong expression' );
47
+		if (!isset($list[0]) || !($list[0] instanceof \Aimeos\MW\Criteria\Expression\Compare\Iface)) {
48
+			throw new \RuntimeException('Wrong expression');
49 49
 		}
50 50
 
51
-		$this->assertEquals( 'stock.productcode', $list[0]->getName() );
52
-		$this->assertEquals( 2, count( $list[0]->getValue() ) );
51
+		$this->assertEquals('stock.productcode', $list[0]->getName());
52
+		$this->assertEquals(2, count($list[0]->getValue()));
53 53
 	}
54 54
 
55 55
 
56 56
 	public function testAddFilterTypes()
57 57
 	{
58 58
 		$filter = $this->object->createFilter();
59
-		$filter = $this->object->addFilterTypes( $filter, ['default'] );
59
+		$filter = $this->object->addFilterTypes($filter, ['default']);
60 60
 
61 61
 		$list = $filter->getConditions()->getExpressions();
62 62
 
63
-		if( !isset( $list[0] ) || !( $list[0] instanceof \Aimeos\MW\Criteria\Expression\Compare\Iface ) ) {
64
-			throw new \RuntimeException( 'Wrong expression' );
63
+		if (!isset($list[0]) || !($list[0] instanceof \Aimeos\MW\Criteria\Expression\Compare\Iface)) {
64
+			throw new \RuntimeException('Wrong expression');
65 65
 		}
66 66
 
67
-		$this->assertEquals( 'stock.type.code', $list[0]->getName() );
68
-		$this->assertEquals( 1, count( $list[0]->getValue() ) );
67
+		$this->assertEquals('stock.type.code', $list[0]->getName());
68
+		$this->assertEquals(1, count($list[0]->getValue()));
69 69
 	}
70 70
 
71 71
 
72 72
 	public function testGetItem()
73 73
 	{
74 74
 		$context = \TestHelperFrontend::getContext();
75
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'stock' );
76
-		$id = $manager->findItem( 'CNC', [], 'product', 'default' )->getId();
75
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'stock');
76
+		$id = $manager->findItem('CNC', [], 'product', 'default')->getId();
77 77
 
78
-		$result = $this->object->getItem( $id );
78
+		$result = $this->object->getItem($id);
79 79
 
80
-		$this->assertInstanceOf( '\Aimeos\MShop\Stock\Item\Iface', $result );
80
+		$this->assertInstanceOf('\Aimeos\MShop\Stock\Item\Iface', $result);
81 81
 	}
82 82
 
83 83
 
84 84
 	public function testSearchItems()
85 85
 	{
86 86
 		$filter = $this->object->createFilter();
87
-		$filter = $this->object->addFilterCodes( $filter, ['CNC', 'CNE'] );
87
+		$filter = $this->object->addFilterCodes($filter, ['CNC', 'CNE']);
88 88
 
89 89
 		$total = 0;
90
-		$results = $this->object->searchItems( $filter, $total );
90
+		$results = $this->object->searchItems($filter, $total);
91 91
 
92
-		$this->assertEquals( 2, $total );
93
-		$this->assertEquals( 2, count( $results ) );
92
+		$this->assertEquals(2, $total);
93
+		$this->assertEquals(2, count($results));
94 94
 	}
95 95
 }
Please login to merge, or discard this patch.
controller/frontend/src/Controller/Frontend/Exception.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,9 +32,9 @@
 block discarded – undo
32 32
 	 * @param \Exception $previous The previous exception used for the exception chaining.
33 33
 	 * @param array $list The associative list of errors and their messages when several errors occured
34 34
 	 */
35
-	public function __construct( $msg = '', $code = 0, \Exception $previous = null, array $list = [] )
35
+	public function __construct($msg = '', $code = 0, \Exception $previous = null, array $list = [])
36 36
 	{
37
-		parent::__construct( $msg, $code, $previous );
37
+		parent::__construct($msg, $code, $previous);
38 38
 
39 39
 		$this->list = $list;
40 40
 	}
Please login to merge, or discard this patch.
controller/frontend/src/Controller/Frontend/Common/Factory/Base.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 	 * @param string $classname Full name of the class for which the object should be returned
32 32
 	 * @param \Aimeos\Controller\Frontend\Iface|null $controller Frontend controller object
33 33
 	 */
34
-	public static function injectController( $classname, \Aimeos\Controller\Frontend\Iface $controller = null )
34
+	public static function injectController($classname, \Aimeos\Controller\Frontend\Iface $controller = null)
35 35
 	{
36 36
 		self::$objects[$classname] = $controller;
37 37
 	}
@@ -46,29 +46,29 @@  discard block
 block discarded – undo
46 46
 	 * @param string $classprefix Decorator class prefix, e.g. "\Aimeos\Controller\Frontend\Basket\Decorator\"
47 47
 	 * @return \Aimeos\Controller\Frontend\Common\Iface Controller object
48 48
 	 */
49
-	protected static function addDecorators( \Aimeos\MShop\Context\Item\Iface $context,
50
-		\Aimeos\Controller\Frontend\Iface $controller, array $decorators, $classprefix )
49
+	protected static function addDecorators(\Aimeos\MShop\Context\Item\Iface $context,
50
+		\Aimeos\Controller\Frontend\Iface $controller, array $decorators, $classprefix)
51 51
 	{
52 52
 		$iface = '\\Aimeos\\Controller\\Frontend\\Common\\Decorator\\Iface';
53 53
 
54
-		foreach( $decorators as $name )
54
+		foreach ($decorators as $name)
55 55
 		{
56
-			if( ctype_alnum( $name ) === false )
56
+			if (ctype_alnum($name) === false)
57 57
 			{
58
-				$classname = is_string( $name ) ? $classprefix . $name : '<not a string>';
59
-				throw new \Aimeos\Controller\Frontend\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) );
58
+				$classname = is_string($name) ? $classprefix . $name : '<not a string>';
59
+				throw new \Aimeos\Controller\Frontend\Exception(sprintf('Invalid characters in class name "%1$s"', $classname));
60 60
 			}
61 61
 
62 62
 			$classname = $classprefix . $name;
63 63
 
64
-			if( class_exists( $classname ) === false ) {
65
-				throw new \Aimeos\Controller\Frontend\Exception( sprintf( 'Class "%1$s" not available', $classname ) );
64
+			if (class_exists($classname) === false) {
65
+				throw new \Aimeos\Controller\Frontend\Exception(sprintf('Class "%1$s" not available', $classname));
66 66
 			}
67 67
 
68
-			$controller = new $classname( $controller, $context );
68
+			$controller = new $classname($controller, $context);
69 69
 
70
-			if( !( $controller instanceof $iface ) ) {
71
-				throw new \Aimeos\Controller\Frontend\Exception( sprintf( 'Class "%1$s" does not implement interface "%2$s"', $classname, $iface ) );
70
+			if (!($controller instanceof $iface)) {
71
+				throw new \Aimeos\Controller\Frontend\Exception(sprintf('Class "%1$s" does not implement interface "%2$s"', $classname, $iface));
72 72
 			}
73 73
 		}
74 74
 
@@ -84,14 +84,14 @@  discard block
 block discarded – undo
84 84
 	 * @param string $domain Domain name in lower case, e.g. "product"
85 85
 	 * @return \Aimeos\Controller\Frontend\Common\Iface Controller object
86 86
 	 */
87
-	protected static function addControllerDecorators( \Aimeos\MShop\Context\Item\Iface $context,
88
-		\Aimeos\Controller\Frontend\Iface $controller, $domain )
87
+	protected static function addControllerDecorators(\Aimeos\MShop\Context\Item\Iface $context,
88
+		\Aimeos\Controller\Frontend\Iface $controller, $domain)
89 89
 	{
90
-		if( !is_string( $domain ) || $domain === '' ) {
91
-			throw new \Aimeos\Controller\Frontend\Exception( sprintf( 'Invalid domain "%1$s"', $domain ) );
90
+		if (!is_string($domain) || $domain === '') {
91
+			throw new \Aimeos\Controller\Frontend\Exception(sprintf('Invalid domain "%1$s"', $domain));
92 92
 		}
93 93
 
94
-		$localClass = str_replace( ' ', '\\', ucwords( str_replace( '/', ' ', $domain ) ) );
94
+		$localClass = str_replace(' ', '\\', ucwords(str_replace('/', ' ', $domain)));
95 95
 		$config = $context->getConfig();
96 96
 
97 97
 		/** controller/frontend/common/decorators/default
@@ -116,26 +116,26 @@  discard block
 block discarded – undo
116 116
 		 * @since 2014.03
117 117
 		 * @category Developer
118 118
 		 */
119
-		$decorators = $config->get( 'controller/frontend/common/decorators/default', [] );
120
-		$excludes = $config->get( 'controller/frontend/' . $domain . '/decorators/excludes', [] );
119
+		$decorators = $config->get('controller/frontend/common/decorators/default', []);
120
+		$excludes = $config->get('controller/frontend/' . $domain . '/decorators/excludes', []);
121 121
 
122
-		foreach( $decorators as $key => $name )
122
+		foreach ($decorators as $key => $name)
123 123
 		{
124
-			if( in_array( $name, $excludes ) ) {
125
-				unset( $decorators[$key] );
124
+			if (in_array($name, $excludes)) {
125
+				unset($decorators[$key]);
126 126
 			}
127 127
 		}
128 128
 
129 129
 		$classprefix = '\\Aimeos\\Controller\\Frontend\\Common\\Decorator\\';
130
-		$controller = self::addDecorators( $context, $controller, $decorators, $classprefix );
130
+		$controller = self::addDecorators($context, $controller, $decorators, $classprefix);
131 131
 
132 132
 		$classprefix = '\\Aimeos\\Controller\\Frontend\\Common\\Decorator\\';
133
-		$decorators = $config->get( 'controller/frontend/' . $domain . '/decorators/global', [] );
134
-		$controller = self::addDecorators( $context, $controller, $decorators, $classprefix );
133
+		$decorators = $config->get('controller/frontend/' . $domain . '/decorators/global', []);
134
+		$controller = self::addDecorators($context, $controller, $decorators, $classprefix);
135 135
 
136
-		$classprefix = '\\Aimeos\\Controller\\Frontend\\' . ucfirst( $localClass ) . '\\Decorator\\';
137
-		$decorators = $config->get( 'controller/frontend/' . $domain . '/decorators/local', [] );
138
-		$controller = self::addDecorators( $context, $controller, $decorators, $classprefix );
136
+		$classprefix = '\\Aimeos\\Controller\\Frontend\\' . ucfirst($localClass) . '\\Decorator\\';
137
+		$decorators = $config->get('controller/frontend/' . $domain . '/decorators/local', []);
138
+		$controller = self::addDecorators($context, $controller, $decorators, $classprefix);
139 139
 
140 140
 		return $controller;
141 141
 	}
@@ -149,20 +149,20 @@  discard block
 block discarded – undo
149 149
 	 * @param string $interface Name of the controller interface
150 150
 	 * @return \Aimeos\Controller\Frontend\Common\Iface Controller object
151 151
 	 */
152
-	protected static function createControllerBase( \Aimeos\MShop\Context\Item\Iface $context, $classname, $interface )
152
+	protected static function createControllerBase(\Aimeos\MShop\Context\Item\Iface $context, $classname, $interface)
153 153
 	{
154
-		if( isset( self::$objects[$classname] ) ) {
154
+		if (isset(self::$objects[$classname])) {
155 155
 			return self::$objects[$classname];
156 156
 		}
157 157
 
158
-		if( class_exists( $classname ) === false ) {
159
-			throw new \Aimeos\Controller\Frontend\Exception( sprintf( 'Class "%1$s" not available', $classname ) );
158
+		if (class_exists($classname) === false) {
159
+			throw new \Aimeos\Controller\Frontend\Exception(sprintf('Class "%1$s" not available', $classname));
160 160
 		}
161 161
 
162
-		$controller = new $classname( $context );
162
+		$controller = new $classname($context);
163 163
 
164
-		if( !( $controller instanceof $interface ) ) {
165
-			throw new \Aimeos\Controller\Frontend\Exception( sprintf( 'Class "%1$s" does not implement interface "%2$s"', $classname, $interface ) );
164
+		if (!($controller instanceof $interface)) {
165
+			throw new \Aimeos\Controller\Frontend\Exception(sprintf('Class "%1$s" does not implement interface "%2$s"', $classname, $interface));
166 166
 		}
167 167
 
168 168
 		return $controller;
Please login to merge, or discard this patch.
controller/frontend/src/Controller/Frontend/Locale/Iface.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 	 * @return \Aimeos\MShop\Locale\Item\Iface Locale item including the referenced domains items
37 37
 	 * @since 2017.03
38 38
 	 */
39
-	public function getItem( $id, array $domains = [] );
39
+	public function getItem($id, array $domains = []);
40 40
 
41 41
 
42 42
 	/**
@@ -48,5 +48,5 @@  discard block
 block discarded – undo
48 48
 	 * @return array Ordered list of locale items implementing \Aimeos\MShop\Locale\Item\Iface
49 49
 	 * @since 2017.03
50 50
 	 */
51
-	public function searchItems( \Aimeos\MW\Criteria\Iface $filter, array $domains = [], &$total = null );
51
+	public function searchItems(\Aimeos\MW\Criteria\Iface $filter, array $domains = [], &$total = null);
52 52
 }
Please login to merge, or discard this patch.
controller/frontend/src/Controller/Frontend/Locale/Standard.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -31,15 +31,15 @@  discard block
 block discarded – undo
31 31
 	public function createFilter()
32 32
 	{
33 33
 		$context = $this->getContext();
34
-		$filter = \Aimeos\MShop\Factory::createManager( $context, 'locale' )->createSearch( true );
34
+		$filter = \Aimeos\MShop\Factory::createManager($context, 'locale')->createSearch(true);
35 35
 
36 36
 		$expr = array(
37
-			$filter->compare( '==', 'locale.siteid', $context->getLocale()->getSitePath() ),
37
+			$filter->compare('==', 'locale.siteid', $context->getLocale()->getSitePath()),
38 38
 			$filter->getConditions(),
39 39
 		);
40 40
 
41
-		$filter->setConditions( $filter->combine( '&&', $expr ) );
42
-		$filter->setSortations( array( $filter->sort( '+', 'locale.position' ) ) );
41
+		$filter->setConditions($filter->combine('&&', $expr));
42
+		$filter->setSortations(array($filter->sort('+', 'locale.position')));
43 43
 
44 44
 		return $filter;
45 45
 	}
@@ -53,9 +53,9 @@  discard block
 block discarded – undo
53 53
 	 * @return \Aimeos\MShop\Locale\Item\Iface Locale item including the referenced domains items
54 54
 	 * @since 2017.03
55 55
 	 */
56
-	public function getItem( $id, array $domains = [] )
56
+	public function getItem($id, array $domains = [])
57 57
 	{
58
-		return \Aimeos\MShop\Factory::createManager( $this->getContext(), 'locale' )->getItem( $id, $domains, true );
58
+		return \Aimeos\MShop\Factory::createManager($this->getContext(), 'locale')->getItem($id, $domains, true);
59 59
 	}
60 60
 
61 61
 
@@ -68,8 +68,8 @@  discard block
 block discarded – undo
68 68
 	 * @return array Ordered list of locale items implementing \Aimeos\MShop\Locale\Item\Iface
69 69
 	 * @since 2017.03
70 70
 	 */
71
-	public function searchItems( \Aimeos\MW\Criteria\Iface $filter, array $domains = [], &$total = null )
71
+	public function searchItems(\Aimeos\MW\Criteria\Iface $filter, array $domains = [], &$total = null)
72 72
 	{
73
-		return \Aimeos\MShop\Factory::createManager( $this->getContext(), 'locale' )->searchItems( $filter, $domains, $total );
73
+		return \Aimeos\MShop\Factory::createManager($this->getContext(), 'locale')->searchItems($filter, $domains, $total);
74 74
 	}
75 75
 }
Please login to merge, or discard this patch.
controller/frontend/src/Controller/Frontend/Factory.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -30,11 +30,11 @@  discard block
 block discarded – undo
30 30
 	 * @param integer $id Context ID the objects have been created with (string of \Aimeos\MShop\Context\Item\Iface)
31 31
 	 * @param string $path Path describing the controller to clear, e.g. "basket"
32 32
 	 */
33
-	static public function clear( $id = null, $path = null )
33
+	static public function clear($id = null, $path = null)
34 34
 	{
35
-		if( $id !== null )
35
+		if ($id !== null)
36 36
 		{
37
-			if( $path !== null ) {
37
+			if ($path !== null) {
38 38
 				self::$controllers[$id][$path] = null;
39 39
 			} else {
40 40
 				self::$controllers[$id] = [];
@@ -62,37 +62,37 @@  discard block
 block discarded – undo
62 62
 	 * @return \Aimeos\Controller\Frontend\Iface New frontend controller
63 63
 	 * @throws \Aimeos\Controller\Frontend\Exception If the given path is invalid or the manager wasn't found
64 64
 	 */
65
-	static public function createController( \Aimeos\MShop\Context\Item\Iface $context, $path )
65
+	static public function createController(\Aimeos\MShop\Context\Item\Iface $context, $path)
66 66
 	{
67
-		if( empty( $path ) ) {
68
-			throw new \Aimeos\Controller\Frontend\Exception( sprintf( 'Controller path is empty' ) );
67
+		if (empty($path)) {
68
+			throw new \Aimeos\Controller\Frontend\Exception(sprintf('Controller path is empty'));
69 69
 		}
70 70
 
71 71
 		$id = (string) $context;
72 72
 
73
-		if( self::$cache === false || !isset( self::$controllers[$id][$path] ) )
73
+		if (self::$cache === false || !isset(self::$controllers[$id][$path]))
74 74
 		{
75
-			$parts = explode( '/', $path );
75
+			$parts = explode('/', $path);
76 76
 
77
-			foreach( $parts as $key => $part )
77
+			foreach ($parts as $key => $part)
78 78
 			{
79
-				if( ctype_alnum( $part ) === false ) {
80
-					throw new \Aimeos\Controller\Frontend\Exception( sprintf( 'Invalid characters in controller name "%1$s" in "%2$s"', $part, $path ) );
79
+				if (ctype_alnum($part) === false) {
80
+					throw new \Aimeos\Controller\Frontend\Exception(sprintf('Invalid characters in controller name "%1$s" in "%2$s"', $part, $path));
81 81
 				}
82 82
 
83
-				$parts[$key] = ucwords( $part );
83
+				$parts[$key] = ucwords($part);
84 84
 			}
85 85
 
86
-			$factory = '\\Aimeos\\Controller\\Frontend\\' . join( '\\', $parts ) . '\\Factory';
86
+			$factory = '\\Aimeos\\Controller\\Frontend\\' . join('\\', $parts) . '\\Factory';
87 87
 
88
-			if( class_exists( $factory ) === false ) {
89
-				throw new \Aimeos\Controller\Frontend\Exception( sprintf( 'Class "%1$s" not available', $factory ) );
88
+			if (class_exists($factory) === false) {
89
+				throw new \Aimeos\Controller\Frontend\Exception(sprintf('Class "%1$s" not available', $factory));
90 90
 			}
91 91
 
92
-			$manager = call_user_func_array( array( $factory, 'createController' ), array( $context ) );
92
+			$manager = call_user_func_array(array($factory, 'createController'), array($context));
93 93
 
94
-			if( $manager === false ) {
95
-				throw new \Aimeos\Controller\Frontend\Exception( sprintf( 'Invalid factory "%1$s"', $factory ) );
94
+			if ($manager === false) {
95
+				throw new \Aimeos\Controller\Frontend\Exception(sprintf('Invalid factory "%1$s"', $factory));
96 96
 			}
97 97
 
98 98
 			self::$controllers[$id][$path] = $manager;
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 	 * @param boolean $value True to enable caching, false to disable it.
109 109
 	 * @return boolean Previous cache setting
110 110
 	 */
111
-	static public function setCache( $value )
111
+	static public function setCache($value)
112 112
 	{
113 113
 		$old = self::$cache;
114 114
 		self::$cache = (boolean) $value;
Please login to merge, or discard this patch.
controller/frontend/src/Controller/Frontend/Attribute/Standard.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -29,15 +29,15 @@  discard block
 block discarded – undo
29 29
 	 * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching
30 30
 	 * @since 2017.03
31 31
 	 */
32
-	public function addFilterTypes( \Aimeos\MW\Criteria\Iface $filter, array $codes )
32
+	public function addFilterTypes(\Aimeos\MW\Criteria\Iface $filter, array $codes)
33 33
 	{
34
-		if( !empty( $codes ) )
34
+		if (!empty($codes))
35 35
 		{
36 36
 			$expr = [
37
-				$filter->compare( '==', 'attribute.type.code', $codes ),
37
+				$filter->compare('==', 'attribute.type.code', $codes),
38 38
 				$filter->getConditions(),
39 39
 			];
40
-			$filter->setConditions( $filter->combine( '&&', $expr ) );
40
+			$filter->setConditions($filter->combine('&&', $expr));
41 41
 		}
42 42
 
43 43
 		return $filter;
@@ -53,15 +53,15 @@  discard block
 block discarded – undo
53 53
 	 */
54 54
 	public function createFilter()
55 55
 	{
56
-		$filter = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'attribute' )->createSearch( true );
56
+		$filter = \Aimeos\MShop\Factory::createManager($this->getContext(), 'attribute')->createSearch(true);
57 57
 
58 58
 		$expr = array(
59
-			$filter->compare( '==', 'attribute.domain', 'product' ),
59
+			$filter->compare('==', 'attribute.domain', 'product'),
60 60
 			$filter->getConditions(),
61 61
 		);
62 62
 
63
-		$filter->setConditions( $filter->combine( '&&', $expr ) );
64
-		$filter->setSortations( array( $filter->sort( '+', 'attribute.position' ) ) );
63
+		$filter->setConditions($filter->combine('&&', $expr));
64
+		$filter->setSortations(array($filter->sort('+', 'attribute.position')));
65 65
 
66 66
 		return $filter;
67 67
 	}
@@ -75,9 +75,9 @@  discard block
 block discarded – undo
75 75
 	 * @return \Aimeos\MShop\Attribute\Item\Iface Attribute item including the referenced domains items
76 76
 	 * @since 2017.03
77 77
 	 */
78
-	public function getItem( $id, array $domains = array( 'media', 'price', 'text' ) )
78
+	public function getItem($id, array $domains = array('media', 'price', 'text'))
79 79
 	{
80
-		return \Aimeos\MShop\Factory::createManager( $this->getContext(), 'attribute' )->getItem( $id, $domains, true );
80
+		return \Aimeos\MShop\Factory::createManager($this->getContext(), 'attribute')->getItem($id, $domains, true);
81 81
 	}
82 82
 
83 83
 
@@ -89,20 +89,20 @@  discard block
 block discarded – undo
89 89
 	 * @return \Aimeos\MShop\Attribute\Item\Iface[] Associative list of attribute item including the referenced domains items
90 90
 	 * @since 2017.03
91 91
 	 */
92
-	public function getItems( array $ids, array $domains = array( 'media', 'price', 'text' ) )
92
+	public function getItems(array $ids, array $domains = array('media', 'price', 'text'))
93 93
 	{
94
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'attribute' );
94
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'attribute');
95 95
 
96
-		$filter = $manager->createSearch( true );
96
+		$filter = $manager->createSearch(true);
97 97
 		$expr = [
98
-			$filter->compare( '==', 'attribute.domain', 'product' ),
99
-			$filter->compare( '==', 'attribute.id', $ids ),
98
+			$filter->compare('==', 'attribute.domain', 'product'),
99
+			$filter->compare('==', 'attribute.id', $ids),
100 100
 			$filter->getConditions(),
101 101
 		];
102
-		$filter->setConditions( $filter->combine( '&&', $expr ) );
103
-		$filter->setSortations( array( $filter->sort( '+', 'attribute.position' ) ) );
102
+		$filter->setConditions($filter->combine('&&', $expr));
103
+		$filter->setSortations(array($filter->sort('+', 'attribute.position')));
104 104
 
105
-		return $manager->searchItems( $filter, $domains );
105
+		return $manager->searchItems($filter, $domains);
106 106
 	}
107 107
 
108 108
 
@@ -115,8 +115,8 @@  discard block
 block discarded – undo
115 115
 	 * @return array Ordered list of attribute items implementing \Aimeos\MShop\Attribute\Item\Iface
116 116
 	 * @since 2017.03
117 117
 	 */
118
-	public function searchItems( \Aimeos\MW\Criteria\Iface $filter, array $domains = array( 'media', 'price', 'text' ), &$total = null )
118
+	public function searchItems(\Aimeos\MW\Criteria\Iface $filter, array $domains = array('media', 'price', 'text'), &$total = null)
119 119
 	{
120
-		return \Aimeos\MShop\Factory::createManager( $this->getContext(), 'attribute' )->searchItems( $filter, $domains, $total );
120
+		return \Aimeos\MShop\Factory::createManager($this->getContext(), 'attribute')->searchItems($filter, $domains, $total);
121 121
 	}
122 122
 }
Please login to merge, or discard this patch.
controller/frontend/src/Controller/Frontend/Customer/Iface.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 	 * @return \Aimeos\MShop\Customer\Item\Iface Customer item
27 27
 	 * @since 2017.04
28 28
 	 */
29
-	public function addItem( array $values );
29
+	public function addItem(array $values);
30 30
 
31 31
 
32 32
 	/**
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 	 * @return \Aimeos\MShop\Customer\Item\Iface Customer item
36 36
 	 * @since 2017.04
37 37
 	 */
38
-	public function createItem( array $values = [] );
38
+	public function createItem(array $values = []);
39 39
 
40 40
 
41 41
 	/**
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 	 * @param string $id Unique customer ID
45 45
 	 * @since 2017.04
46 46
 	 */
47
-	public function deleteItem( $id );
47
+	public function deleteItem($id);
48 48
 
49 49
 
50 50
 	/**
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 	 * @return \Aimeos\MShop\Customer\Item\Iface Customer item
56 56
 	 * @since 2017.04
57 57
 	 */
58
-	public function editItem( $id, array $values );
58
+	public function editItem($id, array $values);
59 59
 
60 60
 
61 61
 	/**
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 	 * @return \Aimeos\MShop\Customer\Item\Iface Customer item including the referenced domains items
67 67
 	 * @since 2017.04
68 68
 	 */
69
-	public function getItem( $id = null, array $domains = [] );
69
+	public function getItem($id = null, array $domains = []);
70 70
 
71 71
 
72 72
 	/**
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 	 * @return \Aimeos\MShop\Customer\Item\Iface Customer item including the referenced domains items
80 80
 	 * @since 2017.04
81 81
 	 */
82
-	public function findItem( $code, array $domains = [] );
82
+	public function findItem($code, array $domains = []);
83 83
 
84 84
 
85 85
 	/**
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 	 * @return \Aimeos\MShop\Customer\Item\Address\Iface Customer address item including the generated ID
90 90
 	 * @since 2017.04
91 91
 	 */
92
-	public function saveItem( \Aimeos\MShop\Customer\Item\Iface $item );
92
+	public function saveItem(\Aimeos\MShop\Customer\Item\Iface $item);
93 93
 
94 94
 
95 95
 	/**
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 	 * @return \Aimeos\MShop\Customer\Item\Iface Customer address item
100 100
 	 * @since 2017.04
101 101
 	 */
102
-	public function addAddressItem( array $values );
102
+	public function addAddressItem(array $values);
103 103
 
104 104
 
105 105
 	/**
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 	 * @return \Aimeos\MShop\Customer\Item\Address\Iface Customer address item
109 109
 	 * @since 2017.04
110 110
 	 */
111
-	public function createAddressItem( array $values = [] );
111
+	public function createAddressItem(array $values = []);
112 112
 
113 113
 
114 114
 	/**
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 	 * @param string $id Unique customer address ID
118 118
 	 * @since 2017.04
119 119
 	 */
120
-	public function deleteAddressItem( $id );
120
+	public function deleteAddressItem($id);
121 121
 
122 122
 
123 123
 	/**
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 	 * @return \Aimeos\MShop\Customer\Item\Iface Customer address item
129 129
 	 * @since 2017.04
130 130
 	 */
131
-	public function editAddressItem( $id, array $values );
131
+	public function editAddressItem($id, array $values);
132 132
 
133 133
 
134 134
 	/**
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 	 * @return \Aimeos\MShop\Customer\Item\Address\Iface Customer address item
139 139
 	 * @since 2017.04
140 140
 	 */
141
-	public function getAddressItem( $id );
141
+	public function getAddressItem($id);
142 142
 
143 143
 
144 144
 	/**
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 	 * @return \Aimeos\MShop\Customer\Item\Address\Iface Customer address item including the generated ID
149 149
 	 * @since 2017.04
150 150
 	 */
151
-	public function saveAddressItem( \Aimeos\MShop\Customer\Item\Address\Iface $item );
151
+	public function saveAddressItem(\Aimeos\MShop\Customer\Item\Address\Iface $item);
152 152
 
153 153
 	/**
154 154
 	 * Creates and returns a new list item object
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 	 * @return \Aimeos\MShop\Common\Item\Lists\Iface Customer lists item
158 158
 	 * @since 2017.06
159 159
 	 */
160
-	public function addListItem( array $values );
160
+	public function addListItem(array $values);
161 161
 
162 162
 	/**
163 163
 	 * Returns a new customer lists filter criteria object
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 	 * @param string $id Unique customer address ID
174 174
 	 * @since 2017.06
175 175
 	 */
176
-	public function deleteListItem( $id );
176
+	public function deleteListItem($id);
177 177
 
178 178
 	/**
179 179
 	 * Saves a modified customer lists item object
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 	 * @return \Aimeos\MShop\Common\Item\Lists\Iface Customer lists item
184 184
 	 * @since 2017.06
185 185
 	 */
186
-	public function editListItem( $id, array $values );
186
+	public function editListItem($id, array $values);
187 187
 
188 188
 	/**
189 189
 	 * Returns the customer item for the given customer ID
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 	 * @return \Aimeos\MShop\Customer\Item\Address\Iface Customer address item
193 193
 	 * @since 2017.06
194 194
 	 */
195
-	public function getListItem( $id );
195
+	public function getListItem($id);
196 196
 
197 197
 	/**
198 198
 	 * Returns the customer lists items filtered by the given criteria
@@ -202,5 +202,5 @@  discard block
 block discarded – undo
202 202
 	 * @return \Aimeos\MShop\Common\Item\Lists\Iface[] Customer list items
203 203
 	 * @since 2017.06
204 204
 	 */
205
-	public function searchListItems( \Aimeos\MW\Criteria\Iface $filter, &$total = null );
205
+	public function searchListItems(\Aimeos\MW\Criteria\Iface $filter, &$total = null);
206 206
 }
Please login to merge, or discard this patch.