diff --git a/src/Resources/config/services.yml b/src/Resources/config/services.yml index a22e277..94b2888 100644 --- a/src/Resources/config/services.yml +++ b/src/Resources/config/services.yml @@ -5,3 +5,7 @@ services: - '@event_dispatcher' - '@cca.translator.contao_translator' public: true + # For internal use only but has to be public as the widget can't use dependency injection :( + cca.dc-general.contao_frontend.filesystem: + alias: 'filesystem' + public: true diff --git a/src/Widgets/UploadOnSteroids.php b/src/Widgets/UploadOnSteroids.php index bb0eb75..9d01acb 100644 --- a/src/Widgets/UploadOnSteroids.php +++ b/src/Widgets/UploadOnSteroids.php @@ -95,7 +95,7 @@ class UploadOnSteroids extends FormUpload protected $strPrefix = 'widget widget-upload widget-upload-on-steroids'; /** - * Image sizes as serialisized string. + * Image sizes as serialized string. * * @var string */ @@ -579,20 +579,20 @@ private function addFiles($sortBy): void /** * Translate. * - * @param string $transId The message id (may also be an object that can be cast to string). - * @param array $parameters An array of parameters for the message. - * @param string|null $domain The domain for the message or null to use the default. - * @param string|null $locale The locale or null to use the default. + * @param string $strId The message id (may also be an object that can be cast to string). + * @param array $arrParams An array of parameters for the message. + * @param string $strDomain The domain for the message or null to use the default. + * @param string $locale The locale or null to use the default. * * @return string */ public function trans( - string $transId, - array $parameters = [], - ?string $domain = 'contao_default', - ?string $locale = null + $strId, + array $arrParams = [], + $strDomain = 'contao_default', + $locale = null ): string { - return $this->translator()->trans($transId, $parameters, $domain, $locale); + return $this->translator()->trans($strId, $arrParams, $strDomain, $locale); } /** @@ -643,7 +643,7 @@ private function addIsMultiple(): void private function getCurrentRequest(): ?Request { - $requestStack = \Contao\System::getContainer()->get('request_stack'); + $requestStack = System::getContainer()->get('request_stack'); if (!$requestStack instanceof RequestStack) { return null; } @@ -674,7 +674,7 @@ private function filesModel(): Adapter private function filesystem(): Filesystem { if (null === $this->filesystem) { - $filesystem = self::getContainer()->get('filesystem'); + $filesystem = self::getContainer()->get('cca.dc-general.contao_frontend.filesystem'); assert($filesystem instanceof Filesystem); $this->filesystem = $filesystem; }