1<p align="center">
2  <img src="https://static.hoa-project.net/Image/Hoa.svg" alt="Hoa" width="250px" />
3</p>
4
5---
6
7<p align="center">
8  <a href="https://travis-ci.org/hoaproject/visitor"><img src="https://img.shields.io/travis/hoaproject/visitor/master.svg" alt="Build status" /></a>
9  <a href="https://coveralls.io/github/hoaproject/visitor?branch=master"><img src="https://img.shields.io/coveralls/hoaproject/visitor/master.svg" alt="Code coverage" /></a>
10  <a href="https://packagist.org/packages/hoa/visitor"><img src="https://img.shields.io/packagist/dt/hoa/visitor.svg" alt="Packagist" /></a>
11  <a href="https://hoa-project.net/LICENSE"><img src="https://img.shields.io/packagist/l/hoa/visitor.svg" alt="License" /></a>
12</p>
13<p align="center">
14  Hoa is a <strong>modular</strong>, <strong>extensible</strong> and
15  <strong>structured</strong> set of PHP libraries.<br />
16  Moreover, Hoa aims at being a bridge between industrial and research worlds.
17</p>
18
19# Hoa\Visitor
20
21[![Help on IRC](https://img.shields.io/badge/help-%23hoaproject-ff0066.svg)](https://webchat.freenode.net/?channels=#hoaproject)
22[![Help on Gitter](https://img.shields.io/badge/help-gitter-ff0066.svg)](https://gitter.im/hoaproject/central)
23[![Documentation](https://img.shields.io/badge/documentation-hack_book-ff0066.svg)](https://central.hoa-project.net/Documentation/Library/Visitor)
24[![Board](https://img.shields.io/badge/organisation-board-ff0066.svg)](https://waffle.io/hoaproject/visitor)
25
26This library provides interfaces to apply the visitor pattern.
27
28[Learn more](https://central.hoa-project.net/Documentation/Library/Visitor).
29
30## Installation
31
32With [Composer](https://getcomposer.org/), to include this library into
33your dependencies, you need to
34require [`hoa/visitor`](https://packagist.org/packages/hoa/visitor):
35
36```sh
37$ composer require hoa/visitor '~2.0'
38```
39
40For more installation procedures, please read [the Source
41page](https://hoa-project.net/Source.html).
42
43## Testing
44
45Before running the test suites, the development dependencies must be installed:
46
47```sh
48$ composer install
49```
50
51Then, to run all the test suites:
52
53```sh
54$ vendor/bin/hoa test:run
55```
56
57For more information, please read the [contributor
58guide](https://hoa-project.net/Literature/Contributor/Guide.html).
59
60## Quick usage
61
62We propose to explain the basis of this library. We have two entities: an
63element to visit and a visitor, for example a node of a tree and a dumper. The
64element to visit will implement the `Hoa\Visitor\Element` interface and the
65visitor will implement the `Hoa\Visitor\Visit` interface. The first one will ask
66to implement the `accept` method in order to define what data it holds will be
67visited. The second one will ask to implement the `visit` method which will
68contain the visitor computations. We will find several examples in Hoa
69libraries.
70
71## Documentation
72
73The
74[hack book of `Hoa\Visitor`](https://central.hoa-project.net/Documentation/Library/Visitor)
75contains detailed information about how to use this library and how it works.
76
77To generate the documentation locally, execute the following commands:
78
79```sh
80$ composer require --dev hoa/devtools
81$ vendor/bin/hoa devtools:documentation --open
82```
83
84More documentation can be found on the project's website:
85[hoa-project.net](https://hoa-project.net/).
86
87## Getting help
88
89There are mainly two ways to get help:
90
91  * On the [`#hoaproject`](https://webchat.freenode.net/?channels=#hoaproject)
92    IRC channel,
93  * On the forum at [users.hoa-project.net](https://users.hoa-project.net).
94
95## Contribution
96
97Do you want to contribute? Thanks! A detailed [contributor
98guide](https://hoa-project.net/Literature/Contributor/Guide.html) explains
99everything you need to know.
100
101## License
102
103Hoa is under the New BSD License (BSD-3-Clause). Please, see
104[`LICENSE`](https://hoa-project.net/LICENSE) for details.
105