Skip to content

Releases: PHLAK/Twine

4.2.0

03 Sep 04:21
4d589e9
Compare
Choose a tag to compare

Changed

  • Added ext-mbstring to the requirements in composer.json
  • Minor internal tweaks

Detailed changelog: 4.1.0...4.2.0

4.1.0

04 Dec 05:24
ed03cf1
Compare
Choose a tag to compare

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

15 Aug 03:38
e1a7ea2
Compare
Choose a tag to compare

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

21 Nov 21:57
f3f6b29
Compare
Choose a tag to compare

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 of Twine\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

Detailed changelog: 3.0.0...4.0.0

3.0.0

20 Sep 15:37
85e988b
Compare
Choose a tag to compare

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() with Str::url()
  • Str::replace() can now replace multiple parts of a string at once
  • Str::repeat() can now take a glue string as the second parameter
  • Renamed InvalidConfigOptionException to ConfigException and all exceptions now extend a base TwineException class

Detailed changelog: 2.3.0...3.0.0

2.3.0

06 Aug 04:05
2e594b3
Compare
Choose a tag to compare

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

22 Jul 02:53
5536f1e
Compare
Choose a tag to compare

Added

  • Added Str::join() method

Changed

  • Str::append() and Str::prepend() now accept a variable number of arguments

Detailed changelog: 2.1.0...2.2.0

2.1.0

21 Jul 05:53
d116a40
Compare
Choose a tag to compare

Added

  • Added Str::make() method for static constructing (thanks @roykesserwani)
  • Added Str::urlencode() method
  • Added Str::bcrypt() method
  • Added Str::encrypt() and Str::decrypt() methods
  • Added Str::truncate() method (thanks @roykesserwani)
  • Added Str::similarity() method (thanks @ernst01)
  • Added Str::hex() method
    • Added Str::hexEncode() and Str::hexDecode() aliases
  • Added Str::first() and Str::last() aliases for Str::substring()
  • Added support for serializing (and unserializing) a Twine\Str object
  • Added support for json_encode-ing a Twine\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\ConvinienceTwine\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

08 Jul 04:57
86fe570
Compare
Choose a tag to compare

Added

  • Added Str::startsWith(), Str::endsWith() and Str::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

1.0.0

11 Sep 19:08
c2fce88
Compare
Choose a tag to compare

Initial stable release.