Completed
Push — master ( 92c506...eb1cb8 )
by Aimeos
02:03
created
controller/frontend/tests/Controller/Frontend/Subscription/StandardTest.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -17,104 +17,104 @@
 block discarded – undo
17 17
 
18 18
 	protected function setUp()
19 19
 	{
20
-		\Aimeos\MShop\Factory::setCache( true );
20
+		\Aimeos\MShop\Factory::setCache(true);
21 21
 
22 22
 		$this->context = \TestHelperFrontend::getContext();
23
-		$this->object = new \Aimeos\Controller\Frontend\Subscription\Standard( $this->context );
23
+		$this->object = new \Aimeos\Controller\Frontend\Subscription\Standard($this->context);
24 24
 	}
25 25
 
26 26
 
27 27
 	protected function tearDown()
28 28
 	{
29
-		unset( $this->object, $this->context );
29
+		unset($this->object, $this->context);
30 30
 
31
-		\Aimeos\MShop\Factory::setCache( false );
31
+		\Aimeos\MShop\Factory::setCache(false);
32 32
 		\Aimeos\MShop\Factory::clear();
33 33
 	}
34 34
 
35 35
 
36 36
 	public function testCancel()
37 37
 	{
38
-		$this->context->setUserId( $this->getCustomerId() );
39
-		$item = \Aimeos\MShop\Factory::createManager( $this->context, 'subscription' )->createItem();
38
+		$this->context->setUserId($this->getCustomerId());
39
+		$item = \Aimeos\MShop\Factory::createManager($this->context, 'subscription')->createItem();
40 40
 
41
-		$cntl = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Subscription\Standard' )
42
-			->setConstructorArgs( [$this->context] )
43
-			->setMethods( ['saveItem'] )
41
+		$cntl = $this->getMockBuilder('\Aimeos\Controller\Frontend\Subscription\Standard')
42
+			->setConstructorArgs([$this->context])
43
+			->setMethods(['saveItem'])
44 44
 			->getMock();
45 45
 
46
-		$cntl->expects( $this->once() )->method( 'saveItem' )
47
-			->will( $this->returnValue( $item ) );
46
+		$cntl->expects($this->once())->method('saveItem')
47
+			->will($this->returnValue($item));
48 48
 
49
-		$this->assertInstanceOf( '\Aimeos\MShop\Subscription\Item\Iface', $cntl->cancel( $this->getSubscriptionId() ) );
49
+		$this->assertInstanceOf('\Aimeos\MShop\Subscription\Item\Iface', $cntl->cancel($this->getSubscriptionId()));
50 50
 	}
51 51
 
52 52
 
53 53
 	public function testCreateFilter()
54 54
 	{
55
-		$this->assertInstanceOf( '\Aimeos\MW\Criteria\Iface', $this->object->createFilter() );
55
+		$this->assertInstanceOf('\Aimeos\MW\Criteria\Iface', $this->object->createFilter());
56 56
 	}
57 57
 
58 58
 
59 59
 	public function testGetIntervals()
60 60
 	{
61
-		$this->assertGreaterThan( 0, count( $this->object->getIntervals() ) );
61
+		$this->assertGreaterThan(0, count($this->object->getIntervals()));
62 62
 	}
63 63
 
64 64
 
65 65
 	public function testGetItem()
66 66
 	{
67 67
 		$id = $this->getSubscriptionId();
68
-		$this->context->setUserId( $this->getCustomerId() );
68
+		$this->context->setUserId($this->getCustomerId());
69 69
 
70
-		$this->assertInstanceOf( '\Aimeos\MShop\Subscription\Item\Iface', $this->object->getItem( $id ) );
70
+		$this->assertInstanceOf('\Aimeos\MShop\Subscription\Item\Iface', $this->object->getItem($id));
71 71
 	}
72 72
 
73 73
 
74 74
 	public function testGetItemException()
75 75
 	{
76
-		$this->setExpectedException( '\Aimeos\Controller\Frontend\Subscription\Exception' );
76
+		$this->setExpectedException('\Aimeos\Controller\Frontend\Subscription\Exception');
77 77
 		$this->object->getItem( -1 );
78 78
 	}
79 79
 
80 80
 
81 81
 	public function testSaveItem()
82 82
 	{
83
-		$manager = $this->getMockBuilder( '\\Aimeos\\MShop\\Subscription\\Manager\\Standard' )
84
-			->setConstructorArgs( [$this->context] )
85
-			->setMethods( ['saveItem'] )
83
+		$manager = $this->getMockBuilder('\\Aimeos\\MShop\\Subscription\\Manager\\Standard')
84
+			->setConstructorArgs([$this->context])
85
+			->setMethods(['saveItem'])
86 86
 			->getMock();
87 87
 
88
-		\Aimeos\MShop\Factory::injectManager( $this->context, 'subscription', $manager );
88
+		\Aimeos\MShop\Factory::injectManager($this->context, 'subscription', $manager);
89 89
 
90
-		$manager->expects( $this->once() )->method( 'saveItem' )
91
-			->will( $this->returnValue( $manager->createItem() ) );
90
+		$manager->expects($this->once())->method('saveItem')
91
+			->will($this->returnValue($manager->createItem()));
92 92
 
93
-		$this->assertInstanceOf( '\Aimeos\MShop\Subscription\Item\Iface', $this->object->saveItem( $manager->createItem() ) );
93
+		$this->assertInstanceOf('\Aimeos\MShop\Subscription\Item\Iface', $this->object->saveItem($manager->createItem()));
94 94
 	}
95 95
 
96 96
 
97 97
 	public function testSearchItems()
98 98
 	{
99
-		$this->assertGreaterThan( 1, $this->object->searchItems( $this->object->createFilter() ) );
99
+		$this->assertGreaterThan(1, $this->object->searchItems($this->object->createFilter()));
100 100
 	}
101 101
 
102 102
 	protected function getCustomerId()
103 103
 	{
104
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'customer' );
105
-		return $manager->findItem( 'UTC001' )->getId();
104
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'customer');
105
+		return $manager->findItem('UTC001')->getId();
106 106
 	}
107 107
 
108 108
 
109 109
 	protected function getSubscriptionId()
110 110
 	{
111
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'subscription' );
112
-		$search = $manager->createSearch()->setSlice( 0, 1 );
113
-		$search->setConditions( $search->compare( '==', 'order.base.customerid', $this->getCustomerId() ) );
114
-		$result = $manager->searchItems( $search );
111
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'subscription');
112
+		$search = $manager->createSearch()->setSlice(0, 1);
113
+		$search->setConditions($search->compare('==', 'order.base.customerid', $this->getCustomerId()));
114
+		$result = $manager->searchItems($search);
115 115
 
116
-		if( ( $item = reset( $result ) ) === false ) {
117
-			throw new \RuntimeException( 'No subscription item found' );
116
+		if (($item = reset($result)) === false) {
117
+			throw new \RuntimeException('No subscription item found');
118 118
 		}
119 119
 
120 120
 		return $item->getId();
Please login to merge, or discard this patch.
controller/frontend/src/Controller/Frontend/Supplier/Decorator/Base.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -118,7 +118,7 @@
 block discarded – undo
118 118
 	/**
119 119
 	 * Returns the frontend controller
120 120
 	 *
121
-	 * @return \Aimeos\Controller\Frontend\Supplier\Iface Frontend controller object
121
+	 * @return \Aimeos\Controller\Frontend\Iface Frontend controller object
122 122
 	 */
123 123
 	protected function getController()
124 124
 	{
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -30,13 +30,13 @@  discard block
 block discarded – undo
30 30
 	 * @param \Aimeos\Controller\Frontend\Iface $controller Controller object
31 31
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context object with required objects
32 32
 	 */
33
-	public function __construct( \Aimeos\Controller\Frontend\Iface $controller, \Aimeos\MShop\Context\Item\Iface $context )
33
+	public function __construct(\Aimeos\Controller\Frontend\Iface $controller, \Aimeos\MShop\Context\Item\Iface $context)
34 34
 	{
35
-		\Aimeos\MW\Common\Base::checkClass( '\\Aimeos\\Controller\\Frontend\\Supplier\\Iface', $controller );
35
+		\Aimeos\MW\Common\Base::checkClass('\\Aimeos\\Controller\\Frontend\\Supplier\\Iface', $controller);
36 36
 
37 37
 		$this->controller = $controller;
38 38
 
39
-		parent::__construct( $context );
39
+		parent::__construct($context);
40 40
 	}
41 41
 
42 42
 
@@ -48,9 +48,9 @@  discard block
 block discarded – undo
48 48
 	 * @return mixed Returns the value of the called method
49 49
 	 * @throws \Aimeos\Controller\Frontend\Exception If method call failed
50 50
 	 */
51
-	public function __call( $name, array $param )
51
+	public function __call($name, array $param)
52 52
 	{
53
-		return @call_user_func_array( array( $this->controller, $name ), $param );
53
+		return @call_user_func_array(array($this->controller, $name), $param);
54 54
 	}
55 55
 
56 56
 
@@ -75,9 +75,9 @@  discard block
 block discarded – undo
75 75
 	 * @return \Aimeos\MShop\Supplier\Item\Iface Supplier item including the referenced domains items
76 76
 	 * @since 2018.07
77 77
 	 */
78
-	public function getItem( $id, array $domains = array( 'media', 'text' ) )
78
+	public function getItem($id, array $domains = array('media', 'text'))
79 79
 	{
80
-		return $this->controller->getItem( $id, $domains );
80
+		return $this->controller->getItem($id, $domains);
81 81
 	}
82 82
 
83 83
 
@@ -89,9 +89,9 @@  discard block
 block discarded – undo
89 89
 	 * @return \Aimeos\MShop\Supplier\Item\Iface[] Associative list of supplier item including the referenced domains items
90 90
 	 * @since 2018.07
91 91
 	 */
92
-	public function getItems( array $ids, array $domains = array( 'media', 'text' ) )
92
+	public function getItems(array $ids, array $domains = array('media', 'text'))
93 93
 	{
94
-		return $this->controller->getItems( $ids, $domains );
94
+		return $this->controller->getItems($ids, $domains);
95 95
 	}
96 96
 
97 97
 
@@ -104,9 +104,9 @@  discard block
 block discarded – undo
104 104
 	 * @return array Ordered list of supplier items implementing \Aimeos\MShop\Supplier\Item\Iface
105 105
 	 * @since 2018.07
106 106
 	 */
107
-	public function searchItems( \Aimeos\MW\Criteria\Iface $filter, array $domains = array( 'media', 'text' ), &$total = null )
107
+	public function searchItems(\Aimeos\MW\Criteria\Iface $filter, array $domains = array('media', 'text'), &$total = null)
108 108
 	{
109
-		return $this->controller->searchItems( $filter, $domains, $total );
109
+		return $this->controller->searchItems($filter, $domains, $total);
110 110
 	}
111 111
 
112 112
 
Please login to merge, or discard this patch.
controller/frontend/src/Controller/Frontend/Supplier/Factory.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 	 * @param string|null $name Name of the controller implementaton (default: "Standard")
29 29
 	 * @return \Aimeos\Controller\Frontend\Supplier\Iface Controller object
30 30
 	 */
31
-	public static function createController( \Aimeos\MShop\Context\Item\Iface $context, $name = null )
31
+	public static function createController(\Aimeos\MShop\Context\Item\Iface $context, $name = null)
32 32
 	{
33 33
 		/** controller/frontend/supplier/name
34 34
 		 * Class name of the used supplier frontend controller implementation
@@ -63,20 +63,20 @@  discard block
 block discarded – undo
63 63
 		 * @since 2018.07
64 64
 		 * @category Developer
65 65
 		 */
66
-		if( $name === null ) {
67
-			$name = $context->getConfig()->get( 'controller/frontend/supplier/name', 'Standard' );
66
+		if ($name === null) {
67
+			$name = $context->getConfig()->get('controller/frontend/supplier/name', 'Standard');
68 68
 		}
69 69
 
70
-		if( ctype_alnum( $name ) === false )
70
+		if (ctype_alnum($name) === false)
71 71
 		{
72
-			$classname = is_string( $name ) ? '\\Aimeos\\Controller\\Frontend\\Supplier\\' . $name : '<not a string>';
73
-			throw new \Aimeos\Controller\Frontend\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) );
72
+			$classname = is_string($name) ? '\\Aimeos\\Controller\\Frontend\\Supplier\\' . $name : '<not a string>';
73
+			throw new \Aimeos\Controller\Frontend\Exception(sprintf('Invalid characters in class name "%1$s"', $classname));
74 74
 		}
75 75
 
76 76
 		$iface = '\\Aimeos\\Controller\\Frontend\\Supplier\\Iface';
77 77
 		$classname = '\\Aimeos\\Controller\\Frontend\\Supplier\\' . $name;
78 78
 
79
-		$manager = self::createControllerBase( $context, $classname, $iface );
79
+		$manager = self::createControllerBase($context, $classname, $iface);
80 80
 
81 81
 		/** controller/frontend/supplier/decorators/excludes
82 82
 		 * Excludes decorators added by the "common" option from the supplier frontend controllers
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 		 * @see controller/frontend/supplier/decorators/excludes
153 153
 		 * @see controller/frontend/supplier/decorators/global
154 154
 		 */
155
-		return self::addControllerDecorators( $context, $manager, 'supplier' );
155
+		return self::addControllerDecorators($context, $manager, 'supplier');
156 156
 	}
157 157
 
158 158
 }
Please login to merge, or discard this patch.
controller/frontend/src/Controller/Frontend/Supplier/Standard.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 	 */
31 31
 	public function createFilter()
32 32
 	{
33
-		return \Aimeos\MShop\Factory::createManager( $this->getContext(), 'supplier' )->createSearch( true );
33
+		return \Aimeos\MShop\Factory::createManager($this->getContext(), 'supplier')->createSearch(true);
34 34
 	}
35 35
 
36 36
 
@@ -42,9 +42,9 @@  discard block
 block discarded – undo
42 42
 	 * @return \Aimeos\MShop\Supplier\Item\Iface Supplier item including the referenced domains items
43 43
 	 * @since 2018.07
44 44
 	 */
45
-	public function getItem( $id, array $domains = array( 'media', 'text' ) )
45
+	public function getItem($id, array $domains = array('media', 'text'))
46 46
 	{
47
-		return \Aimeos\MShop\Factory::createManager( $this->getContext(), 'supplier' )->getItem( $id, $domains, true );
47
+		return \Aimeos\MShop\Factory::createManager($this->getContext(), 'supplier')->getItem($id, $domains, true);
48 48
 	}
49 49
 
50 50
 
@@ -56,18 +56,18 @@  discard block
 block discarded – undo
56 56
 	 * @return \Aimeos\MShop\Supplier\Item\Iface[] Associative list of supplier item including the referenced domains items
57 57
 	 * @since 2018.07
58 58
 	 */
59
-	public function getItems( array $ids, array $domains = array( 'media', 'text' ) )
59
+	public function getItems(array $ids, array $domains = array('media', 'text'))
60 60
 	{
61
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'supplier' );
61
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'supplier');
62 62
 
63
-		$filter = $manager->createSearch( true );
63
+		$filter = $manager->createSearch(true);
64 64
 		$expr = [
65
-			$filter->compare( '==', 'supplier.id', $ids ),
65
+			$filter->compare('==', 'supplier.id', $ids),
66 66
 			$filter->getConditions(),
67 67
 		];
68
-		$filter->setConditions( $filter->combine( '&&', $expr ) );
68
+		$filter->setConditions($filter->combine('&&', $expr));
69 69
 
70
-		return $manager->searchItems( $filter, $domains );
70
+		return $manager->searchItems($filter, $domains);
71 71
 	}
72 72
 
73 73
 
@@ -80,8 +80,8 @@  discard block
 block discarded – undo
80 80
 	 * @return array Ordered list of supplier items implementing \Aimeos\MShop\Supplier\Item\Iface
81 81
 	 * @since 2018.07
82 82
 	 */
83
-	public function searchItems( \Aimeos\MW\Criteria\Iface $filter, array $domains = array( 'media', 'text' ), &$total = null )
83
+	public function searchItems(\Aimeos\MW\Criteria\Iface $filter, array $domains = array('media', 'text'), &$total = null)
84 84
 	{
85
-		return \Aimeos\MShop\Factory::createManager( $this->getContext(), 'supplier' )->searchItems( $filter, $domains, $total );
85
+		return \Aimeos\MShop\Factory::createManager($this->getContext(), 'supplier')->searchItems($filter, $domains, $total);
86 86
 	}
87 87
 }
Please login to merge, or discard this patch.
controller/frontend/src/Controller/Frontend/Supplier/Iface.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 	 * @return \Aimeos\MShop\Supplier\Item\Iface Supplier item including the referenced domains items
37 37
 	 * @since 2018.07
38 38
 	 */
39
-	public function getItem( $id, array $domains = array( 'media', 'text' ) );
39
+	public function getItem($id, array $domains = array('media', 'text'));
40 40
 
41 41
 
42 42
 	/**
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 	 * @return \Aimeos\MShop\Supplier\Item\Iface[] Associative list of supplier item including the referenced domains items
48 48
 	 * @since 2018.07
49 49
 	 */
50
-	public function getItems( array $ids, array $domains = array( 'media', 'text' ) );
50
+	public function getItems(array $ids, array $domains = array('media', 'text'));
51 51
 
52 52
 
53 53
 	/**
@@ -59,5 +59,5 @@  discard block
 block discarded – undo
59 59
 	 * @return array Ordered list of supplier items implementing \Aimeos\MShop\Supplier\Item\Iface
60 60
 	 * @since 2018.07
61 61
 	 */
62
-	public function searchItems( \Aimeos\MW\Criteria\Iface $filter, array $domains = array( 'media', 'text' ), &$total = null );
62
+	public function searchItems(\Aimeos\MW\Criteria\Iface $filter, array $domains = array('media', 'text'), &$total = null);
63 63
 }
Please login to merge, or discard this patch.
controller/frontend/src/Controller/Frontend/Product/Iface.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 	 * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching
31 31
 	 * @since 2017.03
32 32
 	 */
33
-	public function addFilterAttribute( \Aimeos\MW\Criteria\Iface $filter, array $attrIds, array $optIds, array $oneIds );
33
+	public function addFilterAttribute(\Aimeos\MW\Criteria\Iface $filter, array $attrIds, array $optIds, array $oneIds);
34 34
 
35 35
 
36 36
 	/**
@@ -45,8 +45,8 @@  discard block
 block discarded – undo
45 45
 	 * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching
46 46
 	 * @since 2017.03
47 47
 	 */
48
-	public function addFilterCategory( \Aimeos\MW\Criteria\Iface $filter, $catId,
49
-		$level = \Aimeos\MW\Tree\Manager\Base::LEVEL_ONE, $sort = null, $direction = '+', $listtype = 'default' );
48
+	public function addFilterCategory(\Aimeos\MW\Criteria\Iface $filter, $catId,
49
+		$level = \Aimeos\MW\Tree\Manager\Base::LEVEL_ONE, $sort = null, $direction = '+', $listtype = 'default');
50 50
 
51 51
 
52 52
 	/**
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 	 * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching
58 58
 	 * @since 2018.07
59 59
 	 */
60
-	public function addFilterSupplier( \Aimeos\MW\Criteria\Iface $filter, array $supIds );
60
+	public function addFilterSupplier(\Aimeos\MW\Criteria\Iface $filter, array $supIds);
61 61
 
62 62
 
63 63
 	/**
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 	 * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching
72 72
 	 * @since 2017.03
73 73
 	 */
74
-	public function addFilterText( \Aimeos\MW\Criteria\Iface $filter, $input, $sort = null, $direction = '+', $listtype = 'default' );
74
+	public function addFilterText(\Aimeos\MW\Criteria\Iface $filter, $input, $sort = null, $direction = '+', $listtype = 'default');
75 75
 
76 76
 
77 77
 	/**
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 	 * @return array Associative list of key values as key and the product count for this key as value
83 83
 	 * @since 2017.03
84 84
 	 */
85
-	public function aggregate( \Aimeos\MW\Criteria\Iface $filter, $key );
85
+	public function aggregate(\Aimeos\MW\Criteria\Iface $filter, $key);
86 86
 
87 87
 
88 88
 	/**
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 	 * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching
97 97
 	 * @since 2017.03
98 98
 	 */
99
-	public function createFilter( $sort = null, $direction = '+', $start = 0, $size = 100, $listtype = 'default' );
99
+	public function createFilter($sort = null, $direction = '+', $start = 0, $size = 100, $listtype = 'default');
100 100
 
101 101
 
102 102
 	/**
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 	 * @return \Aimeos\MShop\Product\Item\Iface Product item including the referenced domains items
108 108
 	 * @since 2017.03
109 109
 	 */
110
-	public function getItem( $productId, array $domains = array( 'attribute', 'media', 'price', 'product', 'product/property', 'text' ) );
110
+	public function getItem($productId, array $domains = array('attribute', 'media', 'price', 'product', 'product/property', 'text'));
111 111
 
112 112
 
113 113
 	/**
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 	 * @return \Aimeos\MShop\Product\Item\Iface[] Associative list of product IDs as keys and product items as values
119 119
 	 * @since 2017.03
120 120
 	 */
121
-	public function getItems( array $productIds, array $domains = array( 'media', 'price', 'text' ) );
121
+	public function getItems(array $productIds, array $domains = array('media', 'price', 'text'));
122 122
 
123 123
 
124 124
 	/**
@@ -130,5 +130,5 @@  discard block
 block discarded – undo
130 130
 	 * @return array Ordered list of product items implementing \Aimeos\MShop\Product\Item\Iface
131 131
 	 * @since 2017.03
132 132
 	 */
133
-	public function searchItems( \Aimeos\MW\Criteria\Iface $filter, array $domains = array( 'media', 'price', 'text' ), &$total = null );
133
+	public function searchItems(\Aimeos\MW\Criteria\Iface $filter, array $domains = array('media', 'price', 'text'), &$total = null);
134 134
 }
Please login to merge, or discard this patch.
controller/frontend/src/Controller/Frontend/Stock/Standard.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -29,13 +29,13 @@  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 addFilterCodes( \Aimeos\MW\Criteria\Iface $filter, array $codes )
32
+	public function addFilterCodes(\Aimeos\MW\Criteria\Iface $filter, array $codes)
33 33
 	{
34 34
 		$expr = [
35
-			$filter->compare( '==', 'stock.productcode', $codes ),
35
+			$filter->compare('==', 'stock.productcode', $codes),
36 36
 			$filter->getConditions(),
37 37
 		];
38
-		$filter->setConditions( $filter->combine( '&&', $expr ) );
38
+		$filter->setConditions($filter->combine('&&', $expr));
39 39
 
40 40
 		return $filter;
41 41
 	}
@@ -49,15 +49,15 @@  discard block
 block discarded – undo
49 49
 	 * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching
50 50
 	 * @since 2017.03
51 51
 	 */
52
-	public function addFilterTypes( \Aimeos\MW\Criteria\Iface $filter, array $codes )
52
+	public function addFilterTypes(\Aimeos\MW\Criteria\Iface $filter, array $codes)
53 53
 	{
54
-		if( !empty( $codes ) )
54
+		if (!empty($codes))
55 55
 		{
56 56
 			$expr = [
57
-				$filter->compare( '==', 'stock.type.code', $codes ),
57
+				$filter->compare('==', 'stock.type.code', $codes),
58 58
 				$filter->getConditions(),
59 59
 			];
60
-			$filter->setConditions( $filter->combine( '&&', $expr ) );
60
+			$filter->setConditions($filter->combine('&&', $expr));
61 61
 		}
62 62
 
63 63
 		return $filter;
@@ -73,10 +73,10 @@  discard block
 block discarded – undo
73 73
 	 */
74 74
 	public function createFilter()
75 75
 	{
76
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'stock' );
77
-		$search = $manager->createSearch( true );
76
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'stock');
77
+		$search = $manager->createSearch(true);
78 78
 
79
-		return $search->setSortations( [$search->sort( '+', 'stock.type.position' )] );
79
+		return $search->setSortations([$search->sort('+', 'stock.type.position')]);
80 80
 	}
81 81
 
82 82
 
@@ -87,9 +87,9 @@  discard block
 block discarded – undo
87 87
 	 * @return \Aimeos\MShop\Stock\Item\Iface Stock item including the referenced domains items
88 88
 	 * @since 2017.03
89 89
 	 */
90
-	public function getItem( $id )
90
+	public function getItem($id)
91 91
 	{
92
-		return \Aimeos\MShop\Factory::createManager( $this->getContext(), 'stock' )->getItem( $id, [], true );
92
+		return \Aimeos\MShop\Factory::createManager($this->getContext(), 'stock')->getItem($id, [], true);
93 93
 	}
94 94
 
95 95
 
@@ -101,8 +101,8 @@  discard block
 block discarded – undo
101 101
 	 * @return array Ordered list of stock items implementing \Aimeos\MShop\Stock\Item\Iface
102 102
 	 * @since 2017.03
103 103
 	 */
104
-	public function searchItems( \Aimeos\MW\Criteria\Iface $filter, &$total = null )
104
+	public function searchItems(\Aimeos\MW\Criteria\Iface $filter, &$total = null)
105 105
 	{
106
-		return \Aimeos\MShop\Factory::createManager( $this->getContext(), 'stock' )->searchItems( $filter, [], $total );
106
+		return \Aimeos\MShop\Factory::createManager($this->getContext(), 'stock')->searchItems($filter, [], $total);
107 107
 	}
108 108
 }
Please login to merge, or discard this patch.
controller/frontend/src/Controller/Frontend/Service/Standard.php 1 patch
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -35,14 +35,14 @@  discard block
 block discarded – undo
35 35
 	 * @param string[] $attributes List of attribute codes as keys and strings entered by the customer as value
36 36
 	 * @return string[] List of attributes codes as keys and error messages as values for invalid or missing values
37 37
 	 */
38
-	public function checkAttributes( $serviceId, array $attributes )
38
+	public function checkAttributes($serviceId, array $attributes)
39 39
 	{
40
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'service' );
40
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'service');
41 41
 
42
-		$item = $manager->getItem( $serviceId, [], true );
43
-		$provider = $manager->getProvider( $item, $item->getType() );
42
+		$item = $manager->getItem($serviceId, [], true);
43
+		$provider = $manager->getProvider($item, $item->getType());
44 44
 
45
-		return array_filter( $provider->checkConfigFE( $attributes ) );
45
+		return array_filter($provider->checkConfigFE($attributes));
46 46
 	}
47 47
 
48 48
 
@@ -53,12 +53,12 @@  discard block
 block discarded – undo
53 53
 	 * @param string[] $ref List of domain names whose items should be fetched too
54 54
 	 * @return \Aimeos\MShop\Service\Provider\Iface Service provider object
55 55
 	 */
56
-	public function getProvider( $serviceId, $ref = ['media', 'price', 'text'] )
56
+	public function getProvider($serviceId, $ref = ['media', 'price', 'text'])
57 57
 	{
58
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'service' );
59
-		$item = $manager->getItem( $serviceId, $ref, true );
58
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'service');
59
+		$item = $manager->getItem($serviceId, $ref, true);
60 60
 
61
-		return $manager->getProvider( $item, $item->getType() );
61
+		return $manager->getProvider($item, $item->getType());
62 62
 	}
63 63
 
64 64
 
@@ -69,26 +69,26 @@  discard block
 block discarded – undo
69 69
 	 * @param string[] $ref List of domain names whose items should be fetched too
70 70
 	 * @return \Aimeos\MShop\Service\Provider\Iface[] List of service IDs as keys and service provider objects as values
71 71
 	 */
72
-	public function getProviders( $type = null, $ref = ['media', 'price', 'text'] )
72
+	public function getProviders($type = null, $ref = ['media', 'price', 'text'])
73 73
 	{
74 74
 		$list = [];
75
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'service' );
75
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'service');
76 76
 
77
-		$search = $manager->createSearch( true );
78
-		$search->setSortations( [$search->sort( '+', 'service.type.position' ), $search->sort( '+', 'service.position' )] );
77
+		$search = $manager->createSearch(true);
78
+		$search->setSortations([$search->sort('+', 'service.type.position'), $search->sort('+', 'service.position')]);
79 79
 
80
-		if( $type != null )
80
+		if ($type != null)
81 81
 		{
82 82
 			$expr = array(
83 83
 				$search->getConditions(),
84
-				$search->compare( '==', 'service.type.code', $type ),
85
-				$search->compare( '==', 'service.type.domain', 'service' ),
84
+				$search->compare('==', 'service.type.code', $type),
85
+				$search->compare('==', 'service.type.domain', 'service'),
86 86
 			);
87
-			$search->setConditions( $search->combine( '&&', $expr ) );
87
+			$search->setConditions($search->combine('&&', $expr));
88 88
 		}
89 89
 
90
-		foreach( $manager->searchItems( $search, $ref ) as $id => $item ) {
91
-			$list[$id] = $manager->getProvider( $item, $item->getType() );
90
+		foreach ($manager->searchItems($search, $ref) as $id => $item) {
91
+			$list[$id] = $manager->getProvider($item, $item->getType());
92 92
 		}
93 93
 
94 94
 		return $list;
@@ -106,15 +106,15 @@  discard block
 block discarded – undo
106 106
 	 * @return \Aimeos\MShop\Common\Item\Helper\Form\Iface|null Form object with URL, parameters, etc.
107 107
 	 * 	or null if no form data is required
108 108
 	 */
109
-	public function process( \Aimeos\MShop\Order\Item\Iface $orderItem, $serviceId, array $urls, array $params )
109
+	public function process(\Aimeos\MShop\Order\Item\Iface $orderItem, $serviceId, array $urls, array $params)
110 110
 	{
111
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'service' );
112
-		$item = $manager->getItem( $serviceId, [], true );
111
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'service');
112
+		$item = $manager->getItem($serviceId, [], true);
113 113
 
114
-		$provider = $manager->getProvider( $item, $item->getType() );
115
-		$provider->injectGlobalConfigBE( $urls );
114
+		$provider = $manager->getProvider($item, $item->getType());
115
+		$provider->injectGlobalConfigBE($urls);
116 116
 
117
-		return $provider->process( $orderItem, $params );
117
+		return $provider->process($orderItem, $params);
118 118
 	}
119 119
 
120 120
 
@@ -126,14 +126,14 @@  discard block
 block discarded – undo
126 126
 	 * @param string $code Unique code of the service used for the current order
127 127
 	 * @return \Psr\Http\Message\ResponseInterface Response object
128 128
 	 */
129
-	public function updatePush( ServerRequestInterface $request, ResponseInterface $response, $code )
129
+	public function updatePush(ServerRequestInterface $request, ResponseInterface $response, $code)
130 130
 	{
131
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'service' );
132
-		$item = $manager->findItem( $code );
131
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'service');
132
+		$item = $manager->findItem($code);
133 133
 
134
-		$provider = $manager->getProvider( $item, $item->getType() );
134
+		$provider = $manager->getProvider($item, $item->getType());
135 135
 
136
-		return $provider->updatePush( $request, $response );
136
+		return $provider->updatePush($request, $response);
137 137
 	}
138 138
 
139 139
 
@@ -145,24 +145,24 @@  discard block
 block discarded – undo
145 145
 	 * @param string $orderid ID of the order whose payment status should be updated
146 146
 	 * @return \Aimeos\MShop\Order\Item\Iface $orderItem Order item that has been updated
147 147
 	 */
148
-	public function updateSync( ServerRequestInterface $request, $code, $orderid )
148
+	public function updateSync(ServerRequestInterface $request, $code, $orderid)
149 149
 	{
150 150
 		$context = $this->getContext();
151
-		$orderManager = \Aimeos\MShop\Factory::createManager( $context, 'order' );
152
-		$serviceManager = \Aimeos\MShop\Factory::createManager( $context, 'service' );
151
+		$orderManager = \Aimeos\MShop\Factory::createManager($context, 'order');
152
+		$serviceManager = \Aimeos\MShop\Factory::createManager($context, 'service');
153 153
 
154
-		$orderItem = $orderManager->getItem( $orderid );
155
-		$serviceItem = $serviceManager->findItem( $code );
154
+		$orderItem = $orderManager->getItem($orderid);
155
+		$serviceItem = $serviceManager->findItem($code);
156 156
 
157
-		$provider = $serviceManager->getProvider( $serviceItem, $serviceItem->getType() );
157
+		$provider = $serviceManager->getProvider($serviceItem, $serviceItem->getType());
158 158
 
159 159
 
160
-		if( ( $orderItem = $provider->updateSync( $request, $orderItem ) ) !== null )
160
+		if (($orderItem = $provider->updateSync($request, $orderItem)) !== null)
161 161
 		{
162
-			if( $orderItem->getPaymentStatus() === \Aimeos\MShop\Order\Item\Base::PAY_UNFINISHED
163
-				&& $provider->isImplemented( \Aimeos\MShop\Service\Provider\Payment\Base::FEAT_QUERY )
162
+			if ($orderItem->getPaymentStatus() === \Aimeos\MShop\Order\Item\Base::PAY_UNFINISHED
163
+				&& $provider->isImplemented(\Aimeos\MShop\Service\Provider\Payment\Base::FEAT_QUERY)
164 164
 			) {
165
-				$provider->query( $orderItem );
165
+				$provider->query($orderItem);
166 166
 			}
167 167
 		}
168 168
 
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( [$filter->sort( '+', 'attribute.type.position' ), $filter->sort( '+', 'attribute.position' )] );
63
+		$filter->setConditions($filter->combine('&&', $expr));
64
+		$filter->setSortations([$filter->sort('+', 'attribute.type.position'), $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( [$filter->sort( '+', 'attribute.type.position' ), $filter->sort( '+', 'attribute.position' )] );
102
+		$filter->setConditions($filter->combine('&&', $expr));
103
+		$filter->setSortations([$filter->sort('+', 'attribute.type.position'), $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.