Skip to content

Commit 9abcdfa

Browse files
Merge branch '4.3' into 4.4
* 4.3: [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 [PhpUnitBridge] Add test case for @expectedDeprecation annotation [PhpUnitBridge][SymfonyTestsListenerTrait] Remove $testsWithWarnings stack [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 [TwigBridge][Form] Added missing help messages in form themes Update year in license files Update year in license files [HttpClient] fix typo [Console][FormatterHelper] Use helper strlen statically and remove duplicated code [Routing] Fix i18n routing when the url contains the locale Fix BC issue in phpDoc Reflection library [Translator] Performance improvement in MessageCatalogue and catalogue operations.
2 parents 77ebcb5 + b218d7d commit 9abcdfa

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
@@ -54,12 +54,12 @@ public function formatBlock($messages, $style, $large = false)
5454
foreach ($messages as $message) {
5555
$message = OutputFormatter::escape($message);
5656
$lines[] = sprintf($large ? ' %s ' : ' %s ', $message);
57-
$len = max($this->strlen($message) + ($large ? 4 : 2), $len);
57+
$len = max(self::strlen($message) + ($large ? 4 : 2), $len);
5858
}
5959

6060
$messages = $large ? [str_repeat(' ', $len)] : [];
6161
for ($i = 0; isset($lines[$i]); ++$i) {
62-
$messages[] = $lines[$i].str_repeat(' ', $len - $this->strlen($lines[$i]));
62+
$messages[] = $lines[$i].str_repeat(' ', $len - self::strlen($lines[$i]));
6363
}
6464
if ($large) {
6565
$messages[] = str_repeat(' ', $len);
@@ -83,17 +83,13 @@ public function formatBlock($messages, $style, $large = false)
8383
*/
8484
public function truncate($message, $length, $suffix = '...')
8585
{
86-
$computedLength = $length - $this->strlen($suffix);
86+
$computedLength = $length - self::strlen($suffix);
8787

88-
if ($computedLength > $this->strlen($message)) {
88+
if ($computedLength > self::strlen($message)) {
8989
return $message;
9090
}
9191

92-
if (false === $encoding = mb_detect_encoding($message, null, true)) {
93-
return substr($message, 0, $length).$suffix;
94-
}
95-
96-
return mb_substr($message, 0, $length, $encoding).$suffix;
92+
return self::substr($message, 0, $length).$suffix;
9793
}
9894

9995
/**

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)