Skip to content
Snippets Groups Projects

Add support for Drupal 11 and Commerce 3

Merged martinpe requested to merge 1.0.x-commerce3 into 1.0.x
Files
19
@@ -75,7 +75,7 @@ class CalculatedPrice extends DataProducerPluginBase implements ContainerFactory
ContainerInterface $container,
array $configuration,
$pluginId,
$pluginDefinition
$pluginDefinition,
) {
return new static(
$configuration,
@@ -113,7 +113,7 @@ class CalculatedPrice extends DataProducerPluginBase implements ContainerFactory
PriceCalculatorInterface $priceCalculator,
CurrentStoreInterface $currentStore,
AccountInterface $currentUser,
AdjustmentTypeManager $adjustmentTypeManager
AdjustmentTypeManager $adjustmentTypeManager,
) {
parent::__construct($configuration, $pluginId, $pluginDefinition);
$this->priceCalculator = $priceCalculator;
@@ -135,7 +135,7 @@ class CalculatedPrice extends DataProducerPluginBase implements ContainerFactory
* @return \Drupal\commerce_price\Price|null
* The resolved price of the purchasable entity, or NULL if not available.
*/
public function resolve(PurchasableEntityInterface $purchasableEntity, array $adjustmentTypes = NULL, FieldContext $field) {
public function resolve(PurchasableEntityInterface $purchasableEntity, ?array $adjustmentTypes = NULL, FieldContext $field) {
$context = new Context($this->currentUser, $this->currentStore->getStore(), NULL, []);
$adjustmentTypes = $this->mapAdjustmentTypes($adjustmentTypes ?? []);
Loading