Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
jkniest committed Jun 14, 2024
1 parent dc169ab commit 5027b85
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added new DatabaseUtils with a few helpful methods:
- `deleteEntities` takes an entity name and criteria and deletes all entities which match the criteria
- Added a small cache for all utilities. It prevents loading data twice within the same request / command execution
- Added small helper function: `$fixtureHelper->ensureNotEmpty` which throws an exception if something is empty (using the PHP empty function)

### Changed
- Changed argument type on `SalesChannelUtils::getTax()` from `int` to `float`
Expand All @@ -29,6 +30,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- **Breaking** Moved `SalesChannelUtils::getCountry()` to `LanguageAndLocaleUtils::getCountry()`
- **Breaking** Moved `SalesChannelUtils::getSnippetSet()` to `LanguageAndLocaleUtils::getSnippetSet()`
- **Breaking** Moved `SalesChannelUtils::getCurrencyEuro()` to `CurrencyUtils::getCurrencyEuro()`
- **Breaking** Moved `SalesChannelUtils::getTax19()` to `TaxUtils::getTax19()`
- **Breaking** Moved `SalesChannelUtils::getTax()` to `TaxUtils::getTax()`

### Removed
- Dropped support for PHP 8.1
Expand Down
10 changes: 10 additions & 0 deletions src/FixtureHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@ public function __construct(
) {
}

/**
* @phpstan-assert !empty $something
*/
public function ensureNotEmpty(mixed $something): void
{
if (empty($something)) {
throw new \LogicException('Expected parameter not to be empty, but it was.');
}
}

/**
* Use this to access the media related features
* of the fixture helper class.
Expand Down

0 comments on commit 5027b85

Please sign in to comment.