Skip to content

Repository files navigation

PHP Forge

PHP Helper


PHPUnitMutation TestingPHPStan

Small, focused helpers for common PHP tasks
Convert word casing, inspect metadata, generate passwords, and list time zones with predictable output.

Features

Feature Overview

Installation

composer require php-forge/helper:^0.3

Quick start

Convert camelCase to snake_case

<?phpdeclare(strict_types=1);
namespaceApp;
usePHPForge\Helper\WordCaseConverter;
$word = WordCaseConverter::camelToSnake('dateBirth');
// date_birth

Convert snake_case to camelCase

<?phpdeclare(strict_types=1);
namespaceApp;
usePHPForge\Helper\WordCaseConverter;
$word = WordCaseConverter::snakeToCamel('date_birth');
// dateBirth

Convert text to title words

<?phpdeclare(strict_types=1);
namespaceApp;
usePHPForge\Helper\WordCaseConverter;
$word = WordCaseConverter::toTitleWords('dateOfMessage');
// Date Of Message

Generate passwords

<?phpdeclare(strict_types=1);
namespaceApp;
usePHPForge\Helper\PasswordGenerator;
$password = PasswordGenerator::generate(12);
// for example, aB3#kL9!mN2@

Retrieve all time zones

<?phpdeclare(strict_types=1);
namespaceApp;
usePHPForge\Helper\TimeZoneList;
$timezones = TimeZoneList::all();
// [['timezone' => 'Pacific/Midway', 'name' => 'Pacific/Midway (UTC -11:00)', 'offset' => -39600], ...]

Inspect class metadata with Reflector

<?phpdeclare(strict_types=1);
namespaceApp;
usePHPForge\Helper\Reflector;
$shortName = Reflector::shortName(\App\Domain\User::class);
$types = Reflector::propertyTypeNames(\App\Domain\User::class, 'email');
$attributes = Reflector::propertyAttributes(\App\Domain\User::class, 'email');

Documentation

For detailed configuration options and advanced usage.

Package information

PHPLatest Stable VersionTotal Downloads

Quality code

CodecovPHPStan Level MaxStyleCI

Our social networks

Follow on XFollow on Facebook

License

License

About

Small, focused helpers for common PHP tasks.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

2 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages

Generated from yii-tools/template