File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -89,7 +89,6 @@ public function __construct(
8989 $ this ->plan = $ plan ;
9090 $ this ->charges = $ charges ;
9191 $ this ->state = $ state ;
92- $ this ->setUsageInterval (UsageInterval::wholeMonth ($ time ));
9392 }
9493
9594 /**
@@ -111,9 +110,18 @@ public function getUniqueString(): string
111110
112111 public function getUsageInterval (): UsageInterval
113112 {
113+ if ($ this ->usageInterval === null ) {
114+ $ this ->initializeWholeMonthUsageInterval ();
115+ }
116+
114117 return $ this ->usageInterval ;
115118 }
116119
120+ private function initializeWholeMonthUsageInterval (): void
121+ {
122+ $ this ->setUsageInterval (UsageInterval::wholeMonth ($ this ->time ));
123+ }
124+
117125 public function calculatePrice ()
118126 {
119127 $ quantity = $ this ->quantity ->getQuantity ();
You can’t perform that action at this time.
0 commit comments