File tree Expand file tree Collapse file tree 4 files changed +22
-35
lines changed
Expand file tree Collapse file tree 4 files changed +22
-35
lines changed Original file line number Diff line number Diff line change 2525
2626class CustomerOptionFactory implements CustomerOptionFactoryInterface
2727{
28- /**
29- * @var RepositoryInterface
30- */
31- private $ customerOptionGroupRepository ;
28+ /** @var RepositoryInterface */
29+ protected $ customerOptionGroupRepository ;
3230
33- /**
34- * @var \Faker\Generator
35- */
36- private $ faker ;
37- /**
38- * @var CustomerOptionValueFactoryInterface
39- */
40- private $ customerOptionValueFactory ;
31+ /** @var \Faker\Generator */
32+ protected $ faker ;
33+
34+ /** @var CustomerOptionValueFactoryInterface */
35+ protected $ customerOptionValueFactory ;
4136
4237 public function __construct (
4338 CustomerOptionGroupRepositoryInterface $ customerOptionGroupRepository ,
@@ -86,7 +81,7 @@ public function createFromConfig(array $configuration): CustomerOptionInterface
8681 {
8782 $ this ->validateConfiguration ($ configuration );
8883
89- $ customerOption = new CustomerOption ();
84+ $ customerOption = $ this -> createNew ();
9085 $ customerOption ->setCode ($ configuration ['code ' ]);
9186
9287 foreach ($ configuration ['translations ' ] as $ locale => $ name ) {
Original file line number Diff line number Diff line change 3232class CustomerOptionGroupFactory implements CustomerOptionGroupFactoryInterface
3333{
3434 /** @var CustomerOptionRepositoryInterface */
35- private $ customerOptionRepository ;
35+ protected $ customerOptionRepository ;
3636
3737 /** @var ProductRepositoryInterface */
38- private $ productRepository ;
38+ protected $ productRepository ;
3939
4040 /** @var \Faker\Generator */
41- private $ faker ;
41+ protected $ faker ;
4242
4343 public function __construct (
4444 CustomerOptionRepositoryInterface $ customerOptionRepository ,
@@ -95,7 +95,7 @@ public function createFromConfig(array $options): CustomerOptionGroupInterface
9595 $ options = array_merge ($ this ->getOptionsSkeleton (), $ options );
9696 Assert::minCount ($ options ['translations ' ], 1 );
9797
98- $ customerOptionGroup = new CustomerOptionGroup ();
98+ $ customerOptionGroup = $ this -> createNew ();
9999
100100 $ customerOptionGroup ->setCode ($ options ['code ' ]);
101101
Original file line number Diff line number Diff line change 2020
2121class CustomerOptionValueFactory implements CustomerOptionValueFactoryInterface
2222{
23- /**
24- * @var CustomerOptionValuePriceFactoryInterface
25- */
26- private $ valuePriceFactory ;
23+ /** @var CustomerOptionValuePriceFactoryInterface */
24+ protected $ valuePriceFactory ;
2725
28- /**
29- * @var Generator
30- */
31- private $ faker ;
26+ /** @var Generator */
27+ protected $ faker ;
3228
3329 public function __construct (CustomerOptionValuePriceFactoryInterface $ valuePriceFactory )
3430 {
@@ -60,7 +56,7 @@ public function validateConfiguration(array $configuration): void
6056 /** {@inheritdoc} */
6157 public function createFromConfig (array $ configuration ): CustomerOptionValueInterface
6258 {
63- $ value = new CustomerOptionValue ();
59+ $ value = $ this -> createNew ();
6460 $ value ->setCode ($ configuration ['code ' ]);
6561
6662 foreach ($ configuration ['translations ' ] as $ locale => $ name ) {
Original file line number Diff line number Diff line change 2323
2424class CustomerOptionValuePriceFactory implements CustomerOptionValuePriceFactoryInterface
2525{
26- /**
27- * @var ChannelRepositoryInterface
28- */
29- private $ channelRepository ;
26+ /** @var ChannelRepositoryInterface */
27+ protected $ channelRepository ;
3028
31- /**
32- * @var Generator
33- */
34- private $ faker ;
29+ /** @var Generator */
30+ protected $ faker ;
3531
3632 public function __construct (ChannelRepositoryInterface $ channelRepository )
3733 {
@@ -58,7 +54,7 @@ public function createFromConfig(array $configuration): CustomerOptionValuePrice
5854 {
5955 $ this ->validateConfiguration ($ configuration );
6056
61- $ price = new CustomerOptionValuePrice ();
57+ $ price = $ this -> createNew ();
6258
6359 switch ($ configuration ['type ' ]) {
6460 case 'fixed ' :
You can’t perform that action at this time.
0 commit comments