@@ -79,16 +79,6 @@ public function getAddressFrom(): Address
7979 return new Address ($ email , $ name );
8080 }
8181
82- /**
83- * Gets the application service.
84- *
85- * @throws \LogicException if the service can not be found
86- */
87- public function getApplication (): ApplicationService
88- {
89- return $ this ->getUserService ()->getApplication ();
90- }
91-
9282 /**
9383 * Gets the application name and version.
9484 */
@@ -105,18 +95,28 @@ public function getApplicationOwnerUrl(): string
10595 return $ this ->getParameterString ('app_owner_url ' );
10696 }
10797
98+ /**
99+ * Gets the application service.
100+ *
101+ * @throws \LogicException if the service cannot be found
102+ */
103+ public function getApplicationService (): ApplicationService
104+ {
105+ return $ this ->getUserService ()->getApplication ();
106+ }
107+
108108 /**
109109 * Gets the minimum margin, in percent, for a calculation.
110110 */
111111 public function getMinMargin (): float
112112 {
113- return $ this ->getApplication ()->getMinMargin ();
113+ return $ this ->getApplicationService ()->getMinMargin ();
114114 }
115115
116116 /**
117117 * Gets the request stack.
118118 *
119- * @throws \LogicException if the service can not be found
119+ * @throws \LogicException if the service cannot be found
120120 *
121121 * @psalm-suppress MixedAssignment
122122 * @psalm-suppress MixedReturnStatement
@@ -137,17 +137,18 @@ public function getRequestStack(): RequestStack
137137
138138 public static function getSubscribedServices (): array
139139 {
140- return \array_merge (parent ::getSubscribedServices (), [
140+ return [
141+ ...parent ::getSubscribedServices (),
141142 UserService::class,
142143 TranslatorInterface::class,
143144 UrlGeneratorService::class,
144- ]) ;
145+ ];
145146 }
146147
147148 /**
148149 * Gets the translator.
149150 *
150- * @throws \LogicException if the service can not be found
151+ * @throws \LogicException if the service cannot be found
151152 */
152153 public function getTranslator (): TranslatorInterface
153154 {
@@ -165,7 +166,7 @@ public function getTranslator(): TranslatorInterface
165166 /**
166167 * Gets the URL generator service.
167168 *
168- * @throws \LogicException if the service can not be found
169+ * @throws \LogicException if the service cannot be found
169170 */
170171 public function getUrlGenerator (): UrlGeneratorService
171172 {
@@ -193,7 +194,7 @@ public function getUserIdentifier(): ?string
193194 /**
194195 * Gets the user service.
195196 *
196- * @throws \LogicException if the service can not be found
197+ * @throws \LogicException if the service cannot be found
197198 */
198199 public function getUserService (): UserService
199200 {
@@ -209,7 +210,7 @@ public function getUserService(): UserService
209210 }
210211
211212 /**
212- * Display a message, if not empty; and redirect to the home page.
213+ * Display a message, if not empty, and redirect to the home page.
213214 *
214215 * If the request is not null, and the caller parameter is set, redirect to it.
215216 */
@@ -316,7 +317,7 @@ protected function jsonException(\Exception $e, ?string $message = null): JsonRe
316317 }
317318
318319 /**
319- * Returns a Json response with false as result.
320+ * Returns a Json response with false as the result.
320321 *
321322 * @param array $data the data to merge within the response
322323 */
@@ -326,7 +327,7 @@ protected function jsonFalse(array $data = []): JsonResponse
326327 }
327328
328329 /**
329- * Returns a Json response with true as result.
330+ * Returns a Json response with true as the result.
330331 *
331332 * @param array $data the data to merge within the response
332333 */
0 commit comments