Part of the h4kuna PHP libraries, see the overview of all packages.
$ composer require h4kuna/data-typeRequires PHP 8.2.
- Basic - Arrays, BitwiseOperations, Bools, Floats, Integer, Lists, Set, Strings
- Collection - Counter, LazyBuilder, StrictTypeArray, JsonToHtml
- Date - Czech Calendar, Easter, Parser, Time, Convert, Interval, Sleep
- Iterators - TextIterator, CsvIterator, FlattenArrayRecursiveIterator, PeriodDayFactory, ActiveWait, ReverseIterator
- Location - Gps
- Number - Math, RomeNumber
All runtime exceptions extend h4kuna\DataType\Exceptions\DataTypeException (a RuntimeException):
InvalidTypeException- a value cannot be converted to the requested typeInvalidArgumentsException- input data cannot be processed (date format, GPS format, ...)ActiveWaitTimeoutException-ActiveWaittimeout expired
Wrong usage of the library throws h4kuna\DataType\Exceptions\LogicException, do not catch it, fix the code.