php-forge/helpers

Collection of Helper for PHP.

0.1.0 2024-02-25 13:42 UTC

This package is auto-updated.

Last update: 2024-04-25 14:07:48 UTC


README

103309199?s%25253D400%252526u%25253Dca3561c692f53ed7eb290d3bb226a2828741606f%252526v%25253D4

Collection of Helper for PHP.


PHPUnit Codecov Infection Psalm Psalm Coverage StyleCI

Installation

The preferred way to install this extension is through composer.

Either run

composer require --prefer-dist php-forge/helpers:"^0.1"

or add

"php-forge/helpers": "^0.1"

Usage

The repository contains a collection of utility functions designed to simplify common programming tasks in PHP.

Whether you're working on web development, data processing, or other projects, these helper functions can save you time and effort.

Converts a camelCase formatted string to snake_case

<?php

declare(strict_types=1);

use PHPForge\Helper\WordFormatter;

$word = WordFormatter::camelCaseToSnakeCase('date_birth');

Convert a snake_case formatted string to camelCase

<?php

declare(strict_types=1);

use PHPForge\Helper\WordFormatter;

$word = WordFormatter::snakeCaseToCamelCase('date_birth');

Converts a string to words with capitalized first letters

<?php

declare(strict_types=1);

use PHPForge\Helper\WordFormatter;

$word = WordFormatter::capitalizeToWords('Date Birth');

Generate ramdon pasword

<?php

declare(strict_types=1);

use PHPForge\Helper\Password;

$password = Password::generate(8);

Get all timezones

<?php

declare(strict_types=1);

use PHPForge\Helper\Timezone;

$timezones = Timezone::getAll();

Testing

Check the documentation testing to learn about testing.

Support versions

PHP81

License

The MIT License (MIT). Please see License File for more information.

Our social networks

Twitter