File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed
Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change 33namespace hiqdev \php \billing \product ;
44
55use hiqdev \php \billing \product \behavior \InvalidBehaviorException ;
6- use hiqdev \php \billing \product \Domain \Model \TariffTypeInterface ;
76use hiqdev \php \billing \product \Exception \AggregateNotFoundException ;
87use hiqdev \php \billing \product \Exception \BillingRegistryLockedException ;
9- use hiqdev \php \billing \product \Exception \TariffTypeDefinitionNotFoundException ;
108use hiqdev \php \billing \product \invoice \InvalidRepresentationException ;
119use hiqdev \php \billing \product \invoice \RepresentationInterface ;
1210use hiqdev \php \billing \product \price \PriceTypeDefinition ;
@@ -183,14 +181,15 @@ public function getAggregate(string $type): AggregateInterface
183181 throw new AggregateNotFoundException ('Aggregate was not found ' );
184182 }
185183
186- public function findTariffTypeDefinition (TariffTypeInterface $ tariffType ): TariffTypeDefinitionInterface
184+ /**
185+ * @return \Generator
186+ * @psalm-return \Generator<TariffTypeDefinitionInterface>
187+ */
188+ public function getTariffTypeDefinitions (): \Generator
187189 {
188190 foreach ($ this ->tariffTypeDefinitions as $ tariffTypeDefinition ) {
189- if ($ tariffTypeDefinition ->tariffType () === $ tariffType ) {
190- return $ tariffTypeDefinition ;
191- }
191+ // TODO: endure that it would not be changed
192+ yield $ tariffTypeDefinition ;
192193 }
193-
194- throw new TariffTypeDefinitionNotFoundException ('Tariff type definition was not found ' );
195194 }
196195}
You can’t perform that action at this time.
0 commit comments