Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into feature/get-tax-by-…
Browse files Browse the repository at this point in the history
…value
  • Loading branch information
jkniest committed Aug 22, 2023
2 parents 06e230e + 8f833b2 commit 1af6ae3
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 7 deletions.
11 changes: 9 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [unreleased]

## [Unreleased]
### Added
- Add new helper method to load a TaxEntity by its value.

## [2.2.1] - 2023-05-26
### Fixed
- Restored compatibility for Shopware 6.4 by removing typehints for **EntityRepository** in util classes.

## [2.2.0] - 2023-05-09
### Added
- Added tests for PHP 8.2
Expand Down Expand Up @@ -124,6 +128,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `getNotSpecifiedSalutationId`
- `getGermanCountryId`

[2.2.1]: https://github.com/basecom/FixturesPlugin/compare/2.2.0...2.2.1
[2.2.0]: https://github.com/basecom/FixturesPlugin/compare/2.1.0...2.2.0
[2.1.0]: https://github.com/basecom/FixturesPlugin/compare/2.0.0...2.1.0
[2.0.0]: https://github.com/basecom/FixturesPlugin/compare/1.8.0...2.0.0
[1.8.0]: https://github.com/basecom/FixturesPlugin/compare/1.7.0...1.8.0
[1.7.0]: https://github.com/basecom/FixturesPlugin/compare/1.6.0...1.7.0
Expand Down
9 changes: 9 additions & 0 deletions src/Resources/config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,12 @@ services:
Basecom\FixturePlugin\FixtureLoader:
arguments:
- !tagged_iterator basecom.fixture

Basecom\FixturePlugin\Utils\MediaUtils:
arguments:
$mediaRepository: '@media.repository'
$mediaFolderRepository: '@media_folder.repository'

Basecom\FixturePlugin\Utils\PaymentMethodUtils:
arguments:
$paymentMethodRepository: '@payment_method.repository'
25 changes: 22 additions & 3 deletions src/Utils/MediaUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,31 @@

class MediaUtils
{
private EntityRepository $mediaRepository;
private EntityRepository $mediaFolderRepository;
/**
* @TODO Replace with real typehint when Shopware 6.4 support is dropped.
*
* @var EntityRepository
*/
private $mediaRepository;

/**
* @TODO Replace with real typehint when Shopware 6.4 support is dropped.
*
* @var EntityRepository
*/
private $mediaFolderRepository;
private FileSaver $fileSaver;
private FileFetcher $fileFetcher;

public function __construct(EntityRepository $mediaRepository, EntityRepository $mediaFolderRepository, FileSaver $fileSaver, FileFetcher $fileFetcher)
/**
* @TODO Replace with real typehints when Shopware 6.4 support is dropped.
*
* @param EntityRepository $mediaRepository
* @param EntityRepository $mediaFolderRepository
*
* @noinspection PhpMissingParamTypeInspection We can not use typehints until repository decorators are removed (Shopware 6.5).
*/
public function __construct($mediaRepository, $mediaFolderRepository, FileSaver $fileSaver, FileFetcher $fileFetcher)
{
$this->mediaRepository = $mediaRepository;
$this->mediaFolderRepository = $mediaFolderRepository;
Expand Down
16 changes: 14 additions & 2 deletions src/Utils/PaymentMethodUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,21 @@

class PaymentMethodUtils
{
private EntityRepository $paymentMethodRepository;
/**
* @TODO Replace with real typehint when Shopware 6.4 support is dropped.
*
* @var EntityRepository
*/
private $paymentMethodRepository;

public function __construct(EntityRepository $paymentMethodRepository)
/**
* @TODO Replace with real typehint when Shopware 6.4 support is dropped.
*
* @param EntityRepository $paymentMethodRepository
*
* @noinspection PhpMissingParamTypeInspection We can not use typehints until PaymentMethodRepositoryDecorator is removed (Shopware 6.5).
*/
public function __construct($paymentMethodRepository)
{
$this->paymentMethodRepository = $paymentMethodRepository;
}
Expand Down

0 comments on commit 1af6ae3

Please sign in to comment.