From 108d436c2af470858bdaba3257baab3a74172017 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 8 Oct 2024 09:23:06 +0200 Subject: [PATCH 1/2] minor #58472 CS: clean some whitespaces/indentation (keradus) This PR was squashed before being merged into the 7.2 branch. Discussion ---------- CS: clean some whitespaces/indentation | Q | A | ------------- | --- | Branch? | 7.2 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | Fix CS | License | MIT Commits ------- d0f63b8afa1 CS: clean some whitespaces/indentation --- Tests/Helper/TableTest.php | 322 ++++++++++++++++++------------------- 1 file changed, 161 insertions(+), 161 deletions(-) diff --git a/Tests/Helper/TableTest.php b/Tests/Helper/TableTest.php index e7822a456..b41c65a2c 100644 --- a/Tests/Helper/TableTest.php +++ b/Tests/Helper/TableTest.php @@ -102,7 +102,7 @@ public static function renderProvider() ['ISBN', 'Title', 'Author'], $books, 'default', -<<<'TABLE' + <<<'TABLE' +---------------+--------------------------+------------------+ | ISBN | Title | Author | +---------------+--------------------------+------------------+ @@ -191,7 +191,7 @@ public static function renderProvider() ['80-902734-1-6', 'And Then There Were None', 'Agatha Christie'], ], 'default', -<<<'TABLE' + <<<'TABLE' +---------------+--------------------------+------------------+ | ISBN | Title | | +---------------+--------------------------+------------------+ @@ -212,7 +212,7 @@ public static function renderProvider() ['80-902734-1-6', 'And Then There Were None', 'Agatha Christie'], ], 'default', -<<<'TABLE' + <<<'TABLE' +---------------+--------------------------+------------------+ | 99921-58-10-7 | Divine Comedy | Dante Alighieri | | 9971-5-0210-0 | | | @@ -231,7 +231,7 @@ public static function renderProvider() ['960-425-059-0', 'The Lord of the Rings', "J. R. R.\nTolkien"], ], 'default', -<<<'TABLE' + <<<'TABLE' +---------------+----------------------------+-----------------+ | ISBN | Title | Author | +---------------+----------------------------+-----------------+ @@ -251,7 +251,7 @@ public static function renderProvider() ['ISBN', 'Title'], [], 'default', -<<<'TABLE' + <<<'TABLE' +------+-------+ | ISBN | Title | +------+-------+ @@ -271,7 +271,7 @@ public static function renderProvider() ['9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens'], ], 'default', -<<<'TABLE' + <<<'TABLE' +---------------+----------------------+-----------------+ | ISBN | Title | Author | +---------------+----------------------+-----------------+ @@ -288,7 +288,7 @@ public static function renderProvider() ['9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens'], ], 'default', -<<<'TABLE' + <<<'TABLE' +----------------------------------+----------------------+-----------------+ | ISBN | Title | Author | +----------------------------------+----------------------+-----------------+ @@ -320,7 +320,7 @@ public static function renderProvider() ], ], 'default', -<<<'TABLE' + <<<'TABLE' +-------------------------------+-------------------------------+-----------------------------+ | ISBN | Title | Author | +-------------------------------+-------------------------------+-----------------------------+ @@ -347,7 +347,7 @@ public static function renderProvider() ], ], 'default', -<<<'TABLE' + <<<'TABLE' +-----+-----+-----+ | Foo | Bar | Baz | +-----+-----+-----+ @@ -366,7 +366,7 @@ public static function renderProvider() ], ], 'default', -<<<'TABLE' + <<<'TABLE' +-----+-----+------+ | Foo | Bar | Baz | +-----+-----+------+ @@ -392,7 +392,7 @@ public static function renderProvider() ['80-902734-1-7', 'Test'], ], 'default', -<<<'TABLE' + <<<'TABLE' +---------------+---------------+-----------------+ | ISBN | Title | Author | +---------------+---------------+-----------------+ @@ -425,7 +425,7 @@ public static function renderProvider() ['J. R. R'], ], 'default', -<<<'TABLE' + <<<'TABLE' +------------------+---------+-----------------+ | ISBN | Title | Author | +------------------+---------+-----------------+ @@ -460,7 +460,7 @@ public static function renderProvider() ], ], 'default', -<<<'TABLE' + <<<'TABLE' +-----------------+-------+-----------------+ | ISBN | Title | Author | +-----------------+-------+-----------------+ @@ -497,7 +497,7 @@ public static function renderProvider() ['Charles Dickens'], ], 'default', -<<<'TABLE' + <<<'TABLE' +-----------------+-------+-----------------+ | ISBN | Title | Author | +-----------------+-------+-----------------+ @@ -524,7 +524,7 @@ public static function renderProvider() ['Charles Dickens'], ], 'default', -<<<'TABLE' + <<<'TABLE' +---------------+-----------------+ | ISBN | Author | +---------------+-----------------+ @@ -542,7 +542,7 @@ public static function renderProvider() ], [], 'default', -<<<'TABLE' + <<<'TABLE' +------+-------+--------+ | Main title | +------+-------+--------+ @@ -560,9 +560,9 @@ public static function renderProvider() new TableCell('3', ['colspan' => 2]), new TableCell('4', ['colspan' => 2]), ], - ], + ], 'default', -<<<'TABLE' + <<<'TABLE' +---+--+--+---+--+---+--+---+--+ | 1 | 2 | 3 | 4 | +---+--+--+---+--+---+--+---+--+ @@ -595,7 +595,7 @@ public static function renderProvider() +-----------------+------------------+---------+ TABLE - , + , true, ], 'Row with formatted cells containing a newline' => [ @@ -607,7 +607,7 @@ public static function renderProvider() new TableSeparator(), [ 'foo', - new TableCell('Dont break'."\n".'here', ['rowspan' => 2]), + new TableCell('Dont break'."\n".'here', ['rowspan' => 2]), ], [ 'bar', @@ -624,77 +624,77 @@ public static function renderProvider() +-------+------------+ TABLE - , + , true, ], 'TabeCellStyle with align. Also with rowspan and colspan > 1' => [ - [ - new TableCell( - 'ISBN', - [ - 'style' => new TableCellStyle([ - 'align' => 'right', - ]), - ] - ), - 'Title', - new TableCell( - 'Author', - [ - 'style' => new TableCellStyle([ - 'align' => 'center', - ]), - ] - ), - ], - [ - [ - new TableCell( - '978', - [ - 'style' => new TableCellStyle([ - 'align' => 'center', - ]), - ] - ), - 'De Monarchia', - new TableCell( - "Dante Alighieri \nspans multiple rows rows Dante Alighieri \nspans multiple rows rows", - [ - 'rowspan' => 2, - 'style' => new TableCellStyle([ - 'align' => 'center', - ]), - ] - ), - ], - [ - '99921-58-10-7', - 'Divine Comedy', - ], - new TableSeparator(), - [ - new TableCell( - 'test', - [ - 'colspan' => 2, - 'style' => new TableCellStyle([ - 'align' => 'center', - ]), - ] - ), - new TableCell( - 'tttt', - [ - 'style' => new TableCellStyle([ - 'align' => 'right', - ]), - ] - ), - ], - ], - 'default', -<<<'TABLE' + [ + new TableCell( + 'ISBN', + [ + 'style' => new TableCellStyle([ + 'align' => 'right', + ]), + ] + ), + 'Title', + new TableCell( + 'Author', + [ + 'style' => new TableCellStyle([ + 'align' => 'center', + ]), + ] + ), + ], + [ + [ + new TableCell( + '978', + [ + 'style' => new TableCellStyle([ + 'align' => 'center', + ]), + ] + ), + 'De Monarchia', + new TableCell( + "Dante Alighieri \nspans multiple rows rows Dante Alighieri \nspans multiple rows rows", + [ + 'rowspan' => 2, + 'style' => new TableCellStyle([ + 'align' => 'center', + ]), + ] + ), + ], + [ + '99921-58-10-7', + 'Divine Comedy', + ], + new TableSeparator(), + [ + new TableCell( + 'test', + [ + 'colspan' => 2, + 'style' => new TableCellStyle([ + 'align' => 'center', + ]), + ] + ), + new TableCell( + 'tttt', + [ + 'style' => new TableCellStyle([ + 'align' => 'right', + ]), + ] + ), + ], + ], + 'default', + <<<'TABLE' +---------------+---------------+-------------------------------------------+ | ISBN | Title | Author | +---------------+---------------+-------------------------------------------+ @@ -706,66 +706,66 @@ public static function renderProvider() +---------------+---------------+-------------------------------------------+ TABLE - , - ], + , + ], 'TabeCellStyle with fg,bg. Also with rowspan and colspan > 1' => [ [], [ - [ - new TableCell( - '978', - [ - 'style' => new TableCellStyle([ - 'fg' => 'black', - 'bg' => 'green', - ]), - ] - ), - 'De Monarchia', - new TableCell( - "Dante Alighieri \nspans multiple rows rows Dante Alighieri \nspans multiple rows rows", - [ - 'rowspan' => 2, - 'style' => new TableCellStyle([ - 'fg' => 'red', - 'bg' => 'green', - 'align' => 'center', - ]), - ] - ), - ], - - [ - '99921-58-10-7', - 'Divine Comedy', - ], - new TableSeparator(), - [ - new TableCell( - 'test', - [ - 'colspan' => 2, - 'style' => new TableCellStyle([ - 'fg' => 'red', - 'bg' => 'green', - 'align' => 'center', - ]), - ] - ), - new TableCell( - 'tttt', - [ - 'style' => new TableCellStyle([ - 'fg' => 'red', - 'bg' => 'green', - 'align' => 'right', - ]), - ] - ), - ], + [ + new TableCell( + '978', + [ + 'style' => new TableCellStyle([ + 'fg' => 'black', + 'bg' => 'green', + ]), + ] + ), + 'De Monarchia', + new TableCell( + "Dante Alighieri \nspans multiple rows rows Dante Alighieri \nspans multiple rows rows", + [ + 'rowspan' => 2, + 'style' => new TableCellStyle([ + 'fg' => 'red', + 'bg' => 'green', + 'align' => 'center', + ]), + ] + ), + ], + + [ + '99921-58-10-7', + 'Divine Comedy', + ], + new TableSeparator(), + [ + new TableCell( + 'test', + [ + 'colspan' => 2, + 'style' => new TableCellStyle([ + 'fg' => 'red', + 'bg' => 'green', + 'align' => 'center', + ]), + ] + ), + new TableCell( + 'tttt', + [ + 'style' => new TableCellStyle([ + 'fg' => 'red', + 'bg' => 'green', + 'align' => 'right', + ]), + ] + ), + ], ], 'default', -<<<'TABLE' + <<<'TABLE' +---------------+---------------+-------------------------------------------+ | 978 | De Monarchia | Dante Alighieri | | 99921-58-10-7 | Divine Comedy | spans multiple rows rows Dante Alighieri | @@ -775,9 +775,9 @@ public static function renderProvider() +---------------+---------------+-------------------------------------------+ TABLE - , - true, - ], + , + true, + ], 'TabeCellStyle with cellFormat. Also with rowspan and colspan > 1' => [ [ new TableCell( @@ -820,7 +820,7 @@ public static function renderProvider() ], ], 'default', -<<<'TABLE' + <<<'TABLE' +----------------+---------------+---------------------+ | ISBN | Title | Author | +----------------+---------------+---------------------+ @@ -832,7 +832,7 @@ public static function renderProvider() TABLE , true, - ], + ], ]; } @@ -1289,7 +1289,7 @@ public static function renderSetTitle() TABLE , true, - ], + ], 'header contains multiple lines' => [ 'Multiline'."\n".'header'."\n".'here', 'footer', @@ -1559,18 +1559,18 @@ public function testWithColspanAndMaxWith() $table->setColumnMaxWidth(1, 15); $table->setColumnMaxWidth(2, 15); $table->setRows([ - [new TableCell('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor', ['colspan' => 3])], - new TableSeparator(), - [new TableCell('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor', ['colspan' => 3])], - new TableSeparator(), - [new TableCell('Lorem ipsum dolor sit amet, consectetur ', ['colspan' => 2]), 'hello world'], - new TableSeparator(), - ['hello world', new TableCell('Lorem ipsum dolor sit amet, consectetur adipiscing elit', ['colspan' => 2])], - new TableSeparator(), - ['hello ', new TableCell('world', ['colspan' => 1]), 'Lorem ipsum dolor sit amet, consectetur'], - new TableSeparator(), - ['Symfony ', new TableCell('Test', ['colspan' => 1]), 'Lorem ipsum dolor sit amet, consectetur'], - ]) + [new TableCell('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor', ['colspan' => 3])], + new TableSeparator(), + [new TableCell('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor', ['colspan' => 3])], + new TableSeparator(), + [new TableCell('Lorem ipsum dolor sit amet, consectetur ', ['colspan' => 2]), 'hello world'], + new TableSeparator(), + ['hello world', new TableCell('Lorem ipsum dolor sit amet, consectetur adipiscing elit', ['colspan' => 2])], + new TableSeparator(), + ['hello ', new TableCell('world', ['colspan' => 1]), 'Lorem ipsum dolor sit amet, consectetur'], + new TableSeparator(), + ['Symfony ', new TableCell('Test', ['colspan' => 1]), 'Lorem ipsum dolor sit amet, consectetur'], + ]) ; $table->render(); From fb0d4760e7147d81ab4d9e2d57d56268261b4e4e Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Tue, 5 Nov 2024 10:27:50 +0100 Subject: [PATCH 2/2] fix detecting anonymous exception classes on Windows and PHP 7 --- Application.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Application.php b/Application.php index fbb3b0eb0..1a7e50388 100644 --- a/Application.php +++ b/Application.php @@ -858,7 +858,7 @@ protected function doRenderThrowable(\Throwable $e, OutputInterface $output): vo } if (str_contains($message, "@anonymous\0")) { - $message = preg_replace_callback('/[a-zA-Z_\x7f-\xff][\\\\a-zA-Z0-9_\x7f-\xff]*+@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', function ($m) { + $message = preg_replace_callback('/[a-zA-Z_\x7f-\xff][\\\\a-zA-Z0-9_\x7f-\xff]*+@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)?[0-9a-fA-F]++/', function ($m) { return class_exists($m[0], false) ? (get_parent_class($m[0]) ?: key(class_implements($m[0])) ?: 'class').'@anonymous' : $m[0]; }, $message); }