PHPackages                             phprise/common-contract - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. phprise/common-contract

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

phprise/common-contract
=======================

Common contracts to general usage based in OTAKU philosophy

v1.0.0(2mo ago)020↓100%2MITPHPPHP ^8.4

Since Jan 6Pushed 2mo agoCompare

[ Source](https://github.com/phprise-foundation/common-contract)[ Packagist](https://packagist.org/packages/phprise/common-contract)[ RSS](/packages/phprise-common-contract/feed)WikiDiscussions 1.x Synced today

READMEChangelog (1)DependenciesVersions (2)Used By (2)

PHPRise 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
------------

[](#installation)

```
composer require phprise/common-contract
```

Available Contracts
-------------------

[](#available-contracts)

This package provides the following interfaces in the `Phprise\Common\Contract` namespace:

### Transformation Interfaces

[](#transformation-interfaces)

InterfaceMethodreturn typeDescription`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
--------------

[](#usage-examples)

Here is how you might implement these interfaces in a Value Object:

```
