Commit Graph

22 Commits

Author SHA1 Message Date
Nicolas Grekas
22a2740888 [String] fix before/after[Last]() returning the empty string instead of the original one on non-match 2020-10-22 14:08:44 +02:00
Nicolas Grekas
034602699e Merge branch '4.4' into 5.1
* 4.4:
  Enable "native_constant_invocation" CS rule
  Make AbstractPhpFileCacheWarmer public
2020-09-02 18:23:27 +02:00
Fabien Potencier
a36f34f0fb Fix CS 2020-08-17 09:48:54 +02:00
Steven Dubois
a2ee6c6cf4 [String] Fix ellipsis of truncate when not using cut option 2020-06-11 14:16:36 +02:00
Fabien Potencier
34583b7562 feature #35936 [String] Add AbstractString::containsAny() (nicolas-grekas)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[String] Add AbstractString::containsAny()

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

We decided to not have a `contains()` method because we didn't know how to handle the case where several needles are passed. But https://wiki.php.net/rfc/str_contains made me reconsider this idea and I think `containsAny()` works great. WDYT?

Commits
-------

de79ae7f35 [String] Add AbstractString::containsAny()
2020-03-16 17:24:27 +01:00
Nicolas Grekas
53b0f63bc3 [String] leverage Stringable from PHP 8 2020-03-13 11:54:27 +01:00
Nicolas Grekas
de79ae7f35 [String] Add AbstractString::containsAny() 2020-03-03 14:08:48 +01:00
Fran Moreno
1cfaeec378 [String] Allow to keep the last word when truncating a text 2020-02-18 21:59:15 +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
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
Thomas Calvet
c369598b05 [String] Add the reverse method 2019-12-26 10:01:21 +01:00
Nicolas Grekas
416e40d943 [String] implement __sleep()/__wakeup() on strings 2019-12-04 09:11:16 +01:00
Simon Podlipsky
5540bc7607 Add toString() method for String 2019-10-18 13:18:56 +02:00
Gregor Harlan
f8d2faa0b8 [String] bytesAt() and codePointsAt() 2019-10-14 15:19:41 +02:00
Gregor Harlan
015b81a2f5
[String] wrap(): test and fix 2019-10-13 16:51:42 +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
63c105d406 [String] renamed core classes to Byte/CodePoint/UnicodeString 2019-10-04 09:55:49 +02:00
Gregor Harlan
80b4f81ebf
[String] fix beforeLast/afterLast 2019-10-01 20:07:29 +02:00
Nicolas Grekas
012e92a772 [String] a new component for object-oriented strings management with an abstract unit system 2019-09-25 16:38:20 +02:00