Skip to content
This repository has been archived by the owner on Sep 20, 2021. It is now read-only.

Documentation: New README.md file #20

Merged
merged 1 commit into from
Oct 19, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 81 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,62 @@
![Hoa](http://static.hoa-project.net/Image/Hoa_small.png)

Hoa is a **modular**, **extensible** and **structured** set of PHP libraries.
Moreover, Hoa aims at being a bridge between industrial and research worlds.

# Hoa\Consistency ![state](http://central.hoa-project.net/State/Consistency)
<p align="center">
<img src="https://static.hoa-project.net/Image/Hoa.svg" alt="Hoa" width="250px" />
</p>

---

<p align="center">
<a href="https://travis-ci.org/hoaproject/consistency"><img src="https://img.shields.io/travis/hoaproject/consistency/master.svg" alt="Build status" /></a>
<a href="https://coveralls.io/github/hoaproject/consistency?branch=master"><img src="https://img.shields.io/coveralls/hoaproject/consistency/master.svg" alt="Code coverage" /></a>
<a href="https://packagist.org/packages/hoa/consistency"><img src="https://img.shields.io/packagist/dt/hoa/consistency.svg" alt="Packagist" /></a>
<a href="https://hoa-project.net/LICENSE"><img src="https://img.shields.io/packagist/l/hoa/consistency.svg" alt="License" /></a>
</p>
<p align="center">
Hoa is a <strong>modular</strong>, <strong>extensible</strong> and
<strong>structured</strong> set of PHP libraries.<br />
Moreover, Hoa aims at being a bridge between industrial and research worlds.
</p>

# Hoa\Consistency

[![Help on IRC](https://img.shields.io/badge/help-%23hoaproject-ff0066.svg)](https://webchat.freenode.net/?channels=#hoaproject)
[![Help on Gitter](https://img.shields.io/badge/help-gitter-ff0066.svg)](https://gitter.im/hoaproject/central)
[![Documentation](https://img.shields.io/badge/documentation-hack_book-ff0066.svg)](https://central.hoa-project.net/Documentation/Library/Consistency)
[![Board](https://img.shields.io/badge/organisation-board-ff0066.svg)](https://waffle.io/hoaproject/consistency)

This library provides a thin layer between PHP VMs and libraries to ensure
consistency accross VM versions and library versions.

[Learn more](https://central.hoa-project.net/Documentation/Library/Consistency).

## Installation

With [Composer](http://getcomposer.org/), to include this library into your
dependencies, you need to require
[`hoa/consistency`](https://packagist.org/packages/hoa/consistency):
With [Composer](https://getcomposer.org/), to include this library into
your dependencies, you need to
require [`hoa/consistency`](https://packagist.org/packages/hoa/consistency):

```json
{
"require": {
"hoa/consistency": "~1.0"
}
}
```sh
$ composer require hoa/consistency '~1.0'
```

For more installation procedures, please read [the Source
page](https://hoa-project.net/Source.html).

## Testing

Before running the test suites, the development dependencies must be installed:

```sh
$ composer install
```

Then, to run all the test suites:

```sh
$ vendor/bin/hoa test:run
```

Please, read the website to [get more informations about how to
install](http://hoa-project.net/Source.html).
For more information, please read the [contributor
guide](https://hoa-project.net/Literature/Contributor/Guide.html).

## Quick usage

Expand All @@ -36,28 +69,6 @@ autoloader](http://www.php-fig.org/psr/psr-4/) and the xcallable API.
The `Hoa\Consistency\Consistency` class ensures foreward and backward
compatibility.

#### Example with traits

For instance, it provides a [`trait_exists`](http://php.net/trait_exists)
function if it does not exist. This way, you are able to anticipate this new
feature even if your current PHP version does not support it:

```php
if (trait_exists('Foo')) { …
```

Also, we are able to build a complete
`Hoa\Consistency\Consistency::entityExists` method that checks whether any kind
of entity (class, interface or trait) exists. Even if your current PHP version
does not support traits, it will work. And when you will upgrade, the new check
will be free:

```php
if (false === Hoa\Consistency\Consistency::entityExist('foo')) {
// load it.
}
```

#### Example with keywords

The `Hoa\Consistency\Consistency::isKeyword` checks whether a specific word is
Expand Down Expand Up @@ -146,9 +157,9 @@ $baz = new Foo\Bar\Baz(); // automatically loaded!

Xcallables are “extended callables”. It is a unified API to invoke callables of
any kinds, and also extends some Hoa's API (like
[`Hoa\Event`](http://central.hoa-project.net/Resource/Library/Event)
[`Hoa\Event`](https://central.hoa-project.net/Resource/Library/Event)
or
[`Hoa\Stream`](http://central.hoa-project.net/Resource/Library/Stream)). It
[`Hoa\Stream`](https://central.hoa-project.net/Resource/Library/Stream)). It
understands the following kinds:
* `'function'` as a string,
* `'class::method'` as a string,
Expand Down Expand Up @@ -230,10 +241,35 @@ on the `hoa://Event/Exception` event channel.

## Documentation

Different documentations can be found on the website:
[http://hoa-project.net/](http://hoa-project.net/).
The
[hack book of `Hoa\Consistency`](https://central.hoa-project.net/Documentation/Library/Consistency)
contains detailed information about how to use this library and how it works.

To generate the documentation locally, execute the following commands:

```sh
$ composer require --dev hoa/devtools
$ vendor/bin/hoa devtools:documentation --open
```

More documentation can be found on the project's website:
[hoa-project.net](https://hoa-project.net/).

## Getting help

There are mainly two ways to get help:

* On the [`#hoaproject`](https://webchat.freenode.net/?channels=#hoaproject)
IRC channel,
* On the forum at [users.hoa-project.net](https://users.hoa-project.net).

## Contribution

Do you want to contribute? Thanks! A detailed [contributor
guide](https://hoa-project.net/Literature/Contributor/Guide.html) explains
everything you need to know.

## License

Hoa is under the New BSD License (BSD-3-Clause). Please, see
[`LICENSE`](http://hoa-project.net/LICENSE).
Hoa is under the New BSD License (BSD-3-Clause). Please, see
[`LICENSE`](https://hoa-project.net/LICENSE) for details.