Download the PHP package phprise/common-contract without Composer
On this page you can find all versions of the php package phprise/common-contract. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download phprise/common-contract
More information about phprise/common-contract
Files in phprise/common-contract
Package common-contract
Short Description Common contracts to general usage based in OTAKU philosophy
License MIT
Informations about the package common-contract
PHPRise Common Contract
Common contracts and interfaces for general usage based on the OTAKU philosophy. This library provides a set of standard interfaces to ensure consistent behavior across your value objects and entities, specifically focusing on string transformations and array conversions.
Installation
Available Contracts
This package provides the following interfaces in the Phprise\Common\Contract namespace:
Transformation Interfaces
| Interface | Method | return type | Description |
|---|---|---|---|
Arrayable |
toArray() |
array |
Converts the object to an array representation. |
Camelable |
toCamel() |
string |
Converts the object's value to camelCase. |
Kebabable |
toKebab() |
string |
Converts the object's value to kebab-case. |
Lowerable |
toLower() |
string |
Converts the object's value to lowercase. |
Pascalable |
toPascal() |
string |
Converts the object's value to PascalCase. |
Snakeable |
toSnake() |
string |
Converts the object's value to snake_case. |
Titleable |
toTitle() |
string |
Converts the object's value to Title Case. |
Upperable |
toUpper() |
string |
Converts the object's value to UPPERCASE. |
Usage Examples
Here is how you might implement these interfaces in a Value Object:
Philosophy
We follow The OTAKU Manifesto: Fluid Structure Design.
- O - Own your Discipline
- T - Tools for Composition
- A - Armor the Core
- K - Keep Infrastructure Silent
- U - Universal Language & Contracts
Please read more about it in PHILOSOPHY.md.
License
MIT License
Contributing
See how to contribute in CONTRIBUTING.md.
Code of Conduct
See our code of conduct in CODE_OF_CONDUCT.md.
Security
See our security policy in SECURITY.md.