Skip to content

Commit 8aff3ad

Browse files
Merge branch '3.4' into 4.3
* 3.4: [ProxyManager] fix closure binding [VarDumper] fix annotations [Console] fixed a PHP notice when there is no function
2 parents bec6ebc + 1e47f0f commit 8aff3ad

File tree

6 files changed

+23
-20
lines changed

6 files changed

+23
-20
lines changed

src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function getProxyCode(Definition $definition)
9595
}
9696

9797
if (version_compare(self::getProxyManagerVersion(), '2.5', '<')) {
98-
$code = str_replace(' \Closure::bind(function ', ' \Closure::bind(static function ', $code);
98+
$code = preg_replace('/ \\\\Closure::bind\(function ((?:& )?\(\$instance(?:, \$value)?\))/', ' \Closure::bind(static function \1', $code);
9999
}
100100

101101
return $code;

src/Symfony/Bundle/FrameworkBundle/Translation/Translator.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ protected function initializeCatalogue($locale)
123123
parent::initializeCatalogue($locale);
124124
}
125125

126+
/**
127+
* @internal
128+
*/
126129
protected function doLoadCatalogue($locale): void
127130
{
128131
parent::doLoadCatalogue($locale);

src/Symfony/Component/Console/Application.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -831,11 +831,11 @@ protected function doRenderException(\Exception $e, OutputInterface $output)
831831
for ($i = 0, $count = \count($trace); $i < $count; ++$i) {
832832
$class = isset($trace[$i]['class']) ? $trace[$i]['class'] : '';
833833
$type = isset($trace[$i]['type']) ? $trace[$i]['type'] : '';
834-
$function = $trace[$i]['function'];
834+
$function = isset($trace[$i]['function']) ? $trace[$i]['function'] : '';
835835
$file = isset($trace[$i]['file']) ? $trace[$i]['file'] : 'n/a';
836836
$line = isset($trace[$i]['line']) ? $trace[$i]['line'] : 'n/a';
837837

838-
$output->writeln(sprintf(' %s%s%s() at <info>%s:%s</info>', $class, $type, $function, $file, $line), OutputInterface::VERBOSITY_QUIET);
838+
$output->writeln(sprintf(' %s%s at <info>%s:%s</info>', $class, $function ? $type.$function.'()' : '', $file, $line), OutputInterface::VERBOSITY_QUIET);
839839
}
840840

841841
$output->writeln('', OutputInterface::VERBOSITY_QUIET);

src/Symfony/Component/VarDumper/Cloner/Data.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function getType()
6161
}
6262

6363
/**
64-
* @param bool $recursive Whether values should be resolved recursively or not
64+
* @param array|bool $recursive Whether values should be resolved recursively or not
6565
*
6666
* @return string|int|float|bool|array|Data[]|null A native representation of the original value
6767
*/
@@ -168,7 +168,7 @@ public function __toString()
168168
*
169169
* @param int $maxDepth The max dumped depth level
170170
*
171-
* @return self A clone of $this
171+
* @return static
172172
*/
173173
public function withMaxDepth($maxDepth)
174174
{
@@ -183,7 +183,7 @@ public function withMaxDepth($maxDepth)
183183
*
184184
* @param int $maxItemsPerDepth The max number of items dumped per depth level
185185
*
186-
* @return self A clone of $this
186+
* @return static
187187
*/
188188
public function withMaxItemsPerDepth($maxItemsPerDepth)
189189
{
@@ -198,7 +198,7 @@ public function withMaxItemsPerDepth($maxItemsPerDepth)
198198
*
199199
* @param bool $useRefHandles False to hide global ref. handles
200200
*
201-
* @return self A clone of $this
201+
* @return static
202202
*/
203203
public function withRefHandles($useRefHandles)
204204
{
@@ -213,7 +213,7 @@ public function withRefHandles($useRefHandles)
213213
*
214214
* @param string|int $key The key to seek to
215215
*
216-
* @return self|null A clone of $this or null if the key is not set
216+
* @return static|null Null if the key is not set
217217
*/
218218
public function seek($key)
219219
{

src/Symfony/Component/VarDumper/Cloner/DumperInterface.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,21 @@ public function dumpString(Cursor $cursor, $str, $bin, $cut);
4040
/**
4141
* Dumps while entering an hash.
4242
*
43-
* @param Cursor $cursor The Cursor position in the dump
44-
* @param int $type A Cursor::HASH_* const for the type of hash
45-
* @param string $class The object class, resource type or array count
46-
* @param bool $hasChild When the dump of the hash has child item
43+
* @param Cursor $cursor The Cursor position in the dump
44+
* @param int $type A Cursor::HASH_* const for the type of hash
45+
* @param string|int $class The object class, resource type or array count
46+
* @param bool $hasChild When the dump of the hash has child item
4747
*/
4848
public function enterHash(Cursor $cursor, $type, $class, $hasChild);
4949

5050
/**
5151
* Dumps while leaving an hash.
5252
*
53-
* @param Cursor $cursor The Cursor position in the dump
54-
* @param int $type A Cursor::HASH_* const for the type of hash
55-
* @param string $class The object class, resource type or array count
56-
* @param bool $hasChild When the dump of the hash has child item
57-
* @param int $cut The number of items the hash has been cut by
53+
* @param Cursor $cursor The Cursor position in the dump
54+
* @param int $type A Cursor::HASH_* const for the type of hash
55+
* @param string|int $class The object class, resource type or array count
56+
* @param bool $hasChild When the dump of the hash has child item
57+
* @param int $cut The number of items the hash has been cut by
5858
*/
5959
public function leaveHash(Cursor $cursor, $type, $class, $hasChild, $cut);
6060
}

src/Symfony/Component/VarDumper/Dumper/AbstractDumper.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,13 +185,13 @@ protected function echoLine($line, $depth, $indentPad)
185185
/**
186186
* Converts a non-UTF-8 string to UTF-8.
187187
*
188-
* @param string $s The non-UTF-8 string to convert
188+
* @param string|null $s The non-UTF-8 string to convert
189189
*
190-
* @return string The string converted to UTF-8
190+
* @return string|null The string converted to UTF-8
191191
*/
192192
protected function utf8Encode($s)
193193
{
194-
if (preg_match('//u', $s)) {
194+
if (null === $s || preg_match('//u', $s)) {
195195
return $s;
196196
}
197197

0 commit comments

Comments
 (0)