Skip to content

Commit 4b64e71

Browse files
committed
Merge branch '4.4' into 5.0
* 4.4: Add missing use statements [Translation] Add missing use statement [Translation] Add missing use statement [Config][XmlReferenceDumper] Prevent potential \TypeError [Mailer] Fix broken mandrill http send for recipients with names [Translation] prefer intl domain when adding messages to catalogue Fix CS Fix CS Fail on empty password verification (without warning on any implementation) [Translation][Debug] Add installation and minimal example to README [Validator] try to call __get method if property is uninitialized Show both missing packages in the same error message Fix handling of empty_data's \Closure value in Date/Time form types
2 parents 39cc296 + 0cf976a commit 4b64e71

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Mime/NotificationEmail.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,17 @@ class NotificationEmail extends TemplatedEmail
4141

4242
public function __construct(Headers $headers = null, AbstractPart $body = null)
4343
{
44+
$missingPackages = [];
4445
if (!class_exists(CssInlinerExtension::class)) {
45-
throw new \LogicException(sprintf('You cannot use "%s" if the CSS Inliner Twig extension is not available; try running "composer require twig/cssinliner-extra".', static::class));
46+
$missingPackages['twig/cssinliner-extra'] = ' CSS Inliner';
4647
}
4748

4849
if (!class_exists(InkyExtension::class)) {
49-
throw new \LogicException(sprintf('You cannot use "%s" if the Inky Twig extension is not available; try running "composer require twig/inky-extra".', static::class));
50+
$missingPackages['twig/inky-extra'] = 'Inky';
51+
}
52+
53+
if ($missingPackages) {
54+
throw new \LogicException(sprintf('You cannot use "%s" if the %s Twig extension%s not available; try running "composer require %s".', static::class, implode(' and ', $missingPackages), \count($missingPackages) > 1 ? 's are' : ' is', implode(' ', array_keys($missingPackages))));
5055
}
5156

5257
parent::__construct($headers, $body);

0 commit comments

Comments
 (0)