All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[!IMPORTANT] Initially, in the previous
2.1.0
release, several functions were deprecated (seeDeprecated
under2.1.0
below). 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.
Dates::formatDifferenceOutput()
a private function to handle formatting the output for Dates::timeDifference()
Dates::INTERVAL_UNITS
constant.$includeBcZones
to Dates::timezoneInfo()
and Dates::validTimezone()
Psalm
and RectorPHP
as dev-dependencies.Arrays::flatten()
, Arrays::mapDeep()
, and all the temperature related functions in Conversions
are no longer deprecated.Image
class. Still a work in progress; working toward no ‘codeCoverageIgnore’.Dates::timeDifference()
logic was changed and a new parameter $extendedOutput
added.
false
(default), it returns the same output as usual.true
, it formats the output with available non-zero DateInterval
units. For example: 2 days 2 hours 20 minutes old.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.
mapDeep()
as well.Arrays
class for psalm/phpstan templates/generics.
Conversion::haversineDistance()
method.This release focuses on setting up the future of the library. No new features or functionality has been added in this release.
Esi\Clock
to dependencies, updated Esi\Utility\Dates
accordingly..php-cs-fixer.dist.php
, and as a result, implemented those changes throughout the library.tests
github workflow to add uploading coverage data to Codecov.ioabstract
as they never need instantiation.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)
Arrays::validJson()
will be removed in the next major release (v3.0)Conversions
:
Arrays::exists
@phpstan-ignore-*
opting to instead use a baseline for PHPStan (phpstan-baseline.neon
)Utility has undergone a complete restructuring, wherein it is no longer a single super class. The class has been broken down into smaller classes or “components”.
Conversion::EARTH_RADIUS
Conversion::METERS_TO_KILOMETERS
Conversion::METERS_TO_MILES
Dates::VALIDATE_TIMESTAMP_REGEX
Environment::IP_ADDRESS_HEADERS
Environment::HOST_HEADERS
Environment::URL_HEADERS
Environment::HTTPS_HEADERS
Environment::REQUEST_HEADERS
Image::IMAGE_TYPES
Numbers::SUFFIXES
Numbers::SIZE_FORMAT_UNITS
Numbers::BINARY_STANDARD_BASE
Numbers::METRIC_STANDARD_BASE
Numbers::CONVERSION_MODIFIER
Environment::PORT_SECURE
Environment::PORT_UNSECURE
Environment::VALIDATE_HOST_REGEX
Environment::BOOLEAN_MAPPINGS
Arrays:valueExists
docs/
or online here$skipEmpty
parameter. It will now always skip empty lines.
file()
with SplFileObject
and flags SplFileObject::READ_AHEAD | SplFileObject::SKIP_EMPTY | SplFileObject::DROP_NEW_LINE
$this
to self::
in tests when calling PHPUnit methodsStrings::ascii()
, Strings::slugify()
.
voku/portable-ascii
as a dependency.$language
. If a language specific set of characters exists, it will use those within slugify
and ascii
.Arrays::exists
is now Arrays::keyExists
composer.json
for the test
script, and moved all the phpunit command line options to the relevant options in the phpunit.xml
xml config.Arrays::exists()
will be replaced with Arrays::keyExists()
voku/portable-ascii
as a dependency, Strings::charMap()
was removed.currentUrl()
no longer has any parameters, and just returns the URL string.
currentUrl(bool $parse = false)
is now just currentUrl()
parse_url(Utility::currentUrl())
if that functionality is needed.currentUrl
and isReallyWritable
README.md
for PHPDoc related guidelines, in an effort
to adhere to PSR-5
and PSR-19
.serverHttpVars()
deprecated, just use getallheaders() instead.statusHeader()
ralouphie/getallheaders
as a polyfill, for situations where the SAPI is not ApacheserverHttpVars()
will just return the getallheaders()
outputarrayInterlace
fahrenheitToCelsius
, celsiusToFahrenheit
, celsiusToKelvin
, kelvinToCelsius
, fahrenheitToKelvin
, kelvinToFahrenheit
fahrenheitToRankine
, rankineToFahrenheit
, celsiusToRankine
, rankineToCelsius
, kelvinToRankine
, rankineToKelvin
doesContain()
and doesNotContain()
now uses the PHP 8 native str_contains()
function.
mbstring
for these two functions, as it does not appear to be necessary.$multibyte
parameter to use mbstring
(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.
mbstring
for these two functions, as it does not appear to be necessary.$multibyte
parameter to use mbstring(string $haystack, string $needle, bool $insensitive = false, bool $multibyte = false)
arrayFlatten
, now has new parameter $prepend
validJson()
should now return properly