Utilities
Utilities
These are useful utility classes and functions that provide features missing from PHP or offer convenient shorthand for common tasks. They are now organized under the Hazaar\Util namespace. For example, array-related utilities are found in Hazaar\Util\Arr.
Hazaar's utility classes are designed to make common programming tasks easier and more expressive. They provide a consistent, object-oriented interface for working with arrays, strings, numbers, dates, objects, and more. If you previously used global helper functions, you will now find their improved and expanded versions in the Hazaar\Util namespace. Explore the API documentation for each class to discover all available methods and features.
Tips
Refer to the API documentation or source code in the src/Util directory for a full list and details on each utility class.
Available Utilities
Here is a list of the utility classes available in the Hazaar\Util namespace:
- Arr - Enhanced array manipulation methods.
- Boolean - Boolean logic helper methods.
- BTree - B-Tree data structure implementation.
- Closure - Utilities for working with closures.
- Cron - Parse and evaluate cron expressions.
- DateTime - Extended date and time manipulation.
- Extender - Helper for extending objects.
- GeoData - Geographic data utilities.
- Interval - Date interval utilities.
- Money - Currency and money handling.
- Number - Number formatting and manipulation.
- Obj - Object handling utilities.
- RateLimiter - Rate limiting functionality.
- Socket - Socket communication helper.
- Str - String manipulation utilities.
- Timer - High-resolution timer for benchmarking.
- URL - URL parsing and manipulation.
- UserAgent - Decodes a
User-Agentstring into platform/browser info. - Version - Version string comparison and parsing.