Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge Command supports optional timestamp argument. #136

Merged
merged 2 commits into from
Aug 19, 2021

Conversation

JakubTesarek
Copy link
Contributor

No description provided.

@JakubTesarek JakubTesarek force-pushed the jt@add_optional_merge_timestamp branch from 69ea290 to 1de9e9a Compare August 17, 2021 08:46
README.md Outdated
@@ -175,7 +175,7 @@ $response = $matej->request()
->addItemProperty(ItemProperty::create('item-id', ['valid_from' => time(), 'title' => 'Title']))
->addItemProperties([/* array of ItemProperty objects */])
// Merge user
->addUserMerge(UserMerge::mergeInto('target-user-id', 'source-user-id'))
->addUserMerge(UserMerge::mergeInto('target-user-id', 'source-user-id'), time())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this case with time() as the value should be in the example - this replicates the default behavior (time() is used if no other value is provided), so this exact implementation is not useful. Maybe put there some other value and mention the current timestamp is used if no other value is given?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added whole section about merging. I don't go over details as they are described in matej documentation.

@@ -12,12 +12,13 @@ public function shouldGenerateCorrectSignature(): void
{
$sourceUserId = 'source-user';
$targetUserId = 'target-user';
$timestamp = time();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use some static value instead of time(), which is the same as the default one - to make sure the setters actually sets the value. This test would pass even it the timestamp value would not be given to the constructors.

README.md Outdated
@@ -175,7 +175,7 @@ $response = $matej->request()
->addItemProperty(ItemProperty::create('item-id', ['valid_from' => time(), 'title' => 'Title']))
->addItemProperties([/* array of ItemProperty objects */])
// Merge user
->addUserMerge(UserMerge::mergeInto('target-user-id', 'source-user-id'))
->addUserMerge(UserMerge::mergeInto('target-user-id', 'source-user-id'), time())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
->addUserMerge(UserMerge::mergeInto('target-user-id', 'source-user-id'), time())
->addUserMerge(UserMerge::mergeInto('target-user-id', 'source-user-id', time()))

@JakubTesarek JakubTesarek force-pushed the jt@add_optional_merge_timestamp branch from 396b624 to 6d35eec Compare August 19, 2021 10:36
@JakubTesarek JakubTesarek merged commit aeebc9b into main Aug 19, 2021
@OndraM OndraM deleted the jt@add_optional_merge_timestamp branch November 19, 2021 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants