Skip to content

Commit 33b74ac

Browse files
Merge branch '4.4' into 5.0
* 4.4: (26 commits) [HttpClient] NativeHttpClient should not send >1.1 protocol version [HttpClient] fix support for non-blocking resource streams [Mailer] Make sure you can pass custom headers to Mailgun [Mailer] Remove line breaks in email attachment content Update links to documentation [Validator] Add the missing translations for the Arabic (ar) locale ensure to expect no validation for the right reasons [Security-Guard] fixed 35203 missing name tag in param docblock [HttpClient] fix casting responses to PHP streams [PhpUnitBridge] Add test case for @expectedDeprecation annotation [PhpUnitBridge][SymfonyTestsListenerTrait] Remove $testsWithWarnings stack [Mailer] Fix addresses management in Sendgrid API payload [Mailer][MailchimpBridge] Fix missing attachments when sending via Mandrill API [Mailer][MailchimpBridge] Fix incorrect sender address when sender has name [HttpClient] fix capturing SSL certificates with NativeHttpClient Update year in license files [TwigBridge][Form] Added missing help messages in form themes Update year in license files Update year in license files fix version when "anonymous: lazy" was introduced ...
2 parents e1bb8b3 + 9abcdfa commit 33b74ac

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

Helper/FormatterHelper.php

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ public function formatBlock($messages, string $style, bool $large = false)
4848
foreach ($messages as $message) {
4949
$message = OutputFormatter::escape($message);
5050
$lines[] = sprintf($large ? ' %s ' : ' %s ', $message);
51-
$len = max($this->strlen($message) + ($large ? 4 : 2), $len);
51+
$len = max(self::strlen($message) + ($large ? 4 : 2), $len);
5252
}
5353

5454
$messages = $large ? [str_repeat(' ', $len)] : [];
5555
for ($i = 0; isset($lines[$i]); ++$i) {
56-
$messages[] = $lines[$i].str_repeat(' ', $len - $this->strlen($lines[$i]));
56+
$messages[] = $lines[$i].str_repeat(' ', $len - self::strlen($lines[$i]));
5757
}
5858
if ($large) {
5959
$messages[] = str_repeat(' ', $len);
@@ -73,17 +73,13 @@ public function formatBlock($messages, string $style, bool $large = false)
7373
*/
7474
public function truncate(string $message, int $length, string $suffix = '...')
7575
{
76-
$computedLength = $length - $this->strlen($suffix);
76+
$computedLength = $length - self::strlen($suffix);
7777

78-
if ($computedLength > $this->strlen($message)) {
78+
if ($computedLength > self::strlen($message)) {
7979
return $message;
8080
}
8181

82-
if (false === $encoding = mb_detect_encoding($message, null, true)) {
83-
return substr($message, 0, $length).$suffix;
84-
}
85-
86-
return mb_substr($message, 0, $length, $encoding).$suffix;
82+
return self::substr($message, 0, $length).$suffix;
8783
}
8884

8985
/**

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2004-2019 Fabien Potencier
1+
Copyright (c) 2004-2020 Fabien Potencier
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ interfaces.
77
Resources
88
---------
99

10-
* [Documentation](https://symfony.com/doc/current/components/console/index.html)
10+
* [Documentation](https://symfony.com/doc/current/components/console.html)
1111
* [Contributing](https://symfony.com/doc/current/contributing/index.html)
1212
* [Report issues](https://github.com/symfony/symfony/issues) and
1313
[send Pull Requests](https://github.com/symfony/symfony/pulls)

0 commit comments

Comments
 (0)