Skip to content

Commit

Permalink
Add new item property type geolocation
Browse files Browse the repository at this point in the history
  • Loading branch information
jirinovak committed Sep 27, 2018
1 parent 90c3031 commit 288087d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
<!-- There is always Unreleased section on the top. Subsections (Added, Changed, Fixed, Removed) should be added as needed. -->

## Unreleased
### Added
- New item property type `geolocation`

## 2.1.0 - 2018-09-21
### Fixed
Expand Down
2 changes: 2 additions & 0 deletions src/Model/Command/Constants/PropertyType.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* @method static PropertyType BOOLEAN()
* @method static PropertyType TIMESTAMP()
* @method static PropertyType SET()
* @method static PropertyType GEOLOCATION()
*/
final class PropertyType extends Enum
{
Expand All @@ -20,4 +21,5 @@ final class PropertyType extends Enum
public const BOOLEAN = 'boolean';
public const TIMESTAMP = 'timestamp';
public const SET = 'set';
public const GEOLOCATION = 'geolocation';
}
6 changes: 6 additions & 0 deletions src/Model/Command/ItemPropertySetup.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ public static function set(string $propertyName): self
return new static($propertyName, PropertyType::SET());
}

/** @return static */
public static function geolocation(string $propertyName): self
{
return new static($propertyName, PropertyType::GEOLOCATION());
}

protected function setPropertyName(string $propertyName): void
{
Assertion::typeIdentifier($propertyName);
Expand Down
1 change: 1 addition & 0 deletions tests/unit/Model/Command/ItemPropertySetupTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public function provideConstructorName(): array
['boolean', PropertyType::BOOLEAN],
['timestamp', PropertyType::TIMESTAMP],
['set', PropertyType::SET],
['geolocation', PropertyType::GEOLOCATION],
];
}
}

0 comments on commit 288087d

Please sign in to comment.