11<?php
2- /************************************************************************
3- *
4- * Copyright 2024 Adobe
5- * All Rights Reserved.
6- *
7- * NOTICE: All information contained herein is, and remains
8- * the property of Adobe and its suppliers, if any. The intellectual
9- * and technical concepts contained herein are proprietary to Adobe
10- * and its suppliers and are protected by all applicable intellectual
11- * property laws, including trade secret and copyright laws.
12- * Dissemination of this information or reproduction of this material
13- * is strictly forbidden unless prior written permission is obtained
14- * from Adobe.
15- * ************************************************************************
2+ /**
3+ * Copyright © Magento, Inc. All rights reserved.
4+ * See COPYING.txt for license details.
165 */
176declare (strict_types=1 );
187
2211use Magento \Framework \App \ResourceConnection ;
2312use Magento \Framework \DataObject ;
2413use Magento \Framework \Locale \FormatInterface ;
25- use Magento \TestFramework \Fixture \Api \ServiceFactory ;
2614use Magento \TestFramework \Fixture \RevertibleDataFixtureInterface ;
2715
2816/**
@@ -36,9 +24,9 @@ class CurrencyRate implements RevertibleDataFixtureInterface
3624 private $ format ;
3725
3826 /**
39- * @var ServiceFactory
27+ * @var Currency
4028 */
41- private $ serviceFactory ;
29+ private $ currency ;
4230
4331 /**
4432 * @var ResourceConnection
@@ -47,11 +35,11 @@ class CurrencyRate implements RevertibleDataFixtureInterface
4735
4836 public function __construct (
4937 FormatInterface $ format ,
50- ServiceFactory $ serviceFactory ,
38+ Currency $ currency ,
5139 ResourceConnection $ resourceConnection
5240 ) {
5341 $ this ->format = $ format ;
54- $ this ->serviceFactory = $ serviceFactory ;
42+ $ this ->currency = $ currency ;
5543 $ this ->resourceConnection = $ resourceConnection ;
5644 }
5745
@@ -64,9 +52,7 @@ public function apply(array $data = []): ?DataObject
6452 $ data [$ currencyCode ][$ currencyTo ] = $ value ;
6553 }
6654 }
67- $ service = $ this ->serviceFactory ->create (Currency::class, 'saveRates ' );
68-
69- return $ service ->execute (['rates ' => $ data ]);
55+ $ this ->currency ->saveRates ($ data );
7056 }
7157 }
7258
0 commit comments