Skip to content

Releases: nette/utils

Released version 4.0.5

07 Aug 12:43
@dg dg
Compare
Choose a tag to compare
  • Strings::matchAll(): added option 'lazy'
  • added Arrays::mapWithKeys() & Iterables::mapWithKeys()
  • added Iterables::memoize() & toIterator()
  • Image: GD extension detection added
  • support for PHP 8.4

Released version 4.0.4

17 Jan 14:49
@dg dg
Compare
Choose a tag to compare
  • added Iterables
  • added Arrays::firstKey(), lastKey()
  • added Arrays::filter()
  • Arrays::first() & last(): added parameter $else
  • Arrays::first() & last(): added parameter $predicate #305
  • added Image::getSupportedTypes()
  • Arrays: improved phpDoc
  • utilizes Random\Randomizer in PHP 8.3
  • StaticClass: fixed compatibility with PHP 8.3.2
  • Strings::trim() trims unicode spaces and ZWSP (#304)

Released version 4.0.3

29 Oct 21:03
@dg dg
Compare
Choose a tag to compare
  • added ImageColor, replaces Image::rgb()
  • added Image::rectangleWH(), filledRectangleWH(), calculateTextBox()
  • Type: fixed resolving of 'static' nette/di#295

Released version 4.0.2

19 Sep 11:47
@dg dg
Compare
Choose a tag to compare
  • Strings::length() uses mbstring, iconv and then utf8_decode #299
  • Finder: getType() replaced with isDir() / isFile()
  • StaticClass: constructor is private nette/di#292
  • Arrays: add generic type declaration for some(), every() and map() (#298)
  • FileSystem: can be used as instance

Released version 4.0.1

30 Jul 13:05
@dg dg
Compare
Choose a tag to compare
  • support for PHP 8.3
  • added Image::isTypeSupported()
  • added enum ImageType
  • Finder: collect() returns list
  • Finder: improved exception when directory is missing
  • Finder: default mask is '*'
  • improved type annotations (#290)
  • Callback::unwrap() returns correct class name for private methods

Released version 3.2.10

30 Jul 15:41
@dg dg
Compare
Choose a tag to compare
  • support for PHP 8.3
  • Callback::unwrap() returns correct class name for private methods
  • improved type annotations (#290)
  • Reflection: getParameterType(), getReturnType() and getPropertyType() marked as deprecated

Released version 4.0.0 🥳

02 Feb 10:56
@dg dg
Compare
Choose a tag to compare
  • uses PHP 8 featurs
  • includes a completely rewritten Finder
  • PascalCase constants
  • Strings: added support for UTF-8 offsets in regexp
  • Translator: improved interface, accepts and returns string|Stringable [Closes #231]
  • ArrayHash & ArrayList: support iteration with reference (#289)

new methods:

  • Nette\Utils\Json::decodeFile() reads JSON from a file
  • Nette\Utils\FileSystem::unixSlashes() & platformSlashes() converts slashes to Unix slashes
  • Nette\Utils\Strings::ord(), unixNewLines() & platformNewLines()
  • Nette\Utils\Helpers::compare() compare using the operator

new parameters:

  • Nette\Utils\Strings::split() added parameter $limit
  • Nette\Utils\Strings::replace() added parameters $captureOffset, $unmatchedAsNull
  • Nette\Utils\Strings, Nette\Utils\Arrays, Nette\Utils\Json: flags replaced with parameters

removed

  • Reflection: removed obsolete getReturnType(), getParameterType(), getPropertyType() (BC break)

Released version 3.1.9

18 Jan 04:24
@dg dg
Compare
Choose a tag to compare
  • Type: supports Disjunctive Normal Form Types
  • Validators: added isTypeDeclaration(), isBuiltinType(), isClassKeyword()
  • used PhpStorm Language attribute (#277)
  • Types::isSingle() -> isSimple()

Released version 3.2.8

12 Sep 23:26
@dg dg
Compare
Choose a tag to compare
  • support for PHP 8.2
  • tests: deprecated GD changed to PNG
  • Image::clone() uses PNG format because GD2 is disabled since libgd 2.3.3
  • Image::detectTypeFromFile & detectTypeFromString returns width & height
  • Image: added extensionToType()
  • private constants are PascalCase
  • ObjectHelpers: fixed parsing static @methods #278

Released version 3.2.7

24 Jan 11:28
@dg dg
Compare
Choose a tag to compare
  • SmartObject: supports property deprecation
  • Image: added support for AVIF
  • Image: distinguishes between fatal errors and warnings
  • Validators: isNumeric support string number '1.' (#276)
  • Json: accepts native JSON_* constants #275
  • Arrays::isList() uses array_is_list() is PHP 8.1

Deprecated properties are written as @property-deprecated, no standard here exists. PhpStorm and static analysis tools do not see them, which is the intention.