Skip to content

Commit 5b6994f

Browse files
committed
Merge pull request #18 from Taluu/change-interface
Fixes #17 : Add a ChangeInterface
2 parents cad008b + b15174f commit 5b6994f

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

src/AbstractChange.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* @author Baptiste Clavié <clavie.b@gmail.com>
1818
* @author Rémy Gazelot <rgazelot@gmail.com>
1919
*/
20-
abstract class AbstractChange
20+
abstract class AbstractChange implements ChangeInterface
2121
{
2222
/** old state */
2323
private $old;

src/ChangeInterface.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
/**
3+
* This file is part of the Totem package
4+
*
5+
* For the full copyright and license information, please view the LICENSE file
6+
* that was distributed with this source code.
7+
*
8+
* @copyright Baptiste Clavié <clavie.b@gmail.com>
9+
* @license http://www.opensource.org/licenses/MIT-License MIT License
10+
*/
11+
12+
namespace Totem;
13+
14+
/**
15+
* Represent a change in a data, with both values (before and after it was modified)
16+
*
17+
* @author Baptiste Clavié <clavie.b@gmail.com>
18+
*/
19+
interface ChangeInterface
20+
{
21+
/** @return mixed the data before it was changed */
22+
public function getOld();
23+
24+
/** @return mixed the data after it was changed */
25+
public function getNew();
26+
}
27+

0 commit comments

Comments
 (0)