This repository has been archived by the owner on Feb 1, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
851 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) — Checks if a subject is registered with this collection. | ||
- [`offsetGet()`](#offsetGet) — Returns the subject with the unique identifier. | ||
- [`offsetSet()`](#offsetSet) — Registers or replaces a subject with the unique identifier. | ||
- [`offsetUnset()`](#offsetUnset) — 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`) — 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`) — 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`) — The unique identifier. | ||
- `$subject` ([`SubjectInterface`](../../Phine/Observer/SubjectInterface.md)) — 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`) — The unique identifier. | ||
- It does not return anything. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) — Defines how a subject collection class must be implemented. | ||
|
||
Methods | ||
------- | ||
|
||
The interface defines the following methods: | ||
|
||
- [`offsetExists()`](#offsetExists) — Checks if a subject is registered with this collection. | ||
- [`offsetGet()`](#offsetGet) — Returns the subject with the unique identifier. | ||
- [`offsetSet()`](#offsetSet) — Registers or replaces a subject with the unique identifier. | ||
- [`offsetUnset()`](#offsetUnset) — 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`) — 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`) — 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`) — The unique identifier. | ||
- `$subject` ([`SubjectInterface`](../../Phine/Observer/SubjectInterface.md)) — 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`) — The unique identifier. | ||
- It does not return anything. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) — Returns the subject with the unique identifier. | ||
- [`isSubjectRegistered()`](#isSubjectRegistered) — Checks if a subject is registered with this collection. | ||
- [`registerSubject()`](#registerSubject) — Registers a new subject with the collection. | ||
- [`replaceSubject()`](#replaceSubject) — Replaces a subject registered with a unique identifier. | ||
- [`unregisterSubject()`](#unregisterSubject) — Unregisters a subject from the collection. | ||
- [`updateSubject()`](#updateSubject) — 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`) — The unique identifier. | ||
- _Returns:_ The registered subject. | ||
- [`SubjectInterface`](../../Phine/Observer/SubjectInterface.md) | ||
- It throws one of the following exceptions: | ||
- `CollectionException` — 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`) — 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`) — The unique identifier. | ||
- `$subject` ([`SubjectInterface`](../../Phine/Observer/SubjectInterface.md)) — The subject to register. | ||
- It does not return anything. | ||
- It throws one of the following exceptions: | ||
- `CollectionException` — 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`) — The unique identifier. | ||
- `$subject` ([`SubjectInterface`](../../Phine/Observer/SubjectInterface.md)) — The new subject. | ||
- It does not return anything. | ||
- It throws one of the following exceptions: | ||
- `CollectionException` — 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`) — The unique identifier. | ||
- It does not return anything. | ||
- It throws one of the following exceptions: | ||
- `CollectionException` — 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`) — The unique identifier. | ||
- It does not return anything. | ||
- It throws one of the following exceptions: | ||
- `CollectionException` — If the unique identifier is not used. | ||
|
Oops, something went wrong.