forked from Gregwar/RST
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathReference.php
39 lines (35 loc) · 933 Bytes
/
Reference.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
namespace Gregwar\RST;
/**
* A reference is something that can be resolved in the document, for instance:
*
* :method:`helloWorld()`
*
* Will be resolved as a reference of type method and the given reference will
* be called to resolve it
*/
abstract class Reference
{
/**
* The name of the reference, i.e the :something:
*/
abstract public function getName();
/**
* Resolve the reference and returns an array
*
* @param $environment the Environment in use
* @param $data the data of the reference
*
* @return array an array with key title and url
*/
abstract public function resolve(Environment $environment, $data);
/**
* Called when a reference is just found
*
* @param $environment the Environment in use
* @param $data the data of the reference
*/
public function found(Environment $environment, $data)
{
}
}