Commit Graph

53 Commits

Author SHA1 Message Date
Nicolas Grekas
de79ae7f35 [String] Add AbstractString::containsAny() 2020-03-03 14:08:48 +01:00
Fabien Potencier
6429999e91 Merge branch '5.0'
* 5.0:
  [Dotenv] Documentation improvement
  [DI] Clarified deprecation for TypedReference in 4.4
  [Validator] Add missing vietnamese translations
  add German translation
  add missing Messenger options to XML schema definition
  [5.0] Remove some unused variables
  [Validator][ConstraintValidator] Update wrong PRETTY_DATE doc
  [DomCrawler][Form] Fix PHPDoc on get & offsetGet
  [ErrorHandler] fix parsing static return type on interface method annotation (fix #35836)
  prevent method calls on null values
  Return int if scale = 0
2020-02-29 11:07:16 +01:00
Thomas Calvet
1f953e42f2 [5.0] Remove some unused variables 2020-02-26 23:30:10 +01:00
Fabien Potencier
d33a483575 feature #35649 [String] Allow to keep the last word when truncating a text (franmomu)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[String] Allow to keep the last word when truncating a text

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fix #35567
| License       | MIT
| Doc PR        | -

The [truncate filter from twig/extensions](https://github.com/twigphp/Twig-extensions/blob/master/src/TextExtension.php#L36) has a `preserve` parameter to preserve whole words.

Since `twig/extensions` is deprecated and its alternative for `truncate` filter is the use of `u` filter, this PR adds preverse word functionality.

Commits
-------

1cfaeec378 [String] Allow to keep the last word when truncating a text
2020-02-21 08:43:56 +01:00
Fran Moreno
1cfaeec378 [String] Allow to keep the last word when truncating a text 2020-02-18 21:59:15 +01:00
Bozhidar Hristov
76ff984ab5 [String] Transliterate & to and 2020-02-13 16:03:58 +01:00
Thomas Calvet
659cdf1871 [String] Add the s() helper method 2020-02-07 08:57:11 +01:00
Thomas Calvet
3d15f91723 [String] Remove the @experimental status 2020-02-06 17:58:08 +01:00
Fabien Potencier
d5bbdca755 Merge branch '5.0'
* 5.0:
  Fix CS
  Fix CS
  Fix CS
2020-02-04 10:50:54 +01:00
Fabien Potencier
f64f59a9c0 Fix CS 2020-02-04 10:47:34 +01:00
Nicolas Grekas
4bb19c62e2 [String] add LazyString to provide generic stringable objects 2020-02-03 18:27:47 +01:00
Thomas Calvet
347d8252fb [String] Made AbstractString::width() follow POSIX.1-2001
Co-authored-by: Nicolas Grekas <nicolas.grekas@gmail.com>
2020-01-23 11:37:52 +01:00
Fabien Potencier
52f77d2a93 Merge branch '5.0'
* 5.0:
  Fix #35385: Fix Console typehint
  Fix RememberMe with null password
  [String] add missing encoding when calling mb_ord()
2020-01-21 08:39:56 +01:00
Nicolas Grekas
759e20e6d3 [String] add missing encoding when calling mb_ord() 2020-01-14 18:54:59 +01:00
Nicolas Grekas
e0c1f4da32 Merge branch '5.0'
* 5.0:
  [String] add test case for wordwrap method
  [Process] - update @throws phpdoc
  [PHPUnitBridge] file_get_contents() expects parameter 3 to be resource
  [PHPUnit-Bridge] Fail-fast in simple-phpunit if one of the passthru() commands fails
  [HttpKernel][FileLocator] Fix deprecation message
2020-01-09 10:56:45 +01:00
Mohamed Gamal
c314598df9 [String] add test case for wordwrap method 2020-01-09 10:55:26 +01:00
Mohamed Gamal
3e0c98836e [String] add test case for unwrap method 2020-01-07 20:08:50 +01:00
Nicolas Grekas
e9f0cfe9db Merge branch '5.0'
* 5.0: (31 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
  [FrameworkBundle] Fix getUser() phpdoc in AbstractController
  [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
  Update year in license files
  [TwigBridge][Form] Added missing help messages in form themes
  Update year in license files
  ...
2020-01-04 15:20:45 +01:00
Jan Rosier
ef4426ae87 Update year in license files 2020-01-01 15:53:07 +01:00
Nicolas Grekas
392d0b01f3 Merge branch '5.0'
* 5.0: (24 commits)
  Removing unused variable
  Fixed #35084
  Add missing use statement
  [HttpClient] fix scheduling pending NativeResponse
  do not overwrite variable value
  [Profiler] wording
  Use spaces correctly to display options in DebugCommand
  Add supported schemes doc blocks type
  X-Accel Nginx URL updated
  ticket-30197 [Validator] Add the missing translations for the Chinese (Taiwan) ("zh_TW") locale
  Fixed test added in #35022
  Use locale_parse for computing fallback locales
  [Console] Fix filtering out identical alternatives when there is a command loader
  [String][UnicodeString] Remove unneeded flag in chunk regex pattern
  add note about HTTP status code change
  Migrate server:log command away from WebServerBundle
  [DependencyInjection][CheckTypeDeclarationsPass] Handle \Closure for callable
  [Security] Fix missing defaults for auto-migrating encoders
  bumped Symfony version to 5.0.3
  updated VERSION for 5.0.2
  ...
2019-12-28 16:12:20 +01:00
Thomas Calvet
c369598b05 [String] Add the reverse method 2019-12-26 10:01:21 +01:00
Thomas Calvet
dcb7c9a484 [String][UnicodeString] Remove unneeded flag in chunk regex pattern 2019-12-23 19:25:43 +01:00
Nicolas Grekas
ae00ff4cfa Merge branch '5.0'
* 5.0: (38 commits)
  [Security] Check UserInterface::getPassword is not null before calling needsRehash
  gracefully handle missing event dispatchers
  Fix TokenStorage::reset not called in stateless firewall
  [DotEnv] Remove `usePutEnv` property default value
  [HttpFoundation] get currently session.gc_maxlifetime if ttl doesnt exists
  Set up typo fix
  [DependencyInjection] Handle env var placeholders in CheckTypeDeclarationsPass
  [Cache] fix memory leak when using PhpArrayAdapter
  [Validator] Allow underscore character "_" in URL username and password
  [TwigBridge] Update bootstrap_4_layout.html.twig
  [DoctrineBridge] Removed QueryBuilder type hint in getLoader()
  [FrameworkBundle][SodiumVault] Create secrets directory only when needed
  fix parsing negative octal numbers
  [String] implement __sleep()/__wakeup() on strings
  Fixed translations file dumper behavior
  [Routing][ObjectLoader] Remove forgotten deprecation after merge
  [SecurityBundle] Passwords are not encoded when algorithm set to \"true\"
  [DependencyInjection] Resolve expressions in CheckTypeDeclarationsPass
  [SecurityBundle] Properly escape regex in AddSessionDomainConstraintPass
  do not validate passwords when the hash is null
  ...
2019-12-07 17:42:39 +01:00
Fabien Potencier
ed3e111e1d bug #34801 [String] implement __sleep()/__wakeup() on strings (nicolas-grekas)
This PR was merged into the 5.0 branch.

Discussion
----------

[String] implement __sleep()/__wakeup() on strings

| Q             | A
| ------------- | ---
| Branch?       | 5.0
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

This resets the transient ignoreCase state on unserialized instances.

Commits
-------

416e40d943 [String] implement __sleep()/__wakeup() on strings
2019-12-07 14:35:22 +01:00
Nicolas Grekas
416e40d943 [String] implement __sleep()/__wakeup() on strings 2019-12-04 09:11:16 +01:00
Nicolas Grekas
976a938736 [String] inline Latin-ASCII rules 2019-12-03 16:53:46 +01:00
Nicolas Grekas
1b4ab81085 Merge branch '5.0'
* 5.0:
  [Routing] fix tests
  [DI] minor cleanup
  [Form] group constraints when calling the validator
  Remove wrong @group legacy annotations
  [DependencyInjection] Fix dumping multiple deprecated aliases
  allow button names to start with uppercase letter
  Allow PHP ^7.2.5
  States that the HttpClient provides a Http Async implementation
  [Routing] Fix ContainerLoader and ObjectLoaderTest
  [HttpKernel] Make ErrorListener::onKernelException()'s dispatcher argument explicit
  [HttpKernel] Drop deprecated ExceptionListener
  Removed extra whitespace
  [Security] Fix best encoder not wired using migrate_from
2019-11-21 08:02:52 +01:00
Nicolas Grekas
6194c2a96c Allow PHP ^7.2.5 2019-11-18 18:27:11 +01:00
Fabien Potencier
e60a876201 updated version to 5.1 2019-11-17 19:31:35 +01:00
Alexander M. Turek
4de3773979 Add parameter type declarations to contracts. 2019-11-09 10:18:34 +01:00
Nicolas Grekas
76776943cd Merge branch '4.4'
* 4.4:
  [Debug] remove return types that break FC badly
  [Mailer][MailchimpBridge] Don't send address names if empty string
  [ExpressionLanguage][Lexer] Exponential format for number
  [Mailer] Fix SES Message Id retrieval
  Add .gitignore to .gitattributes
2019-10-22 19:21:12 +02:00
Alex Bacart
af0f5419bb [String] Fix of title() method 2019-10-21 18:12:52 +02:00
Simon Podlipsky
5540bc7607 Add toString() method for String 2019-10-18 13:18:56 +02:00
Nicolas Grekas
3134b5b88a minor #33932 [String] Added test for replaceMatches (honarkhah)
This PR was merged into the 5.0-dev branch.

Discussion
----------

[String] Added test for replaceMatches

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #33905
| License       | MIT
| Doc PR        |

Added test for String:replaceMatches

Commits
-------

1cbbddd4a9 [String] Added test for replaceMatches
2019-10-14 15:25:00 +02:00
Gregor Harlan
f8d2faa0b8 [String] bytesAt() and codePointsAt() 2019-10-14 15:19:41 +02:00
Nicolas Grekas
9d9d095962 bug #33970 [String] wrap(): test and fix (gharlan)
This PR was merged into the 5.0-dev branch.

Discussion
----------

[String] wrap(): test and fix

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | n/a
| License       | MIT
| Doc PR        | symfony/symfony-docs/pull/12440

Commits
-------

015b81a2f5 [String] wrap(): test and fix
2019-10-14 15:09:00 +02:00
Gregor Harlan
59c215cea6
[String] optimize equalsTo/startsWith/endsWith 2019-10-14 13:33:56 +02:00
Gregor Harlan
015b81a2f5
[String] wrap(): test and fix 2019-10-13 16:51:42 +02:00
mohammadreza honarkhah
1cbbddd4a9 [String] Added test for replaceMatches 2019-10-09 15:04:21 +02:00
Nicolas Grekas
714d6290df [String] add $lastGlue argument to join() methods 2019-10-08 17:49:00 +02:00
Javier Eguiluz
1648c0e12d [String] Renamed a method argument 2019-10-08 13:01:52 +02:00
Nicolas Grekas
2dba6e7f83 minor #33816 [String] renamed core classes to Byte/CodePoint/UnicodeString (nicolas-grekas)
This PR was merged into the 5.0-dev branch.

Discussion
----------

[String] renamed core classes to Byte/CodePoint/UnicodeString

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

In #33553 there have been discussions about the naming of the classes - eg. "what's a grapheme", "why `Utf8String`", "lowercase on binary is weird", etc.

What about these names? Would they get your votes *vs* the current ones?
- `BinaryString` -> `ByteString`
- `Utf8String` -> `CodePointString`
- `GraphemeString` -> `UnicodeString`

Commits
-------

63c105d406 [String] renamed core classes to Byte/CodePoint/UnicodeString
2019-10-07 13:18:18 +02:00
Nicolas Grekas
63c105d406 [String] renamed core classes to Byte/CodePoint/UnicodeString 2019-10-04 09:55:49 +02:00
Nicolas Grekas
215595be5a [FrameworkBundle] encourage installing intl when String is available 2019-10-04 09:49:39 +02:00
Titouan Galopin
056d8ceed9 [String] Introduce a locale-aware Slugger in the String component with FrameworkBundle wiring 2019-10-02 18:31:43 +02:00
Nicolas Grekas
7db04f1248 Merge branch '4.4'
* 4.4:
  fix merge
2019-10-02 18:10:14 +02:00
Nicolas Grekas
a176d1a928 bug #33807 [String] fix toAscii() (nicolas-grekas)
This PR was merged into the 5.0-dev branch.

Discussion
----------

[String] fix toAscii()

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| Deprecations? |
| Tickets       | -
| License       | MIT
| Doc PR        | -

Commits
-------

46a23f87d9 [String] fix toAscii()
2019-10-02 14:13:38 +02:00
Nicolas Grekas
46a23f87d9 [String] fix toAscii() 2019-10-02 14:01:44 +02:00
Gregor Harlan
80b4f81ebf
[String] fix beforeLast/afterLast 2019-10-01 20:07:29 +02:00
Nicolas Grekas
59069626fd [String] improve AbstractUnicodeString::ascii() fallback logic 2019-09-28 15:42:02 +02:00