Releases: ericsizemore/utility
v2.2.2
2.2.2 - 2026-02-27
No significant changes
Changed
- Updated
composer.jsonto allow PHP 8.5. - Updated dev-dependencies to allow PHPUnit 11, 12 or 13.
- Allow PHP 8.5 in CI.
What's Changed
- chore(deps): Update dependency phpstan/phpstan-phpunit to v2.0.13 by @renovate[bot] in #336
- chore(deps): Update dependency phpstan/phpstan-phpunit to v2.0.14 by @renovate[bot] in #345
- chore(deps): Update dependency phpunit/phpunit to v11.5.53 by @renovate[bot] in #346
- chore(deps): Update PHPStan packages by @renovate[bot] in #347
- chore(deps): Update dependency friendsofphp/php-cs-fixer to v3.94.0 by @renovate[bot] in #339
- chore(deps): Update dependency phpstan/phpstan-phpunit to v2.0.16 by @renovate[bot] in #348
- chore(deps): Update dependency phpunit/phpunit to v11.5.54 by @renovate[bot] in #349
- chore(deps): Update dependency friendsofphp/php-cs-fixer to v3.94.1 by @renovate[bot] in #350
- chore(deps): Update dependency phpunit/phpunit to v11.5.55 by @renovate[bot] in #351
- chore(deps): Update dependency rector/rector to v2.3.7 by @renovate[bot] in #352
- chore(deps): Update dependency friendsofphp/php-cs-fixer to v3.94.2 by @renovate[bot] in #353
- chore(deps): Update dependency rector/rector to v2.3.8 by @renovate[bot] in #354
- chore(deps): Update dependency phpstan/phpstan to v2.1.40 by @renovate[bot] in #355
- chore(deps): Update dependency esi/clock to v1.1.1 by @renovate[bot] in #356
Full Changelog: v2.2.1...v2.2.2
v2.2.1
2.2.1 - 2026-02-09
No significant changes
Changed
- Updated dev-dependencies.
- Updated security policy in
SECURITY.md. - Updated the
continuous integrationworkflow for the Psalm static analysis. - Updated the
backward compatibilitypromise (see backward-compatibility.md)
v2.2.0
[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 forDates::timeDifference()Dates::INTERVAL_UNITSconstant.- Added new parameter
$includeBcZonestoDates::timezoneInfo()andDates::validTimezone()- If true, includes all backwards compatible (and outdated) timezones.
- Added
PsalmandRectorPHPas dev-dependencies.
Changed
Arrays::flatten(),Arrays::mapDeep(), and all the temperature related functions inConversionsare no longer deprecated.- New tests added for the
Imageclass. Still a work in progress; working toward no 'codeCoverageIgnore'. Dates::timeDifference()logic was changed and a new parameter$extendedOutputadded.- 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-zeroDateIntervalunits. For example: 2 days 2 hours 20 minutes old.
- If this parameter is
- BC BREAK:
Dates::timeDifference()output no longer uses '(s)'. Will add 's' if greater than one. Arraysclass 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.
- New PHPUnit tests added to cover
- Updated the
Arraysclass 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
v2.1.0
[2.1.0] - 2024-04-23
This release focuses on setting up the future of the library. No new features or functionality has been added in this release.
Added
- Added mend.io's Renovate to workflow
- Added
Esi\Clockto dependencies, updatedEsi\Utility\Datesaccordingly. - Added a code of conduct.
- Added a backwards compatibility promise.
Changed
- Reformatted this CHANGELOG to be more in line with the Keep a Changelog format.
- Implemented various PHPCS-Fixer recommendations.
- Updated coding style via
.php-cs-fixer.dist.php, and as a result, implemented those changes throughout the library. - Changed the header being used for all files to something smaller, and more simple.
- Bumped version requirement for the PHPUnit dev-dependency to 11.1
- Updated
testsgithub workflow to add uploading coverage data to Codecov.io - Made all utility classes
abstractas they never need instantiation. - Separate contributing information into its own file.
- Updated contributing information and guidelines.
Deprecated
The next major release, v3, will move to PHP 8.3 as a minimum requirement.
Arrays::flatten()'s current signature and functionality will change in the next major release (v3.0)Arrays::mapDeep()'s current signature and functionality will change in the next major release (v3.0)- The functionality of mapping the properties of an object will likely be moved to its own utility class/function.
Arrays::validJson()will be removed in the next major release (v3.0)- All of the temperature related functions in
Conversions:- Current signature and functionality deprecated, will be changed in 3.0
Removed
- Removed deprecated
Arrays::exists - Removed all instances of
@phpstan-ignore-*opting to instead use a baseline for PHPStan (phpstan-baseline.neon)
GitHub Log
What's Changed
- Configure Renovate by @renovate in #5
- Update codecov/codecov-action action to v4.1.1 by @renovate in #7
- Update codecov/codecov-action action to v4.2.0 by @renovate in #8
- Update dependency phpunit/phpunit to v11.1.1 by @renovate in #9
- Update codecov/codecov-action action to v4.3.0 by @renovate in #10
- Update dependency phpunit/phpunit to v11.1.2 by @renovate in #11
- Update dependency friendsofphp/php-cs-fixer to v3.54.0 by @renovate in #12
New Contributors
Full Changelog: v2.0.0...v2.1.0
v2.0.0
Full Changelog: v1.3.0...v2.0.0 & https://github.com/ericsizemore/utility/blob/master/CHANGELOG.md
Some Highlights:
2.0.0 (2024-03-04)
- Utility has undergone a complete restructuring.
- src/Utility/Utility.php no longer exists. The class has been broken down into smaller classes or "components":
- src/Utility/Arrays.php
- src/Utility/Conversion.php
- src/Utility/Dates.php
- src/Utility/Environment.php
- src/Utility/Filesystem.php
- src/Utility/Image.php
- src/Utility/Numbers.php
- src/Utility/Strings.php
- Made a great improvement in code coverage/testing
- Effort to improve documentation, which can be found in
docs/or online here
v1.3.0
1.3.0 (2023-12-11)
- currentUrl() no longer has any parameters, and just returns the URL string.
- currentUrl(bool $parse = false) is now just currentUrl()
- Just run parse_url(Utility::currentUrl()) if that functionality is needed.
- serverHttpVars() deprecated, just use getallheaders() instead.
- Added ralouphie/getallheaders as a polyfill, for situations where the SAPI is not Apache
- serverHttpVars() will just return the getallheaders() output
- Removed deprecated statusHeader()
- Code cleanup per PHPCS and PHPScrutinizer
- Small refactoring of some functions, such as currentUrl and isReallyWritable
- Attempt at increasing test coverage.
- Further cleanup to try and adhere to PSR-12.
- Adding information into README.md for PHPDoc related guidelines, in an effort
to adhere to PSR-5 and PSR-19.
- Adding information into README.md for PHPDoc related guidelines, in an effort
Full Changelog: v1.2.0...v1.3.0
v1.2.0
1.2.0 (2023-09-22)
- Code cleanup per PHPStan (level: 9, strict, bleeding edge)
- New function arrayInterlace
- doesContain() and doesNotContain() now uses the PHP 8 native str_contains() function.
- No longer relies on mbstring for these two functions, as it does not appear to be necessary.
- However, you can pass true to the $multibyte parameter to use mbstring
- New signature:
(string $haystack, string $needle, bool $insensitive = false, bool $multibyte = false)
- beginsWith() and endsWith() now uses the PHP 8 native str_starts_with() and str_ends_with() functions.
- No longer relies on mbstring for these two functions, as it does not appear to be necessary.
- However, you can pass true to the $multibyte parameter to use mbstring
- New signature:
(string $haystack, string $needle, bool $insensitive = false, bool $multibyte = false)
- New functions for temperature conversions:
- fahrenheitToCelsius, celsiusToFahrenheit, celsiusToKelvin, kelvinToCelsius, fahrenheitToKelvin, kelvinToFahrenheit
- fahrenheitToRankine, rankineToFahrenheit, celsiusToRankine, rankineToCelsius, kelvinToRankine, rankineToKelvin
- Reworked arrayFlatten, now has new paramater $prepend
- statusHeader() is now deprecated, you can use PHP's built-in http_response_code function instead.
- validJson() should now return properly
- Initial implementation of PHPUnit and the testing suite.
v1.1.2
1.1.2 (2023-08-17)
- Version bump
- Minor code cleanup
v1.1.1
1.1.1 (2023-08-11)
- Version bump
- Cleaning up issues per PHPStan
v1.1.0
1.1.0 (2023-06-24)
- Version bump
- Bumped PHP version requirement to 8.2
- Updated composer.json
- FIX: Minor documentation improvements.
- FIX: Minor code improvements.
- BC BREAK: randomBytes, randomInt, randomString and guid now throw \Random\RandomException
What's Changed
New Contributors
Full Changelog: v1.0.3...v1.1.0