randsonjs / inflect
A PHP class to handle words in Portuguese
Installs: 9 770
Dependents: 0
Suggesters: 0
Security: 0
Stars: 17
Watchers: 5
Forks: 1
Open Issues: 0
Type:package
Requires (Dev)
- phpunit/phpunit: ~4.3
This package is not auto-updated.
Last update: 2024-12-18 14:41:29 UTC
README
A PHP class to handle words in Portuguese
Dependencies
Usage
Examples of usage of the Inflect(i.e portuguese).
<?php use Inflect\Inflect $inflector = new Inflect; $inflector->pluralize('pão'); // pães $inflector->pluralize('carro'); // carros $inflector->singularize('carros'); // carro $inflector->singularize('pães'); // pão $inflector->camelize('tablename'); // TableName $inflector->camelize('tablename', true); // tableName
You can also use it without instantiating the object trought the Facade
class
<?php use Inflect\Facade as Inflect; // Use facade to be able to do static calls Inflect::pluralize('carro'); // carros Inflect::singularize('carros'); // carro Inflect::camelize('tablename'); // TableName
Installation
The recommended way to install this package is through composer.
Create a composer.json
file.
{ "minimum-stability": "dev", "require": { "randsonjs/inflect": "*" } }
Run command to install it.
$ composer install
File Structure
. |-- src/ |-- tests/ |-- .editorconfig |-- .gitignore |-- composer.json
src/
The main files of package, in this directory you will find the Inflect class.
tests/
The tests directory for Inflect class. Tests are made using PHPUnit.
.editorconfig
This file is for unifying the coding style for different editors and IDEs.
Check editorconfig.org if you haven't heard about this project.
.gitignore
List of files that we don't want Git to track.
Check this Git Ignoring Files Guide for more details.
composer.json
Specify all dependencies loaded via Composer.
Check composer.json Project Setup for more details.
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
License
MIT License © Randson Oliveira