Skip to content

v2.2.0

Latest
Compare
Choose a tag to compare
@ericsizemore ericsizemore released this 11 Jan 01:26
· 1 commit to master since this release
626ed98

[2.2.0] - 2025-01-10

Important

Initially, in the previous 2.1.0 release, several functions were deprecated (see Deprecated under 2.1.0 here).
After much thought on the direction I want this library to move in, I am reversing my decision to deprecate the Array and Temperature functions mentioned.

Added

  • Dates::formatDifferenceOutput() a private function to handle formatting the output for Dates::timeDifference()
  • Dates::INTERVAL_UNITS constant.
  • Added new parameter $includeBcZones to Dates::timezoneInfo() and Dates::validTimezone()
    • If true, includes all backwards compatible (and outdated) timezones.
  • Added Psalm and RectorPHP as dev-dependencies.

Changed

  • Arrays::flatten(), Arrays::mapDeep(), and all the temperature related functions in Conversions are no longer deprecated.
  • New tests added for the Image class. Still a work in progress; working toward no 'codeCoverageIgnore'.
  • Dates::timeDifference() logic was changed and a new parameter $extendedOutput added.
    • If this parameter is false (default), it returns the same output as usual.
    • If this parameter is true, it formats the output with available non-zero DateInterval units. For example: 2 days 2 hours 20 minutes old.
  • BC BREAK: Dates::timeDifference() output no longer uses '(s)'. Will add 's' if greater than one.
  • Arrays class has gone through a bit of a refactor:
    • Arrays::mapDeep() updated to avoid circular references when dealing with objects.
      • New PHPUnit tests added to cover mapDeep() as well.
    • Updated the Arrays class for psalm/phpstan templates/generics.
      • Still something I am admittedly not highly experienced with, so it may look/feel a little wonky. Going to improve it as I can.
  • Optimized the Conversion::haversineDistance() method.
  • Refactored unit tests.
  • Changes throughout to make fixes and improvements reported by Psalm.

Full Changelog: v2.1.0...v2.2.0