Skip to content
This repository has been archived by the owner on Feb 1, 2020. It is now read-only.

Commit

Permalink
Adding 1.0 documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
kherge committed Sep 20, 2013
1 parent d5ee72e commit df00d0f
Show file tree
Hide file tree
Showing 17 changed files with 851 additions and 3 deletions.
8 changes: 8 additions & 0 deletions docs/1.0.0/1. Namespaces.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Namespaces
==========

This is a complete list of available namespaces:

- [`Phine`](Phine)
- [`Phine\Observer`](Phine/Observer)
- [`Phine\Observer\Exception`](Phine/Observer/Exception)
10 changes: 10 additions & 0 deletions docs/1.0.0/2. Classes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Classes
=======

This is a complete list of available classes:

- [`Phine\Observer\ArrayCollection`](Phine/Observer/ArrayCollection.md) — Manages an array accessible collection of subjects.
- [`Phine\Observer\Collection`](Phine/Observer/Collection.md) — Manages a collection of subjects.
- [`Phine\Observer\Exception\CollectionException`](Phine/Observer/Exception/CollectionException.md) — Exception thrown when a problem with the collection is encountered.
- [`Phine\Observer\Exception\ReasonException`](Phine/Observer/Exception/ReasonException.md) — A throwable reason for interrupting an observer update.
- [`Phine\Observer\Subject`](Phine/Observer/Subject.md) — The default implementation of the {@link SubjectInterface} interface.
9 changes: 9 additions & 0 deletions docs/1.0.0/3. Interfaces.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Interfaces
==========

This is a complete list of available interfaces:

- [`Phine\Observer\ArrayCollectionInterface`](Phine/Observer/ArrayCollectionInterface.md) — Defines how an array accessible subject collection class must be implemented.
- [`Phine\Observer\CollectionInterface`](Phine/Observer/CollectionInterface.md) — Defines how a subject collection class must be implemented.
- [`Phine\Observer\ObserverInterface`](Phine/Observer/ObserverInterface.md) — Defines how an observer class must be implemented.
- [`Phine\Observer\SubjectInterface`](Phine/Observer/SubjectInterface.md) — Defines how a subject class must be implemented.
1 change: 1 addition & 0 deletions docs/1.0.0/PROJECT_VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
master
77 changes: 77 additions & 0 deletions docs/1.0.0/Phine/Observer/ArrayCollection.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<small>Phine\Observer</small>

ArrayCollection
===============

Manages an array accessible collection of subjects.

Signature
---------

- It is a(n) **class**.
- It implements the [`ArrayCollectionInterface`](../../Phine/Observer/ArrayCollectionInterface.md) interface.
- It is a subclass of [`Collection`](../../Phine/Observer/Collection.md).

Methods
-------

The class defines the following methods:

- [`offsetExists()`](#offsetExists) &mdash; Checks if a subject is registered with this collection.
- [`offsetGet()`](#offsetGet) &mdash; Returns the subject with the unique identifier.
- [`offsetSet()`](#offsetSet) &mdash; Registers or replaces a subject with the unique identifier.
- [`offsetUnset()`](#offsetUnset) &mdash; Unregisters a subject from the collection.

### `offsetExists()` <a name="offsetExists"></a>

Checks if a subject is registered with this collection.

#### Signature

- It is a **public** method.
- It accepts the following parameter(s):
- `$id` (`string`) &mdash; The unique identifier of the subject.
- _Returns:_ Returns `true` if a subject with the given unique identifier is registered with this collection. If a subject is not found, `false` is returned.
- `boolean`

### `offsetGet()` <a name="offsetGet"></a>

Returns the subject with the unique identifier.

#### Signature

- It is a **public** method.
- It accepts the following parameter(s):
- `$id` (`string`) &mdash; The unique identifier.
- _Returns:_ The registered subject.
- [`SubjectInterface`](../../Phine/Observer/SubjectInterface.md)

### `offsetSet()` <a name="offsetSet"></a>

Registers or replaces a subject with the unique identifier.

#### Description

If a subject is not registered with the unique identifier, it will
be registered. If a subject has already been registered with the
unique identifier, it will be replaced instead.

#### Signature

- It is a **public** method.
- It accepts the following parameter(s):
- `$id` (`string`) &mdash; The unique identifier.
- `$subject` ([`SubjectInterface`](../../Phine/Observer/SubjectInterface.md)) &mdash; The subject to register.
- It does not return anything.

### `offsetUnset()` <a name="offsetUnset"></a>

Unregisters a subject from the collection.

#### Signature

- It is a **public** method.
- It accepts the following parameter(s):
- `$id` (`string`) &mdash; The unique identifier.
- It does not return anything.

78 changes: 78 additions & 0 deletions docs/1.0.0/Phine/Observer/ArrayCollectionInterface.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<small>Phine\Observer</small>

ArrayCollectionInterface
========================

Defines how an array accessible subject collection class must be implemented.

Signature
---------

- It is a(n) **interface**.
- It implements the following interfaces:
- [`ArrayAccess`](http://php.net/class.ArrayAccess)
- [`Phine\Observer\CollectionInterface`](../../Phine/Observer/CollectionInterface.md) &mdash; Defines how a subject collection class must be implemented.

Methods
-------

The interface defines the following methods:

- [`offsetExists()`](#offsetExists) &mdash; Checks if a subject is registered with this collection.
- [`offsetGet()`](#offsetGet) &mdash; Returns the subject with the unique identifier.
- [`offsetSet()`](#offsetSet) &mdash; Registers or replaces a subject with the unique identifier.
- [`offsetUnset()`](#offsetUnset) &mdash; Unregisters a subject from the collection.

### `offsetExists()` <a name="offsetExists"></a>

Checks if a subject is registered with this collection.

#### Signature

- It is a **public** method.
- It accepts the following parameter(s):
- `$id` (`string`) &mdash; The unique identifier of the subject.
- _Returns:_ Returns `true` if a subject with the given unique identifier is registered with this collection. If a subject is not found, `false` is returned.
- `boolean`

### `offsetGet()` <a name="offsetGet"></a>

Returns the subject with the unique identifier.

#### Signature

- It is a **public** method.
- It accepts the following parameter(s):
- `$id` (`string`) &mdash; The unique identifier.
- _Returns:_ The registered subject.
- [`SubjectInterface`](../../Phine/Observer/SubjectInterface.md)

### `offsetSet()` <a name="offsetSet"></a>

Registers or replaces a subject with the unique identifier.

#### Description

If a subject is not registered with the unique identifier, it will
be registered. If a subject has already been registered with the
unique identifier, it will be replaced instead.

#### Signature

- It is a **public** method.
- It accepts the following parameter(s):
- `$id` (`string`) &mdash; The unique identifier.
- `$subject` ([`SubjectInterface`](../../Phine/Observer/SubjectInterface.md)) &mdash; The subject to register.
- It does not return anything.

### `offsetUnset()` <a name="offsetUnset"></a>

Unregisters a subject from the collection.

#### Signature

- It is a **public** method.
- It accepts the following parameter(s):
- `$id` (`string`) &mdash; The unique identifier.
- It does not return anything.

105 changes: 105 additions & 0 deletions docs/1.0.0/Phine/Observer/Collection.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
<small>Phine\Observer</small>

Collection
==========

Manages a collection of subjects.

Signature
---------

- It is a(n) **class**.
- It implements the [`CollectionInterface`](../../Phine/Observer/CollectionInterface.md) interface.

Methods
-------

The class defines the following methods:

- [`getSubject()`](#getSubject) &mdash; Returns the subject with the unique identifier.
- [`isSubjectRegistered()`](#isSubjectRegistered) &mdash; Checks if a subject is registered with this collection.
- [`registerSubject()`](#registerSubject) &mdash; Registers a new subject with the collection.
- [`replaceSubject()`](#replaceSubject) &mdash; Replaces a subject registered with a unique identifier.
- [`unregisterSubject()`](#unregisterSubject) &mdash; Unregisters a subject from the collection.
- [`updateSubject()`](#updateSubject) &mdash; Triggers an update for the subject with the unique identifier.

### `getSubject()` <a name="getSubject"></a>

Returns the subject with the unique identifier.

#### Signature

- It is a **public** method.
- It accepts the following parameter(s):
- `$id` (`string`) &mdash; The unique identifier.
- _Returns:_ The registered subject.
- [`SubjectInterface`](../../Phine/Observer/SubjectInterface.md)
- It throws one of the following exceptions:
- `CollectionException` &mdash; If the unique identifier is not used.

### `isSubjectRegistered()` <a name="isSubjectRegistered"></a>

Checks if a subject is registered with this collection.

#### Signature

- It is a **public** method.
- It accepts the following parameter(s):
- `$id` (`string`) &mdash; The unique identifier of the subject.
- _Returns:_ Returns `true` if a subject with the given unique identifier is registered with this collection. If a subject is not found, `false` is returned.
- `boolean`

### `registerSubject()` <a name="registerSubject"></a>

Registers a new subject with the collection.

#### Signature

- It is a **public** method.
- It accepts the following parameter(s):
- `$id` (`string`) &mdash; The unique identifier.
- `$subject` ([`SubjectInterface`](../../Phine/Observer/SubjectInterface.md)) &mdash; The subject to register.
- It does not return anything.
- It throws one of the following exceptions:
- `CollectionException` &mdash; If the unique identifier is already used.

### `replaceSubject()` <a name="replaceSubject"></a>

Replaces a subject registered with a unique identifier.

#### Signature

- It is a **public** method.
- It accepts the following parameter(s):
- `$id` (`string`) &mdash; The unique identifier.
- `$subject` ([`SubjectInterface`](../../Phine/Observer/SubjectInterface.md)) &mdash; The new subject.
- It does not return anything.
- It throws one of the following exceptions:
- `CollectionException` &mdash; If the unique identifier is not used.

### `unregisterSubject()` <a name="unregisterSubject"></a>

Unregisters a subject from the collection.

#### Signature

- It is a **public** method.
- It accepts the following parameter(s):
- `$id` (`string`) &mdash; The unique identifier.
- It does not return anything.
- It throws one of the following exceptions:
- `CollectionException` &mdash; If the unique identifier is not used.

### `updateSubject()` <a name="updateSubject"></a>

Triggers an update for the subject with the unique identifier.

#### Signature

- It is a **public** method.
- It accepts the following parameter(s):
- `$id` (`string`) &mdash; The unique identifier.
- It does not return anything.
- It throws one of the following exceptions:
- `CollectionException` &mdash; If the unique identifier is not used.

Loading

0 comments on commit df00d0f

Please sign in to comment.