Skip to content

Commit

Permalink
Change timestamps from int to float
Browse files Browse the repository at this point in the history
  • Loading branch information
joshdifabio committed Oct 31, 2017
1 parent badc06d commit d963bfe
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/AttributeDataSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public function with(AttributeData $attributeData): self
return $result;
}

public function mapToSaveCommands(int $timestamp): array
public function mapToSaveCommands(float $timestamp): array
{
return \array_map(function (AttributeData $attributeData) use ($timestamp) {
return SaveAttributeCommand::of($attributeData)->withTimestamp($timestamp);
Expand Down
2 changes: 1 addition & 1 deletion src/AttributeOptionSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function with(AttributeOption $attributeOption): self
return $result;
}

public function mapToSaveCommands(int $timestamp): array
public function mapToSaveCommands(float $timestamp): array
{
return \array_map(function (AttributeOption $attributeOption) use ($timestamp) {
return SaveAttributeOptionCommand::of($attributeOption)->withTimestamp($timestamp);
Expand Down
2 changes: 1 addition & 1 deletion src/CategoryDataSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public function with(CategoryData $categoryData): self
return $result;
}

public function mapToSaveCommands(int $timestamp): array
public function mapToSaveCommands(float $timestamp): array
{
return \array_map(function (CategoryData $categoryData) use ($timestamp) {
return SaveCategoryCommand::of($categoryData)->withTimestamp($timestamp);
Expand Down
5 changes: 2 additions & 3 deletions src/Command/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@

abstract class Command
{
public function getTimestamp(): ?int
public function getTimestamp(): ?float
{
return $this->timestamp;
}

/**
* @param int $timestamp
* @return static
*/
public function withTimestamp(int $timestamp)
public function withTimestamp(float $timestamp)
{
$entity = clone $this;
$entity->timestamp = $timestamp;
Expand Down
2 changes: 1 addition & 1 deletion src/ProductDataSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public function with(ProductData $productData): self
return $result;
}

public function mapToSaveCommands(int $timestamp): array
public function mapToSaveCommands(float $timestamp): array
{
return \array_map(function (ProductData $productData) use ($timestamp) {
return SaveProductCommand::of($productData)->withTimestamp($timestamp);
Expand Down
2 changes: 1 addition & 1 deletion src/VariantDataSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public function with(VariantData $variantData): self
return $result;
}

public function mapToSaveCommands(int $timestamp): array
public function mapToSaveCommands(float $timestamp): array
{
return \array_map(function (VariantData $variantData) use ($timestamp) {
return SaveVariantCommand::of($variantData)->withTimestamp($timestamp);
Expand Down

0 comments on commit d963bfe

Please sign in to comment.