- ImageHelper: Split it off into a separate package,
mistralys/application-utils-image
. - ImageHelper: Fully backwards compatible; the class is still available in this package.
- Dependencies: Added AppUtils Image v1.1.0.
- OperationResult: Duplicate messages are now compressed into a single entry.
- OperationResult: Added
getCount()
to count how many times a message has been added. - OperationResult: Added
getCodes()
to the collection. - OperationResult: Added
getTypeLabel()
. - OperationResult: Added the possibility to add an operation label.
- OperationResult: Added global functions
operationResult()
andoperationCollection()
. - Code: PHPStan analysis now clean up to level 6, including tests.
- Core: Updated core to v1.0.3.
- PaginationHelper: Added
getTotalItems()
. - PaginationHelper: Added
getTotalPages()
. - PaginationHelper: Added
getItemsPerPage()
. - PaginationHelper: Added
factory()
method to make chaining easier. - PaginationHelper: Added
setCurrentPage()
, so it is not mandatory to instantiate the class. - Tests: Renamed the
testsuites
folder for correct namespacing.
- ImageHelper: Allow passing 0 to a
resample()
argument instead ofNULL
.
- ImageHelper: Fixed SVG image size detection when no document size is present.
- Code Base: Split core classes into a separate GIT repository.
- Dependencies: Added
mistralys/application-utils-core
.
This release is the first in a larger project to make the package more modular. The core classes have been split into a separate repository, which is now a dependency of this package. This is entirely backwards compatible.
The aim is to make it possible to choose which AppUtil utilities to use, without unnecessarily splitting the code base. This package will stay the main entry point with the current selection of utilities for the foreseeable future.
It is planned to split other utilities off (like the ImageHelper), but they will then become dependencies of this package to keep them available. They will be installable separately, however.
- The
Interface_Stringable
has been renamed toStringableInterface
. - The
Interface_Optionable
has been renamed toOptionableInterface
. - The
Interface_Classable
has been renamed toClassableInterface
. - The
ConvertHelper_ThrowableInfo
class has been renamed toThrowableInfo
.
For all of these interfaces and traits, the old versions are still available to help with the migration. They will be removed in a future release.
- Microtime: Now detecting nanoseconds independently of formatting.
- Microtime: Added time zone recognition.
- Microtime: Added the
TimeZoneInfo
utility class. - Microtime: Added
getTimezoneInfo()
. - Microtime: Added
getMilliseconds()
. - Microtime: Added
getNanoseconds()
. - Microtime: Added
getNanoDate()
. - Microtime: Nanoseconds are now persisted when cloning dates.
- Microtime: Time zone identifiers are no longer case sensitive.
- Microtime:
getISODate()
andgetNanoDate()
can optionally include the time zone.
Microtime will more reliably detect and adjust nanosecond
values in date strings, reducing them to microseconds.
The nanoseconds can still be accessed via getNanoseconds()
.
Microtime::createFromMicrotime()
- ImageHelper: Removed some PHP8 deprecation notices.
- HTMLTag: Made the constructor public to allow extending the class.
- Classable: Removed
addClass()
param type hint for interface compatibility. - RBGAColor: Fixed setting a color channel via Array access.
- RGBAColor: Added the non-immutable
applyXXX()
methods required for Array access. - Core: Fixed PHP8 deprecation notices.
- PathInfo:
isWithinFolder()
now correctly handles../
in paths.
- PathInfo: Added
getSize()
to get the size in bytes. - PathInfo: Added
isWithinFolder()
to compare paths.
- RGBAColor: Better Luma calculation, based on an actual Luma formula.
- RGBAColor: Added
getLumaPercent()
. - RGBAColor: Added
isDark()
andisLight()
.
- HSVColor: Fixed a division by zero issue with some color values.
- HSVColor: Added a new color utility class for color adjustments.
- ColorChannel: Added
getPercentRounded()
. - ColorChannel: Added support for passing through existing instances in factory methods.
- Colors: Renamed
decimal
related methods toalpha
as it was too confusing. - Stringable Interface: Now using Symfony's PHP8 shim to make it
Stringable
compatible. - ImageSize: Added
getRatio()
to get the size aspect ratio value. - ImageSize: Added
toStringRedable()
utility method. - ImageSize: Added resize methods, including the practical
resizeInto()
. - ImageSize: Added the global function
imgSize()
to create an instance.
RGBAColor::getBrightness()
now returnsBrightnessChannel
.- Renamed
ColorChannel::getDecimal()
togetAlpha()
. - Renamed
ColorChannel::decimal()
toalpha
. - Renamed
UnitsConverter::float2IntSevenBit()
toalpha2IntSevenBit()
. - Renamed
UnitsConverter::float2IntEightBit()
toalpha2IntEightBit()
. - Renamed
UnitsConverter::percent2Float()
topercent2Alpha()
. - Renamed
UnitsConverter::float2percent()
toalpha2percent()
. - Renamed
UnitsConverter::intSevenBit2Float()
tointSevenBit2Alpha()
. - Renamed
UnitsConverter::intEightBit2IntSevenBit()
tointSevenBit2Alpha()
. - Renamed
UnitsConverter::intEightBit2Float()
tointEightBit2Alpha()
.
- RGBAColor: Fixed
toHEX()
returning erroneous values (#10).
- URLInfo: Fixed spaces stripped from the path component of URLs.
- URLInfo: URLs that cannot be parsed by
parse_url
no longer cause a PHP error. - URLInfo: URLs with too many slashes, e.g.
https:///
are now fixed automatically.
- Microtime: Added support for date strings in ISO8601 format.
- URLInfo: Fixed a PHP error when calling
getTypeLabel()
with thenone
type.
- ArrayDataCollection: Fixed
getBool()
not accepting a string1
as true. - FileHelper: Fixed
sendFileAuto()
not being static. - AttributeCollection: Added
setKeepIfEmpty()
to keep select empty attributes. - HTMLTag: Added the possibility to keep empty attributes in the rendered tag.
- Functions: Added
array_remove_values()
.
- ArrayDataCollection: Added
createFromJSON()
. - ImageHelper: Fixed the
trim()
method borking colors in some cases.
- ConvertHelper: Added
json2var()
,json2array()
andarray2json()
. - JSONConverter: Added the static class with all utility methods.
- JSONConverter: All JSON methods now throw
JSONConverterException
exceptions. - Updated all relevant internal calls to use the JSON converter methods.
- ArrayDataCollection: Added date and time related methods.
getMicrotime()
setMicrotime()
getDateTime()
setDateTime()
getTimestamp()
Any methods that were documented to trigger a JsonException
before
now exclusively trigger JSONConverterException
, which is not compatible
with JsonException
. Try/Catch blocks must be updated.
Note: The original
JsonException
is still available via the previous exception.
- DataArrayCollection:
getJSONArray
now works with array values.
- FileInfo: Fixed
is_file()
wrongly detecting existing folders as files in some cases. - DataArrayCollection: Added
remove()
. - DataArrayCollection: Added
keyExists()
andkeyHasValue()
. - DataArrayCollection: An existing collection can now be used in
create()
, as pass-through value.
- Collections: Added the
ArrayDataCollection
helper class.
- ImageHelper: Improved the
trim()
method. - ImageHelper: Prepared for PHP8's GD library changes.
- ImageHelper: Renamed
opacity
toalpha
to keep the terminology consistent. - ImageHelper: Fixed some alpha channel-related issues.
- ImageHelper: Added some unit tests for methods like
trim()
. - RequestHelper: Made
RequestHelper::createCURL()
public. - RequestHelper: Fixed PHP8 compatibility when initializing CURL.
- FileHelper: Fixed
removeExtension
throwing an exception with extensionless paths. - Code: All unit tests running on PHP8.
- FileHelper: Added
IndeterminatePath
for paths that can be either a file or a folder. - FileHelper:
FileInfo
andFolderInfo
can now work with paths that do not exist.
Renamed all opacity
methods to alpha
.
Using getPathInfo()
on paths like /path/to/folder
when the target
file or folder do not exist, will not return a folder instance anymore, but an
IndeterminatePath
. This is because the target can be either a file or a folder.
To avoid confusion when working with folders, use /path/to/folder/
instead.
Alternatively, use getFolderInfo()
or getFileInfo()
to specify the expected
type.
- SVNHelper: Marked as deprecated, will be removed in a future release.
- URLInfo: Fixed parsing localhost URLs, with or without scheme.
- URLInfo: Improved the parsing of some edge cases.
- URLInfo: Namespaced and renamed internally used classes.
- URLInfo: All exceptions are now instances of
URLException
. - URLInfo: Added custom schemes via
URISchemes
. - URLInfo: Added custom host names via
URLHosts
.
- ClassHelper: Better handling of exceptions passed to
requireObjectInstanceOf()
.
- PHPClassInfo: Added support for detecting interfaces.
- PHPClassInfo: Added
isInterface()
andisClass()
to individual results. - FileInfo: Added
getBaseName()
to get the file name without extension. - ClassHelper: Now throwing exceptions passed to
requireObjectInstanceOf
. - RequestHelper: Added the
AcceptHeader
class for individual headers.
- ClassHelper: Added the new
ClassHelper
static class to help with class loading. - StyleCollection: Fixed mandatory
$important
parameter onstyleREM()
.
- FileHelper: Modified file and folder related methods to accept
SplFileInfo
instances. - FileHelper: Added
PHPFile
, which extendsFileInfo
. - FileHelper: Deprecated
checkPHPFileSyntax()
. UsePHPFile::checkSyntax()
instead. - FileHelper:
JSONFile
now extendsFileInfo
. - FileHelper:
SerializedFile
now extendsFileInfo
. - FileHelper: The class has been converted to strict typing.
- FileHelper: Fixed
FileInfo
throwing an exception when cast to string on not existing files. - Microtime: Added all format character constants in the new class
DateFormatChars
. - ConvertHelper: Added case insensitivity to
string2bool()
. - ConvertHelper: Added
string2words()
, using the newWordSplitter
class. - LipsumHelper: Added the helper, with a lipsum dummy text detection tool (#7).
- FileHelper: Removed the deprecated
openUnserialized()
method. - StringBuilder: Added
bool()
. - StringBuilder: Added
setSeparator()
to customize the separator character. - FileFinder: Added the
$enabled
parameter tomakeRecursive()
. - FileHelper: Added the
FileInfo
andFolderInfo
classes. - FileHelper: Modernized the code, and split into subclasses.
- FileHelper: Added
FolderInfo::getIterator()
. - Traits: Added the
StylableTrait
trait and matching interface. - Traits: Added the
AttributableTrait
trait and matching interface. - Traits: Added the
ClassableAttribute
trait and matching interface. - Classable: Removed type hints on
addClass()
for HTML_QuickForm compatibility. - Examples: Added a separate composer install for the examples UI.
- RGBAColor: Refactored entirely with color channels.
- StyleCollection: Added the utility class
StyleCollection
to handle CSS styles. - HTMLTag: Added the new tag builder utility class.
- Examples: Added a separate
composer.json
to solve composer dependency issues. - UnitTests: Tests are now included in the PHPStan analysis.
- UnitTests: Started modernizing tests with namespaces and type hinting.
- Code: PHPStan Analysis is now clean up to level 5.
- Code: Generalized type hinting update for PHP 7.4 (ongoing).
- BaseException: The previous parameter is now documented as accepting
Throwable
. - CSVHelper: Upgraded library to v1.3.
- Minimum PHP version requirement is now v7.4.
- Deprecated
FileHelper::findFiles()
. - Removed
$exit
parameter ofRequest::sendJSON()
. UsesendJSONAndExit()
instead. - Removed
$exit
parameter ofRequest::sendHTML()
. UsesendHTMLAndExit()
instead. - Removed deprecated methods:
FileHelper::createCSVParser()
.FileHelper::parseCSVString()
.FileHelper::parseCSVFile()
.FileHelper::getUTFBOMs()
.FileHelper::detectUTFBom()
.FileHelper::isValidUnicodeEncoding()
.
Removed the application-localization
installation from the configuration,
as there currently seems to be no easy fix to make it possible.
Removed this part:
dependencies:
override:
- COMPOSER_ROOT_VERSION=dev-master composer require mistralys/application-localization:1.4.1
- HTMLTag: Added the utility class
HTMLTag
to render HTML tags. - AttributeCollection: Added the utility class
AttributeCollection
to handle HTML tag attributes. - StringBuilder: Added support for using callables in the
ifXXX()
methods. - StringBuilder: Added
linkOpen()
andlinkClose()
. - Classable: Added the
hasClasses()
method to the interface and trait. - Code quality: PHPStan recommendations and improvements throughout.
- PHPClassInfo: Fixed the class needlessly requiring the parsed files.
- PHPClassInfo: Added support for traits.
- PHPClassInfo: Fixed false positives found in comments.
- ThrowableInfo: Fixed exception on unserializing a PDO exception.
- ThrowableInfo: Added support for string-based codes.
- ThrowableInfo: Added serialized data validation.
- ThrowableInfo: Added Microtime support.
- ThrowableInfo: Split some parts into subclasses for maintainability.
- ThrowableInfo: Fixed accessing and persisting exception class name and details.
- Microtime: Added
createNow()
. - Microtime: Added
createFromDate()
. - Microtime: Added
createFromMicrotime()
. - Microtime: Added
createFromString()
. - Microtime: Added a specific exception class,
Microtime_Exception
. - Microtime: Added getter methods for the relevant parts (year, month, date...)
- StringBuilder: Added
ifTrue()
,ifFalse()
,ifEmpty()
,ifNotEmpty()
. - DateInterval: Fixed an issue with negative hour values.
- RGBAColor: Added the new color information handling tool.
- ThrowableInfo: Added
getFinalCall()
for information on the most recent call. - ThrowableInfo: Added
hasDetails()
andgetDetails()
. - ThrowableInfo: Added
renderErrorMessage()
for a human-readable error message. - OperationResult: Added
makeException()
to use an exception as error message. - URLInfo: Added filtering of URL-Encoded newlines and tabs.
- NamedClosure: Added array support for the
$origin
parameter. - Internals: Added type hints to improve static code analysis.
- NumberInfo: Added the immutable variant with
parseNumberImmutable()
. - NumberInfo: Added
ceilEven()
andfloorEven()
. - NumberInfo: Modernized the class, now using strict typing.
- NumberInfo: Fixed some minor consistency issues with empty numbers.
- NumberInfo: Fixed the value not being updated when using
setNumber()
. - NumberInfo: Fixed the value having units when the raw value did not have any.
- OutputBuffering: Added the
OutputBuffering
helper class for simplifying output buffers. - StringBuilder: Added
tex()
for translation with context information for translators. - Dependencies: Translation now requires
mistralys/application-localization
v1.4.0. - Composer: Added
ext-gd
to the list of requirements for theImageHelper
.
- ConvertHelper: Added
boolStrict2string()
, a variant ofstring2bool
that only accepts boolean values. - DateTime: Added the
Microtime
class that extendsDateTime
to add millisecond and microsecond capability. - Interfaces: Added the interface
Interface_Stringable
for objects that can be converted to string.
- HTMLHelper: Added the new helper.
- HTMLHelper: Added
stripComments()
. - HTMLHelper: Added
injectAtEnd()
. - NumberInfo: Added
hasDecimals()
. - URLInfo: Added host IP address detection.
- URLInfo: Added the
hasIPAddress()
method to check if the host is an IP address. - URLInfo: Fixed case sensitivity issues in scheme and hostname.
- URLInfo: Added a fallback scheme detection if
parse_url
did not detect any. - URLFinder: Parser moved from a regex to a more reliable detection system.
- URLFinder: Added detection of relative paths in HTML documents.
- URLFinder: Added IPv4 address detection, with or without scheme.
- URLFinder: Added
tel:
link detection. - URLFinder: Added a top level domain extensions lookup helper under
ConvertHelper_URLFinder_DomainExtensions
. - RegexHelper: Added the
REGEX_IPV4
regex. - Documentation: Added wiki pages for additional helpers.
Older changelog entries can be found on GitHub: https://github.com/Mistralys/application-utils/releases