Skip to content

Commit

Permalink
Moved some files and minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Zonneveld committed Feb 13, 2023
1 parent 36d7ce4 commit 7c74764
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/Mappers/ContactIdentifiers/ContactIdentifierMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class ContactIdentifierMapper
public function map(stdClass $data): ContactIdentifier
{
$contact = null;

if (property_exists($data, 'contact') && $data->contact != null) {
$contactMapper = new ContactMapper();
$contact = $contactMapper->map($data->contact);
Expand All @@ -23,7 +24,7 @@ public function map(stdClass $data): ContactIdentifier
return new ContactIdentifier(
$data->value,
$data->active ?? null,
$data->name ?? '',
$data->name ?? null,
$contact
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Mappers/Contacts/AttributeMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function map(stdClass $data): Attribute
$options[] = get_object_vars($item);
}
}

return new Attribute(
$data->name,
$data->label,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ class RewardAttributeMapper
public function map(stdClass $rewardAttribute): RewardAttribute
{
$fieldType = $rewardAttribute->type;

$isSoftReadOnly = property_exists($rewardAttribute, 'is_soft_read_only') && $rewardAttribute->is_soft_read_only;
$isHardReadOnly = property_exists($rewardAttribute, 'is_hard_read_only') && $rewardAttribute->is_hard_read_only;
$isPiggyDefined = property_exists($rewardAttribute, 'is_piggy_defined') && $rewardAttribute->is_piggy_defined;

$options = null;
if (property_exists($rewardAttribute, 'options') && $rewardAttribute->options != null) {
$options = [];

if (property_exists($rewardAttribute, 'options') && $rewardAttribute->options != null) {
foreach ($rewardAttribute->options as $item) {
$options[] = get_object_vars($item);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class RewardAttributesMapper
public function map(array $data): array
{
$rewardAttributeMapper = new RewardAttributeMapper;

$rewardAttributes = [];

foreach ($data as $item) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Piggy\Api\Tests\OAuth\ContactAttributes;
namespace Piggy\Api\Tests\OAuth\Contacts;

use Piggy\Api\Exceptions\PiggyRequestException;
use Piggy\Api\Tests\OAuthTestCase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Piggy\Api\Tests\OAuth\ContactIdentifiers;
namespace Piggy\Api\Tests\OAuth\Contacts;

use Piggy\Api\Exceptions\PiggyRequestException;
use Piggy\Api\Tests\OAuthTestCase;
Expand Down

0 comments on commit 7c74764

Please sign in to comment.