Skip to content

Commit 5c473ca

Browse files
committed
Added RenderInterface::getDiffObject, RenderInterface::setDiffObject
1 parent 121a623 commit 5c473ca

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed

src/Diff/Renderer/AbstractRender.php

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ abstract class AbstractRender implements RenderInterface
3131
* Instance of the diff class that this renderer is generating the rendered diff for.
3232
* @var Diff
3333
*/
34-
public $diff;
34+
protected $diff;
3535

3636
/**
3737
* Array of the default options that apply to this renderer.
@@ -70,4 +70,27 @@ public function setOptions(array $options)
7070

7171
return $this;
7272
}
73+
74+
/**
75+
* {@inheritdoc}
76+
*
77+
* @return Diff
78+
*/
79+
public function getDiffObject()
80+
{
81+
return $this->diff;
82+
}
83+
84+
/**
85+
* {@inheritdoc}
86+
*
87+
* @param Diff $diff
88+
* @return $this
89+
*/
90+
public function setDiffObject(Diff $diff)
91+
{
92+
$this->diff = $diff;
93+
94+
return $this;
95+
}
7396
}

src/Diff/Renderer/RenderInterface.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818

1919
namespace Phalcon\Diff\Render;
2020

21+
use Phalcon\Diff;
22+
2123
/**
2224
* Render Interface
2325
*/
@@ -29,4 +31,19 @@ interface RenderInterface
2931
* @return string
3032
*/
3133
public function render();
34+
35+
/**
36+
* Gets Diff object.
37+
*
38+
* @return Diff $diff
39+
*/
40+
public function getDiffObject();
41+
42+
/**
43+
* Sets Diff object.
44+
*
45+
* @param Diff $diff
46+
* @return RenderInterface
47+
*/
48+
public function setDiffObject(Diff $diff);
3249
}

0 commit comments

Comments
 (0)