Skip to content

Commit cb73a57

Browse files
committed
+ Value interface
1 parent bcd1beb commit cb73a57

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

src/Value/AbstractValue.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
* @author Maximilian Eul
2929
*/
3030
abstract class AbstractValue
31+
implements Value
3132
{
3233

3334
/**

src/Value/Value.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
namespace mle86\Value;
3+
4+
5+
/**
6+
* The interface of all value classes,
7+
* i.e. AbstractValue and AbstractSerializableValue.
8+
*
9+
* It just specifies that Value classes should have a 'value' method
10+
* and a one-argument constructor, although those classes have another
11+
* important requirement: being immutable. But we cannot encode that
12+
* in an interface.
13+
*
14+
* @author Maximilian Eul
15+
*/
16+
interface Value {
17+
18+
public function value ();
19+
20+
public function __construct ($raw_value);
21+
22+
}
23+

0 commit comments

Comments
 (0)