Skip to content

Commit

Permalink
Merge branch '5.4' into 6.0
Browse files Browse the repository at this point in the history
* 5.4:
  prevent the installation of unstable phpdocumentor/type-resolver releases
  chore: fix typo 'do' verb
  [Twig Bridge] Add PHPdoc information to some email methods
  Amend MoneyType twig to include a space.
  [WebProfilerBundle] Remove redundant code from logger template
  • Loading branch information
xabbuh committed Dec 4, 2022
2 parents 5a0b963 + 4f3bc60 commit f7770a3
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 7 deletions.
13 changes: 13 additions & 0 deletions Mime/WrappedTemplatedEmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ public function toName(): string
return $this->message->getTo()[0]->getName();
}

/**
* @param string $image A Twig path to the image file. It's recommended to define
* some Twig namespace for email images (e.g. '@email/images/logo.png').
* @param string|null $contentType The media type (i.e. MIME type) of the image file (e.g. 'image/png').
* Some email clients require this to display embedded images.
*/
public function image(string $image, string $contentType = null): string
{
$file = $this->twig->getLoader()->getSourceContext($image);
Expand All @@ -47,6 +53,13 @@ public function image(string $image, string $contentType = null): string
return 'cid:'.$image;
}

/**
* @param string $file A Twig path to the file. It's recommended to define
* some Twig namespace for email files (e.g. '@email/files/contract.pdf').
* @param string|null $name A custom file name that overrides the original name of the attached file.
* @param string|null $contentType The media type (i.e. MIME type) of the file (e.g. 'application/pdf').
* Some email clients require this to display attached files.
*/
public function attach(string $file, string $name = null, string $contentType = null): void
{
$file = $this->twig->getLoader()->getSourceContext($file);
Expand Down
2 changes: 1 addition & 1 deletion Resources/views/Form/bootstrap_4_layout.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{%- set prepend = not (money_pattern starts with '{{') -%}
{%- set append = not (money_pattern ends with '}}') -%}
{%- if prepend or append -%}
<div class="input-group{{ group_class|default('') }}">
<div class="input-group {{ group_class|default('') }}">
{%- if prepend -%}
<div class="input-group-prepend">
<span class="input-group-text">{{ money_pattern|form_encode_currency }}</span>
Expand Down
2 changes: 1 addition & 1 deletion Resources/views/Form/bootstrap_5_layout.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{%- set prepend = not (money_pattern starts with '{{') -%}
{%- set append = not (money_pattern ends with '}}') -%}
{%- if prepend or append -%}
<div class="input-group{{ group_class|default('') }}">
<div class="input-group {{ group_class|default('') }}">
{%- if prepend -%}
<span class="input-group-text">{{ money_pattern|form_encode_currency }}</span>
{%- endif -%}
Expand Down
2 changes: 1 addition & 1 deletion Resources/views/Form/bootstrap_base_layout.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{% set prepend = not (money_pattern starts with '{{') %}
{% set append = not (money_pattern ends with '}}') %}
{% if prepend or append %}
<div class="input-group{{ group_class|default('') }}">
<div class="input-group {{ group_class|default('') }}">
{% if prepend %}
<span class="input-group-addon">{{ money_pattern|form_encode_currency }}</span>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion Tests/Extension/AbstractBootstrap4LayoutTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1165,7 +1165,7 @@ public function testMoney()

$this->assertWidgetMatchesXpath($form->createView(), ['id' => 'my&id', 'attr' => ['class' => 'my&class']],
'/div
[@class="input-group"]
[@class="input-group "]
[
./div
[@class="input-group-prepend"]
Expand Down
2 changes: 1 addition & 1 deletion Tests/Extension/AbstractBootstrap5LayoutTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1450,7 +1450,7 @@ public function testMoney()

$this->assertWidgetMatchesXpath($form->createView(), ['id' => 'my&id', 'attr' => ['class' => 'my&class']],
'/div
[@class="input-group"]
[@class="input-group "]
[
./span
[@class="input-group-text"]
Expand Down
2 changes: 1 addition & 1 deletion Tests/Extension/FormExtensionBootstrap4LayoutTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public function testMoneyWidgetInIso()
;

$this->assertSame(<<<'HTML'
<div class="input-group"><div class="input-group-prepend">
<div class="input-group "><div class="input-group-prepend">
<span class="input-group-text">&euro; </span>
</div><input type="text" id="name" name="name" required="required" class="form-control" /></div>
HTML
Expand Down
2 changes: 1 addition & 1 deletion Tests/Extension/FormExtensionBootstrap5LayoutTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public function testMoneyWidgetInIso()
->createView();

self::assertSame(<<<'HTML'
<div class="input-group"><span class="input-group-text">&euro; </span><input type="text" id="name" name="name" required="required" class="form-control" /></div>
<div class="input-group "><span class="input-group-text">&euro; </span><input type="text" id="name" name="name" required="required" class="form-control" /></div>
HTML
, trim($this->renderWidget($view)));
}
Expand Down

0 comments on commit f7770a3

Please sign in to comment.