Recommend this page to a friend! |
Download .zip |
Info | Documentation | View files (47) | Download .zip | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2024-03-03 (25 days ago) | Not enough user ratings | Total: 277 This week: 1 | All time: 7,643 This week: 560 |
Version | License | PHP version | Categories | |||
esi_utility 2.0.0 | MIT/X Consortium ... | 8.2.0 | Tools, Libraries, PHP 7 |
Description | Author | |
This class provides a collection of various PHP utility functions. Currently it provides functions to: |
Utility is a small collection of useful functions that are aimed to make developers' lives just a tad bit easier.
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';
?>
Utility is a set of classes that are broken down into several "components":
Utilities
* Arrays * Conversion * Dates * Environment * Filesystem * Image * Numbers * Strings
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] =>
)
*/
?>
Please see docs or view online.
Bugs and feature requests are tracked on GitHub
Issues are the quickest way to report a bug. If you find a bug or documentation error, please check the following first:
Utility accepts contributions of code and documentation from the community. These contributions can be made in the form of Issues or Pull Requests on the Utility repository.
Utility is licensed under the MIT license. When submitting new features or patches to Utility, you are giving permission to license those features or patches under the MIT license.
Utility tries to adhere to PHPStan level 9 with strict rules and bleeding edge. Please ensure any contributions do as well.
Before we look into how, here are the guidelines. If your Pull Requests fail to pass these guidelines it will be declined, and you will need to re-submit when you?ve made the changes. This might sound a bit tough, but it is required for me to maintain quality of the code-base.
Please ensure all new contributions match the PSR-12 coding style guide. The project is not fully PSR-12 compatible, yet; however, to ensure the easiest transition to the coding guidelines, I would like to go ahead and request that any contributions follow them.
If you change anything that requires a change to documentation then you will need to add it. New methods, parameters, changing default values, adding constants, etc. are all things that will require a change to documentation. The change-log must also be updated for every change. Also, PHPDoc blocks must be maintained.
Please ensure all new contributions adhere to:
when documenting new functions, or changing existing documentation.
One thing at a time: A pull request should only contain one change. That does not mean only one commit, but one change - however many commits it took. The reason for this is that if you change X and Y but send a pull request for both at the same time, we might really want X but disagree with Y, meaning we cannot merge the request. Using the Git-Flow branching model you can create new branches for both of these features and send two requests.
Eric Sizemore - <admin@secondversion.com> - <https://www.secondversion.com>
Utility is licensed under the MIT License - see the LICENSE
file for details
This library is inspired by Brandon Wamboldt's utilphp library.
Files |
File | Role | Description | ||
---|---|---|---|---|
.github (2 files, 1 directory) | ||||
docs (11 files) | ||||
src (8 files) | ||||
tests (1 file, 2 directories) | ||||
.php-cs-fixer.dist.php | Example | Example script | ||
.scrutinizer.yml | Data | Auxiliary data | ||
CHANGELOG.md | Data | Auxiliary data | ||
composer.json | Data | Auxiliary data | ||
composer.lock | Data | Auxiliary data | ||
LICENSE.md | Lic. | License text | ||
mkdocs.yml | Data | Auxiliary data | ||
phpstan.neon | Data | Auxiliary data | ||
phpunit.xml | Data | Auxiliary data | ||
README.md | Doc. | Documentation | ||
SECURITY.md | Data | Auxiliary data |
Files | / | .github |
File | Role | Description | ||
---|---|---|---|---|
workflows (2 files) | ||||
dependabot.yml | Data | Auxiliary data | ||
FUNDING.yml | Data | Auxiliary data |
Files | / | docs |
File | Role | Description |
---|---|---|
arrays.md | Data | Auxiliary data |
basic-usage.md | Data | Auxiliary data |
conversion.md | Data | Auxiliary data |
dates.md | Data | Auxiliary data |
environment.md | Data | Auxiliary data |
filesystem.md | Data | Auxiliary data |
image.md | Data | Auxiliary data |
index.md | Data | Auxiliary data |
installation.md | Data | Auxiliary data |
numbers.md | Data | Auxiliary data |
strings.md | Data |
Files | / | src |
File | Role | Description |
---|---|---|
Arrays.php | Class | Class source |
Conversion.php | Class | Class source |
Dates.php | Class | Class source |
Environment.php | Class | Class source |
Filesystem.php | Class | Class source |
Image.php | Class | Class source |
Numbers.php | Class | Class source |
Strings.php | Class | Class source |
Files | / | tests |
File | Role | Description | ||
---|---|---|---|---|
resources (4 files) | ||||
src (8 files) | ||||
bootstrap.php | Aux. | Auxiliary script |
Files | / | tests | / | resources |
File | Role | Description |
---|---|---|
notAnImage.txt | Data | Auxiliary data |
testImage.gif | Icon | Icon image |
testImage.jpg | Icon | Icon image |
testImage.png | Icon | Icon image |
Files | / | tests | / | src |
File | Role | Description |
---|---|---|
ArraysTest.php | Class | Class source |
ConversionTest.php | Class | Class source |
DatesTest.php | Class | Class source |
EnvironmentTest.php | Class | Class source |
FilesystemTest.php | Class | Class source |
ImageTest.php | Class | Class source |
NumbersTest.php | Class | Class source |
StringsTest.php | Class | Class source |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
97% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.