Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a26bd36

Browse files
Merge branch '4.1'
* 4.1: [Debug] Fix false-positive "MicroKernelTrait::loadRoutes()" method is considered internal" [Console] Fixed boxed table style with colspan parse numbers terminated with decimal separator fail reverse transforming invalid RFC 3339 dates
2 parents 7ae5722 + 0e47775 commit a26bd36

File tree

11 files changed

+309
-209
lines changed

11 files changed

+309
-209
lines changed

UPGRADE-4.2.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ FrameworkBundle
101101
* Added support for the SameSite attribute for session cookies. It is highly recommended to set this setting (`framework.session.cookie_samesite`) to `lax` for increased security against CSRF attacks.
102102
* The `Controller` class has been deprecated, use `AbstractController` instead.
103103
* The Messenger encoder/decoder configuration has been changed for a unified Messenger serializer configuration.
104-
104+
105105
Before:
106106
```yaml
107107
framework:
@@ -126,29 +126,29 @@ Messenger
126126
* `EnvelopeItemInterface` doesn't extend `Serializable` anymore
127127
* The `handle` method of the `Symfony\Component\Messenger\Middleware\ValidationMiddleware` and `Symfony\Component\Messenger\Asynchronous\Middleware\SendMessageMiddleware` middlewares now requires an `Envelope` object to be given (because they implement the `EnvelopeAwareInterface`). When using these middleware with the provided `MessageBus`, you will not have to do anything. If you use the middlewares any other way, you can use `Envelope::wrap($message)` to create an envelope for your message.
128128
* `MessageSubscriberInterface::getHandledMessages()` return value has changed. The value of an array item
129-
needs to be an associative array or the method name.
130-
129+
needs to be an associative array or the method name.
130+
131131
Before:
132132
```php
133133
return [
134134
[FirstMessage::class, 0],
135135
[SecondMessage::class, -10],
136136
];
137137
```
138-
138+
139139
After:
140140
```php
141141
yield FirstMessage::class => ['priority' => 0];
142142
yield SecondMessage::class => ['priority => -10];
143143
```
144-
144+
145145
Before:
146146
```php
147147
return [
148148
SecondMessage::class => ['secondMessageMethod', 20],
149149
];
150150
```
151-
151+
152152
After:
153153
```php
154154
yield SecondMessage::class => [
@@ -158,7 +158,6 @@ Messenger
158158
```
159159
* The `EncoderInterface` and `DecoderInterface` interfaces have been replaced by a unified `Symfony\Component\Messenger\Transport\Serialization\SerializerInterface`.
160160
Each interface method have been merged untouched into the `Serializer` interface, so you can simply merge your two implementations together and implement the new interface.
161-
162161

163162
Monolog
164163
-------

src/Symfony/Component/Console/Helper/Table.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -717,13 +717,13 @@ private function calculateColumnsWidth(iterable $rows)
717717
$lengths[] = $this->getCellWidth($row, $column);
718718
}
719719

720-
$this->effectiveColumnWidths[$column] = max($lengths) + \strlen($this->style->getCellRowContentFormat()) - 2;
720+
$this->effectiveColumnWidths[$column] = max($lengths) + Helper::strlen($this->style->getCellRowContentFormat()) - 2;
721721
}
722722
}
723723

724724
private function getColumnSeparatorWidth(): int
725725
{
726-
return \strlen(sprintf($this->style->getBorderFormat(), $this->style->getBorderChars()[3]));
726+
return Helper::strlen(sprintf($this->style->getBorderFormat(), $this->style->getBorderChars()[3]));
727727
}
728728

729729
private function getCellWidth(array $row, int $column): int

src/Symfony/Component/Console/Tests/Helper/TableTest.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,6 +1077,42 @@ public function testColumnMaxWidths()
10771077
$this->assertEquals($expected, $this->getOutputContent($output));
10781078
}
10791079

1080+
public function testBoxedStyleWithColspan()
1081+
{
1082+
$boxed = new TableStyle();
1083+
$boxed
1084+
->setHorizontalBorderChars('')
1085+
->setVerticalBorderChars('')
1086+
->setCrossingChars('', '', '', '', '', '', '', '', '')
1087+
;
1088+
1089+
$table = new Table($output = $this->getOutputStream());
1090+
$table->setStyle($boxed);
1091+
$table
1092+
->setHeaders(array('ISBN', 'Title', 'Author'))
1093+
->setRows(array(
1094+
array('99921-58-10-7', 'Divine Comedy', 'Dante Alighieri'),
1095+
new TableSeparator(),
1096+
array(new TableCell('This value spans 3 columns.', array('colspan' => 3))),
1097+
))
1098+
;
1099+
$table->render();
1100+
1101+
$expected =
1102+
<<<TABLE
1103+
┌───────────────┬───────────────┬─────────────────┐
1104+
│ ISBN │ Title │ Author │
1105+
├───────────────┼───────────────┼─────────────────┤
1106+
│ 99921-58-10-7 │ Divine Comedy │ Dante Alighieri │
1107+
├───────────────┼───────────────┼─────────────────┤
1108+
│ This value spans 3 columns. │
1109+
└───────────────┴───────────────┴─────────────────┘
1110+
1111+
TABLE;
1112+
1113+
$this->assertSame($expected, $this->getOutputContent($output));
1114+
}
1115+
10801116
protected function getOutputStream($decorated = false)
10811117
{
10821118
return new StreamOutput($this->stream, StreamOutput::VERBOSITY_NORMAL, $decorated);

0 commit comments

Comments
 (0)