esi / utility
Utility - Collection of various PHP utility functions.
Fund package maintenance!
ko-fi.com/ericsizemore
ericsizemore
Tidelift
Installs: 1 821
Dependents: 1
Suggesters: 0
Security: 0
Stars: 4
Watchers: 3
Forks: 3
Open Issues: 2
Requires
- php: ^8.2 <8.5
- ext-json: *
- ext-mbstring: *
- esi/clock: ^1.0
- ralouphie/getallheaders: ^3.0
- voku/portable-ascii: ^2.0
Requires (Dev)
- esi/phpunit-coverage-check: ^2.0
- friendsofphp/php-cs-fixer: ^3.54
- phpstan/phpstan: ^1.11
- phpstan/phpstan-phpunit: ^1.4
- phpstan/phpstan-strict-rules: ^1.6
- phpunit/phpunit: ^11.1
Suggests
- ext-exif: To be able to use Exif for guessing image types with Utility\Image
- ext-fileinfo: To be able to use finfo/fileinfo for guessing image types with Utility\Image
This package is auto-updated.
Last update: 2024-12-21 08:06:09 UTC
README
Utility is a small collection of useful functions that are aimed to make developers' lives just a tad bit easier.
Installation
Composer
Install the latest version with:
$ composer require esi/utility
Then, within your project (if not already included), include composer's autoload. For example:
<?php require 'vendor/autoload.php'; ?>
Basic Usage
Utility is a set of classes that are broken down into several "components":
Utilities
As an example, let's say you want to convert a string to title case. To do so:
<?php use Esi\Utility\Strings; $title = Strings::title('this is my title'); echo $title; ?>
All methods of found within Utility's classes are static. So, for example, to retrieve the information for a particular timezone:
<?php use Esi\Utility\Dates; $timezone = Dates::timezoneInfo('America/New_York'); print_r($timezone); /* Array ( [offset] => -5 [country] => US [latitude] => 40.71416 [longitude] => -74.00639 [dst] => ) */ ?>
Documentation
Please see docs or view online.
About
Requirements
- Utility works with PHP 8.2.0 or above.
Credits
- Eric Sizemore
- All Contributors
- Special thanks to JetBrains for their Licenses for Open Source Development.
- Special thanks to Brandon Wamboldt and their utilphp library for the inspiration for
Esi\Utility
.
Contributing
See CONTRIBUTING.
Bugs and feature requests are tracked on GitHub.
Contributor Covenant Code of Conduct
Backward Compatibility Promise
See backward-compatibility.md for more information on Backwards Compatibility.
Changelog
See the CHANGELOG for more information on what has changed recently.
License
See the LICENSE for more information on the license that applies to this project.
Security
See SECURITY for more information on the security disclosure process.