-
Notifications
You must be signed in to change notification settings - Fork 7
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
Conversation
69ea290
to
1de9e9a
Compare
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()) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
->addUserMerge(UserMerge::mergeInto('target-user-id', 'source-user-id'), time()) | |
->addUserMerge(UserMerge::mergeInto('target-user-id', 'source-user-id', time())) |
396b624
to
6d35eec
Compare
No description provided.