Skip to content

Commit 59545dc

Browse files
author
Tyler King
authored
Update ShopModel trait to use ShopId interface for value object (gnikyt#643)
* Update ShopModel trait to use ShopId interface for value object * Update ShopModel interface to reference new ShopId interface * StyleCI fix
1 parent 713da8c commit 59545dc

File tree

4 files changed

+19
-6
lines changed

4 files changed

+19
-6
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
namespace Osiset\ShopifyApp\Contracts\Objects\Values;
4+
5+
use Funeralzone\ValueObjects\ValueObject;
6+
7+
/**
8+
* Shop ID's value object.
9+
*/
10+
interface ShopId extends ValueObject
11+
{
12+
}

src/ShopifyApp/Contracts/ShopModel.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use Osiset\ShopifyApp\Contracts\ApiHelper as IApiHelper;
1010
use Osiset\ShopifyApp\Contracts\Objects\Values\AccessToken as AccessTokenValue;
1111
use Osiset\ShopifyApp\Contracts\Objects\Values\ShopDomain as ShopDomainValue;
12-
use Osiset\ShopifyApp\Objects\Values\ShopId;
12+
use Osiset\ShopifyApp\Contracts\Objects\Values\ShopId as ShopIdValue;
1313

1414
/**
1515
* Reprecents the shop model.
@@ -19,9 +19,9 @@ interface ShopModel extends Authenticatable
1919
/**
2020
* Get shop ID as a value object.
2121
*
22-
* @return ShopId
22+
* @return ShopIdValue
2323
*/
24-
public function getId(): ShopId;
24+
public function getId(): ShopIdValue;
2525

2626
/**
2727
* Get shop domain as a value object.

src/ShopifyApp/Objects/Values/ShopId.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
namespace Osiset\ShopifyApp\Objects\Values;
44

55
use Funeralzone\ValueObjects\Scalars\IntegerTrait;
6-
use Funeralzone\ValueObjects\ValueObject;
6+
use Osiset\ShopifyApp\Contracts\Objects\Values\ShopId as ShopIdValue;
77

88
/**
99
* Value object for shop's ID.
1010
*/
11-
final class ShopId implements ValueObject
11+
final class ShopId implements ShopIdValue
1212
{
1313
use IntegerTrait;
1414
}

src/ShopifyApp/Traits/ShopModel.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Osiset\ShopifyApp\Contracts\ApiHelper as IApiHelper;
1111
use Osiset\ShopifyApp\Contracts\Objects\Values\AccessToken as AccessTokenValue;
1212
use Osiset\ShopifyApp\Contracts\Objects\Values\ShopDomain as ShopDomainValue;
13+
use Osiset\ShopifyApp\Contracts\Objects\Values\ShopId as ShopIdValue;
1314
use Osiset\ShopifyApp\Objects\Values\AccessToken;
1415
use Osiset\ShopifyApp\Objects\Values\ShopDomain;
1516
use Osiset\ShopifyApp\Objects\Values\ShopId;
@@ -47,7 +48,7 @@ protected static function bootShopModel(): void
4748
/**
4849
* {@inheritdoc}
4950
*/
50-
public function getId(): ShopId
51+
public function getId(): ShopIdValue
5152
{
5253
return ShopId::fromNative($this->id);
5354
}

0 commit comments

Comments
 (0)