Skip to content

Commit 90da024

Browse files
author
Alex Westergaard
committed
Add types and accept NULL for remove - except items
1 parent 2725b65 commit 90da024

27 files changed

+178
-178
lines changed

src/Event/AddPaymentInfo.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88

99
class AddPaymentInfo extends Model\Event implements Facade\AddPaymentInfo
1010
{
11-
protected $currency;
12-
protected $value;
13-
protected $coupon;
14-
protected $payment_type;
15-
protected $items = [];
11+
protected null|string $currency;
12+
protected null|int|float $value;
13+
protected null|string $coupon;
14+
protected null|string $payment_type;
15+
protected array $items = [];
1616

1717
public function getName(): string
1818
{
@@ -48,25 +48,25 @@ public function getRequiredParams(): array
4848
return $return;
4949
}
5050

51-
public function setCurrency(string $iso)
51+
public function setCurrency(null|string $iso)
5252
{
5353
$this->currency = $iso;
5454
return $this;
5555
}
5656

57-
public function setValue(int|float $val)
57+
public function setValue(null|int|float $val)
5858
{
5959
$this->value = $val;
6060
return $this;
6161
}
6262

63-
public function setCoupon(string $code)
63+
public function setCoupon(null|string $code)
6464
{
6565
$this->coupon = $code;
6666
return $this;
6767
}
6868

69-
public function setPaymentType(string $type)
69+
public function setPaymentType(null|string $type)
7070
{
7171
$this->payment_type = $type;
7272
return $this;

src/Event/AddShippingInfo.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88

99
class AddShippingInfo extends Model\Event implements Facade\AddShippingInfo
1010
{
11-
protected $currency;
12-
protected $value;
13-
protected $coupon;
14-
protected $shipping_tier;
15-
protected $items = [];
11+
protected null|string $currency;
12+
protected null|int|float $value;
13+
protected null|string $coupon;
14+
protected null|string $shipping_tier;
15+
protected array $items = [];
1616

1717
public function getName(): string
1818
{
@@ -48,25 +48,25 @@ public function getRequiredParams(): array
4848
return $return;
4949
}
5050

51-
public function setCurrency(string $iso)
51+
public function setCurrency(null|string $iso)
5252
{
5353
$this->currency = $iso;
5454
return $this;
5555
}
5656

57-
public function setValue(int|float $val)
57+
public function setValue(null|int|float $val)
5858
{
5959
$this->value = $val;
6060
return $this;
6161
}
6262

63-
public function setCoupon(string $code)
63+
public function setCoupon(null|string $code)
6464
{
6565
$this->coupon = $code;
6666
return $this;
6767
}
6868

69-
public function setShippingTier(string $tier)
69+
public function setShippingTier(null|string $tier)
7070
{
7171
$this->shipping_tier = $tier;
7272
return $this;

src/Event/AddToCart.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
class AddToCart extends Model\Event implements Facade\AddToCart
1010
{
11-
protected $currency;
12-
protected $value;
13-
protected $items = [];
11+
protected null|string $currency;
12+
protected null|int|float $value;
13+
protected array $items = [];
1414

1515
public function getName(): string
1616
{
@@ -44,13 +44,13 @@ public function getRequiredParams(): array
4444
return $return;
4545
}
4646

47-
public function setCurrency(string $iso)
47+
public function setCurrency(null|string $iso)
4848
{
4949
$this->currency = $iso;
5050
return $this;
5151
}
5252

53-
public function setValue(int|float $val)
53+
public function setValue(null|int|float $val)
5454
{
5555
$this->value = $val;
5656
return $this;

src/Event/AddToWishlist.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
class AddToWishlist extends Model\Event implements Facade\AddToWishlist
1010
{
11-
protected $currency;
12-
protected $value;
13-
protected $items = [];
11+
protected null|string $currency;
12+
protected null|int|float $value;
13+
protected array $items = [];
1414

1515
public function getName(): string
1616
{
@@ -44,13 +44,13 @@ public function getRequiredParams(): array
4444
return $return;
4545
}
4646

47-
public function setCurrency(string $iso)
47+
public function setCurrency(null|string $iso)
4848
{
4949
$this->currency = $iso;
5050
return $this;
5151
}
5252

53-
public function setValue(int|float $val)
53+
public function setValue(null|int|float $val)
5454
{
5555
$this->value = $val;
5656
return $this;

src/Event/BeginCheckout.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88

99
class BeginCheckout extends Model\Event implements Facade\BeginCheckout
1010
{
11-
protected $currency;
12-
protected $value;
13-
protected $coupon;
14-
protected $items = [];
11+
protected null|string $currency;
12+
protected null|int|float $value;
13+
protected null|string $coupon;
14+
protected array $items = [];
1515

1616
public function getName(): string
1717
{
@@ -46,19 +46,19 @@ public function getRequiredParams(): array
4646
return $return;
4747
}
4848

49-
public function setCurrency(string $iso)
49+
public function setCurrency(null|string $iso)
5050
{
5151
$this->currency = $iso;
5252
return $this;
5353
}
5454

55-
public function setValue(int|float $val)
55+
public function setValue(null|int|float $val)
5656
{
5757
$this->value = $val;
5858
return $this;
5959
}
6060

61-
public function setCoupon(string $code)
61+
public function setCoupon(null|string $code)
6262
{
6363
$this->coupon = 0 + $code;
6464
return $this;

src/Event/EarnVirtualCurrency.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
class EarnVirtualCurrency extends Model\Event implements Facade\EarnVirtualCurrency
99
{
10-
protected $virtual_currency_name;
11-
protected $value;
10+
protected null|string $virtual_currency_name;
11+
protected null|int|float $value;
1212

1313
public function getName(): string
1414
{
@@ -28,13 +28,13 @@ public function getRequiredParams(): array
2828
return [];
2929
}
3030

31-
public function setVirtualCurrencyName(string $name)
31+
public function setVirtualCurrencyName(null|string $name)
3232
{
3333
$this->virtual_currency_name = $name;
3434
return $this;
3535
}
3636

37-
public function setValue(int|float $num)
37+
public function setValue(null|int|float $num)
3838
{
3939
$this->value = $num;
4040
return $this;

src/Event/GenerateLead.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
class GenerateLead extends Model\Event implements Facade\GenerateLead
99
{
10-
protected $currency;
11-
protected $value;
10+
protected null|string $currency;
11+
protected null|int|float $value;
1212

1313
public function getName(): string
1414
{
@@ -40,13 +40,13 @@ public function getRequiredParams(): array
4040
return $return;
4141
}
4242

43-
public function setCurrency(string $iso)
43+
public function setCurrency(null|string $iso)
4444
{
4545
$this->currency = $iso;
4646
return $this;
4747
}
4848

49-
public function setValue(int|float $val)
49+
public function setValue(null|int|float $val)
5050
{
5151
$this->value = $val;
5252
return $this;

src/Event/JoinGroup.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
namespace AlexWestergaard\PhpGa4\Event;
44

5-
use AlexWestergaard\PhpGa4\Facade;
65
use AlexWestergaard\PhpGa4\Model;
6+
use AlexWestergaard\PhpGa4\Facade;
77

88
class JoinGroup extends Model\Event implements Facade\JoinGroup
99
{
10-
protected $group_id;
10+
protected null|string $group_id;
1111

1212
public function getName(): string
1313
{
@@ -26,7 +26,7 @@ public function getRequiredParams(): array
2626
return [];
2727
}
2828

29-
public function setGroupId(string $id)
29+
public function setGroupId(null|string $id)
3030
{
3131
$this->group_id = $id;
3232
return $this;

src/Event/LevelUp.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
namespace AlexWestergaard\PhpGa4\Event;
44

5-
use AlexWestergaard\PhpGa4\Facade;
65
use AlexWestergaard\PhpGa4\Model;
6+
use AlexWestergaard\PhpGa4\Facade;
77

88
class LevelUp extends Model\Event implements Facade\LevelUp
99
{
10-
protected $level;
11-
protected $character;
10+
protected null|int $level;
11+
protected null|string $character;
1212

1313
public function getName(): string
1414
{
@@ -28,13 +28,13 @@ public function getRequiredParams(): array
2828
return [];
2929
}
3030

31-
public function setLevel(int $lvl)
31+
public function setLevel(null|int $lvl)
3232
{
3333
$this->level = $lvl;
3434
return $this;
3535
}
3636

37-
public function setCharacter(string $char)
37+
public function setCharacter(null|string $char)
3838
{
3939
$this->character = $char;
4040
return $this;

src/Event/Login.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
namespace AlexWestergaard\PhpGa4\Event;
44

5-
use AlexWestergaard\PhpGa4\Facade;
65
use AlexWestergaard\PhpGa4\Model;
6+
use AlexWestergaard\PhpGa4\Facade;
77

88
class Login extends Model\Event implements Facade\Login
99
{
10-
protected $method;
10+
protected null|string $method;
1111

1212
public function getName(): string
1313
{
@@ -26,7 +26,7 @@ public function getRequiredParams(): array
2626
return [];
2727
}
2828

29-
public function setMethod(string $method)
29+
public function setMethod(null|string $method)
3030
{
3131
$this->method = $method;
3232
return $this;

0 commit comments

Comments
 (0)