Releases: PHLAK/Twine
Releases · PHLAK/Twine
4.2.0
4.1.0
Added
- Added
Str::match()
method - Added
Str::matchAll()
method
Changed
- Set the string's internal encoding on
Str
object creation
Fixed
- Encoding was not preserved when returning a new instance of the
Str
class from a method
Detailed changelog: 4.0.1...4.1.0
4.0.1
Fixed
- Added missing encoding declaration in
Str::uppercase()
Str::make()
now allows passing multiple parameters (i.e. encoding)
Detailed changelog: 4.0.0...4.0.1
4.0.0
Added
- Added
Str::chracters()
method - Added
Str::chunk()
method - Added
Str::encoding()
method - Added
Str::explode()
method - Added
Str::in()
method - Added
Str::isEmpty()
method - Added
Str::isNotEmpty()
method - Added
Str::nth()
method - Added
Str::split()
method - Added
Str::to()
method - Added Typable methods
Str::isAlphabetic()
Str::isNumeric()
Str::isAlphanumeric()
Str::isLowercase()
Str::isUppercase()
Str::isWhitespace()
Str::isPunctuation()
Str::isPrintable()
Changed
Str::words()
will now return an array ofTwine\Str
objects
Other
- Major improvements to multi-byte string support
- Allow defining a
Twine\Str
object's encoding- Do this on individual objects via the second parameter when newing up a
Twine\Str
object - Or set a global default by calling
Twine\Config\Str::setEncoding()
before newing up an object
- Do this on individual objects via the second parameter when newing up a
Detailed changelog: 3.0.0...4.0.0
3.0.0
Added
- Added
Str::echo()
method - Added
Str::from()
method - Added
Str::matches()
method - Added
Str::strip()
method
Changed
- Twine now works with multi-byte strings
- Replaced
Str::urlencode()
withStr::url()
Str::replace()
can now replace multiple parts of a string at onceStr::repeat()
can now take a glue string as the second parameter- Renamed
InvalidConfigOptionException
toConfigException
and all exceptions now extend a baseTwineException
class
Detailed changelog: 2.3.0...3.0.0
2.3.0
Added
- Added global
str()
helper function - Added
Str::words()
method - Added casing methods
Str::camelCase()
Str::studlyCase()
Str::pascalCase()
Str::snakeCase()
Str::kebabCase()
Detailed changelog: 2.2.0...2.3.0
2.2.0
Added
- Added
Str::join()
method
Changed
Str::append()
andStr::prepend()
now accept a variable number of arguments
Detailed changelog: 2.1.0...2.2.0
2.1.0
Added
- Added
Str::make()
method for static constructing (thanks @roykesserwani) - Added
Str::urlencode()
method - Added
Str::bcrypt()
method - Added
Str::encrypt()
andStr::decrypt()
methods - Added
Str::truncate()
method (thanks @roykesserwani) - Added
Str::similarity()
method (thanks @ernst01) - Added
Str::hex()
method- Added
Str::hexEncode()
andStr::hexDecode()
aliases
- Added
- Added
Str::first()
andStr::last()
aliases forStr::substring()
- Added support for serializing (and unserializing) a
Twine\Str
object - Added support for
json_encode
-ing aTwine\Str
object (they will be converted to a string) (thanks @erikverbeek)
Changed
- Cast the value passed to the
Str()
constructor to a string
Fixed
- Fixed trait name misspelling:
Twine\Traits\Convinience
→Twine\Traits\Convenience
- Fixed
Str::insensitiveMatch()
not returning anything - Fixed
Str::lowercase(Twine\Config\Lowercase::WORDS)
not working on strings following tabs and newline characters (thanks @dhrrgn)
Other
- Optimized
Str::lowercase(Twine\Config\Lowercase::WORDS)
when acting on a long string (thanks @dhrrgn) - Optimized
Str::hex()
method when acting on long a string (thanks @dhrrgn)
Detailed changelog: 2.0.0...2.1.0
2.0.0
Added
- Added
Str::startsWith()
,Str::endsWith()
andStr::contains()
methods - Added a slew of method aliases
Changed
- Bumped minimum required PHP version to 7.0
- Updated
Str::crypt()
method to always require a salt - Split config options into separate classes and refactored the way they are validated
- Modifed
Str::md5()
,Str::sha1()
,Str::sha256()
methods to accept a mode flag
Detailed changelog: 1.0.0...2.0.0