Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/codekandis/converters
`codekandis/converters` is a library providing converter interfaces and classes.
https://github.com/codekandis/converters
Last synced: 16 days ago
JSON representation
`codekandis/converters` is a library providing converter interfaces and classes.
- Host: GitHub
- URL: https://github.com/codekandis/converters
- Owner: codekandis
- License: mit
- Created: 2021-10-17T17:11:18.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-05-22T22:31:18.000Z (6 months ago)
- Last Synced: 2024-05-22T23:25:28.004Z (6 months ago)
- Language: PHP
- Size: 303 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# codekandis/converters
[![Version][xtlink-version-badge]][srclink-changelog]
[![License][xtlink-license-badge]][srclink-license]
[![Minimum PHP Version][xtlink-php-version-badge]][xtlink-php-net]
![Code Coverage][xtlink-code-coverage-badge]`codekandis/converters` is a library providing converter interfaces and classes.
## Index
* [Installation](#installation)
* [How to use](#how-to-use)
* [List of converters](#list-of-converters)## Installation
Install the latest version with
```bash
$ composer require codekandis/converters
```## How to use
### Unidirectional converters
```php
$value = false;( new IntegerToBinaryStringUniDirectionalConverter() )
->convert( $value );
/**
* 0
*/$value = 0;
( new BinaryStringToIntegerUniDirectionalConverter() )
->convert( $value );
/**
* false
*/
```### Bidirectional converters
```php
$value = 42;( new IntegerToBinaryStringBiDirectionalConverter() )
->convertTo( $value );
/**
* '101010'
*/$value = '101010';
( new IntegerToBinaryStringBiDirectionalConverter() )
->convertFrom( $value );
/**
* 42
*/
```## List of converters
[See the documentation][doclink] for further information about all available base and concreate converters.
[xtlink-version-badge]: https://img.shields.io/badge/version-1.0.0-blue.svg
[xtlink-license-badge]: https://img.shields.io/badge/license-MIT-yellow.svg
[xtlink-php-version-badge]: https://img.shields.io/badge/php-%3E%3D%208.3-8892BF.svg
[xtlink-code-coverage-badge]: https://img.shields.io/badge/coverage-100%25-green.svg
[xtlink-php-net]: https://php.net[srclink-changelog]: ./CHANGELOG.md
[srclink-license]: ./LICENSE[doclink]: ./docs/README.md