PHLAK Twine Versions Save

String manipulation, leveled up!

4.2.0

3 years ago

Changed

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

Detailed changelog: https://github.com/PHLAK/Twine/compare/4.1.0...4.2.0

4.1.0

4 years ago

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: https://github.com/PHLAK/Twine/compare/4.0.1...4.1.0

4.0.1

4 years ago

Fixed

  • Added missing encoding declaration in Str::uppercase()
  • Str::make() now allows passing multiple parameters (i.e. encoding)

Detailed changelog: https://github.com/PHLAK/Twine/compare/4.0.0...4.0.1

4.0.0

5 years ago

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: https://github.com/PHLAK/Twine/compare/3.0.0...4.0.0

3.0.0

5 years ago

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: https://github.com/PHLAK/Twine/compare/2.3.0...3.0.0

2.3.0

5 years ago

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: https://github.com/PHLAK/Twine/compare/2.2.0...2.3.0

2.2.0

5 years ago

Added

  • Added Str::join() method

Changed

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

Detailed changelog: https://github.com/PHLAK/Twine/compare/2.1.0...2.2.0

2.1.0

5 years ago

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: https://github.com/PHLAK/Twine/compare/2.0.0...2.1.0

2.0.0

5 years ago

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: https://github.com/PHLAK/Twine/compare/1.0.0...2.0.0

1.0.0

6 years ago

Initial stable release.