8000 Merge branch '4.3' into 4.4 · symfony/symfony@3fa8ad0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3fa8ad0

Browse files
Merge branch '4.3' into 4.4
* 4.3: [ProxyManager] fix closure binding [VarDumper] fix annotations [Console] fixed a PHP notice when there is no function
2 parents 4d4b647 + 8aff3ad commit 3fa8ad0

File tree

6 files changed

+21
-18
lines changed

6 files changed

+21
-18
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
@@ -844,11 +844,11 @@ protected function doRenderException(\Exception $e, OutputInterface $output)
844844
for ($i = 0, $count = \count($trace); $i < $count; ++$i) {
845845
$class = isset($trace[$i]['class']) ? $trace[$i]['class'] : '';
846846
$type = isset($trace[$i]['type']) ? $trace[$i]['type'] : '';
847-
$function = $trace[$i]['function'];
847+
$function = isset($trace[$i]['function']) ? $trace[$i]['function'] : '';
848848
$file = isset($trace[$i]['file']) ? $trace[$i]['file'] : 'n/a';
849849
$line = isset($trace[$i]['line']) ? $trace[$i]['line'] : 'n/a';
850850

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

854854
$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: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,19 @@ public function dumpString(Cursor $cursor, $str, $bin, $cut);
3838
/**
3939
* Dumps while entering an hash.
4040
*
41-
* @param int $type A Cursor::HASH_* const for the type of hash
42-
* @param string $class The object class, resource type or array count
43-
* @param bool $hasChild When the dump of the hash has child item
41+
* @param int $type A Cursor::HASH_* const for the type of hash
42+
* @param string|int $class The object class, resource type or array count
43+
* @param bool $hasChild When the dump of the hash has child item
4444
*/
4545
public function enterHash(Cursor $cursor, $type, $class, $hasChild);
4646

4747
/**
4848
* Dumps while leaving an hash.
4949
*
50-
* @param int $type A Cursor::HASH_* const for the type of hash
51-
* @param string $class The object class, resource type or array count
52-
* @param bool $hasChild When the dump of the hash has child item
53-
* @param int $cut The number of items the hash has been cut by
50+
* @param int $type A Cursor::HASH_* const for the type of hash
51+
* @param string|int $class The object class, resource type or array count
52+
* @param bool $hasChild When the dump of the hash has child item
53+
* @param int $cut The number of items the hash has been cut by
5454
*/
5555
public function leaveHash(Cursor $cursor, $type, $class, $hasChild, $cut);
5656
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,13 +184,13 @@ protected function echoLine($line, $depth, $indentPad)
184184
/**
185185
* Converts a non-UTF-8 string to UTF-8.
186186
*
187-
* @param string $s The non-UTF-8 string to convert
187+
* @param string|null $s The non-UTF-8 string to convert
188188
*
189-
* @return string The string converted to UTF-8
189+
* @return string|null The string converted to UTF-8
190190
*/
191191
protected function utf8Encode($s)
192192
{
193-
if (preg_match('//u', $s)) {
193+
if (null === $s || preg_match('//u', $s)) {
194194
return $s;
195195
}
196196

0 commit comments

Comments
 (0)
0