Completed
Branch FET-8209-allow-multiple-carts (2a6979)
by
unknown
64:27 queued 54:01
created
core/libraries/repositories/EE_Object_Collection.core.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@  discard block
 block discarded – undo
3 3
 
4 4
 use EventEspresso\core\interfaces\EEI_Collection;
5 5
 
6
-if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
7
-	exit( 'No direct script access allowed' );
6
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
7
+	exit('No direct script access allowed');
8 8
 }
9 9
 /**
10 10
  * Class EE_Object_Collection
@@ -42,9 +42,9 @@  discard block
 block discarded – undo
42 42
 	 * @param ObjectInfoStrategyInterface $object_info_strategy
43 43
 	 * @param string                      $interface
44 44
 	 */
45
-	function __construct( ObjectInfoStrategyInterface $object_info_strategy = null, $interface = '' ) {
45
+	function __construct(ObjectInfoStrategyInterface $object_info_strategy = null, $interface = '') {
46 46
 		// so that object info strategy can access objects, rewind, etc
47
-		$object_info_strategy->setCollection( $this );
47
+		$object_info_strategy->setCollection($this);
48 48
 		$this->object_info_strategy = $object_info_strategy instanceof ObjectInfoStrategyInterface
49 49
 			? $object_info_strategy
50 50
 			: new ObjectInfoSingleKeyStrategy();
@@ -65,14 +65,14 @@  discard block
 block discarded – undo
65 65
 	 * @param mixed $info
66 66
 	 * @return bool
67 67
 	 */
68
-	public function add( $object, $info = null ) {
68
+	public function add($object, $info = null) {
69 69
 		$class = $this->interface;
70
-		if ( ! $object instanceof $class ) {
70
+		if ( ! $object instanceof $class) {
71 71
 			return false;
72 72
 		}
73
-		$this->attach( $object );
74
-		$this->set_info( $object, $info );
75
-		return $this->contains( $object );
73
+		$this->attach($object);
74
+		$this->set_info($object, $info);
75
+		return $this->contains($object);
76 76
 	}
77 77
 
78 78
 
@@ -88,8 +88,8 @@  discard block
 block discarded – undo
88 88
 	 * @param mixed $info
89 89
 	 * @return bool
90 90
 	 */
91
-	public function set_info( $object, $info = null ) {
92
-		return call_user_func_array( array( $this->object_info_strategy, 'setObjectInfo' ), array( $object, $info ) );
91
+	public function set_info($object, $info = null) {
92
+		return call_user_func_array(array($this->object_info_strategy, 'setObjectInfo'), array($object, $info));
93 93
 	}
94 94
 
95 95
 
@@ -104,8 +104,8 @@  discard block
 block discarded – undo
104 104
 	 * @param mixed
105 105
 	 * @return null | object
106 106
 	 */
107
-	public function get_by_info( $info ) {
108
-		return call_user_func_array( array( $this->object_info_strategy, 'getObjectByInfo' ), array( $info ) );
107
+	public function get_by_info($info) {
108
+		return call_user_func_array(array($this->object_info_strategy, 'getObjectByInfo'), array($info));
109 109
 	}
110 110
 
111 111
 
@@ -119,8 +119,8 @@  discard block
 block discarded – undo
119 119
 	 * @param object $object
120 120
 	 * @return bool
121 121
 	 */
122
-	public function has( $object ) {
123
-		return $this->contains( $object );
122
+	public function has($object) {
123
+		return $this->contains($object);
124 124
 	}
125 125
 
126 126
 
@@ -134,8 +134,8 @@  discard block
 block discarded – undo
134 134
 	 * @param $object
135 135
 	 * @return void
136 136
 	 */
137
-	public function remove( $object ) {
138
-		$this->detach( $object );
137
+	public function remove($object) {
138
+		$this->detach($object);
139 139
 	}
140 140
 
141 141
 
@@ -149,10 +149,10 @@  discard block
 block discarded – undo
149 149
 	 * @param $object
150 150
 	 * @return void
151 151
 	 */
152
-	public function set_current( $object ) {
152
+	public function set_current($object) {
153 153
 		$this->rewind();
154
-		while ( $this->valid() ) {
155
-			if ( $this->current() === $object ) {
154
+		while ($this->valid()) {
155
+			if ($this->current() === $object) {
156 156
 				break;
157 157
 			}
158 158
 			$this->next();
@@ -170,8 +170,8 @@  discard block
 block discarded – undo
170 170
 	 * @param $info
171 171
 	 * @return void
172 172
 	 */
173
-	public function set_current_by_info( $info ) {
174
-		call_user_func_array( array( $this->object_info_strategy, 'setCurrentByInfo' ), array( $info ) );
173
+	public function set_current_by_info($info) {
174
+		call_user_func_array(array($this->object_info_strategy, 'setCurrentByInfo'), array($info));
175 175
 	}
176 176
 
177 177
 
Please login to merge, or discard this patch.
core/services/cart/CartItem.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@  discard block
 block discarded – undo
4 4
 use EventEspresso\Core;
5 5
 use EventEspresso\Core\Libraries\Repositories\EE_Object_Collection;
6 6
 
7
-if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
8
-	exit( 'No direct script access allowed' );
7
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
8
+	exit('No direct script access allowed');
9 9
 }
10 10
 
11 11
 
@@ -45,17 +45,17 @@  discard block
 block discarded – undo
45 45
 
46 46
 
47 47
 
48
-	public function __construct( Cart $cart ) {
48
+	public function __construct(Cart $cart) {
49 49
 		$this->setCreated();
50 50
 		$this->cart = $cart;
51
-		$this->cartItemOptions = new EE_Object_Collection( null, 'CartItemOption' );
51
+		$this->cartItemOptions = new EE_Object_Collection(null, 'CartItemOption');
52 52
 	}
53 53
 
54 54
 
55 55
 
56 56
 	abstract public function generateSKU();
57 57
 
58
-	abstract public function validateItem( $item );
58
+	abstract public function validateItem($item);
59 59
 
60 60
 	abstract public function calculatePrice();
61 61
 
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 	 * @access protected
68 68
 	 */
69 69
 	protected function setCreated() {
70
-		$this->created = new \DateTime( 'now', new \DateTimeZone( 'UTC' ) );
70
+		$this->created = new \DateTime('now', new \DateTimeZone('UTC'));
71 71
 	}
72 72
 
73 73
 
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 	 * @return string
77 77
 	 */
78 78
 	public function SKU() {
79
-		if ( empty( $this->SKU ) ) {
79
+		if (empty($this->SKU)) {
80 80
 			$this->SKU = $this->generateFullSKU();
81 81
 		}
82 82
 		return $this->SKU;
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 	 * @return object
89 89
 	 */
90 90
 	final public function getItem() {
91
-		return $this->validateItem( $this->item );
91
+		return $this->validateItem($this->item);
92 92
 	}
93 93
 
94 94
 
@@ -114,8 +114,8 @@  discard block
 block discarded – undo
114 114
 	/**
115 115
 	 * @param int $quantity
116 116
 	 */
117
-	public function setQuantity( $quantity = 1 ) {
118
-		$this->quantity = absint( $quantity );
117
+	public function setQuantity($quantity = 1) {
118
+		$this->quantity = absint($quantity);
119 119
 	}
120 120
 
121 121
 
@@ -132,8 +132,8 @@  discard block
 block discarded – undo
132 132
 	/**
133 133
 	 * @param CartItemOption $cartItemOption
134 134
 	 */
135
-	public function addCartItemOption ( CartItemOption $cartItemOption ) {
136
-		$this->cartItemOptions->add( $cartItemOption, $cartItemOption->SKU() );
135
+	public function addCartItemOption(CartItemOption $cartItemOption) {
136
+		$this->cartItemOptions->add($cartItemOption, $cartItemOption->SKU());
137 137
 	}
138 138
 
139 139
 
@@ -148,10 +148,10 @@  discard block
 block discarded – undo
148 148
 	protected function generateFullSKU() {
149 149
 		$SKU = array();
150 150
 		$SKU[] = $this->generateSKU();
151
-		foreach ( $this->cartItemOptions as $cartItemOption ) {
151
+		foreach ($this->cartItemOptions as $cartItemOption) {
152 152
 			$SKU[] = $cartItemOption->SKU();
153 153
 		}
154
-		return md5( implode( '.', $SKU ));
154
+		return md5(implode('.', $SKU));
155 155
 	}
156 156
 
157 157
 
Please login to merge, or discard this patch.