aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/bookmark/Bookmark.php
diff options
context:
space:
mode:
Diffstat (limited to 'application/bookmark/Bookmark.php')
-rw-r--r--application/bookmark/Bookmark.php15
1 files changed, 8 insertions, 7 deletions
diff --git a/application/bookmark/Bookmark.php b/application/bookmark/Bookmark.php
index 83ddab82..90ff5b16 100644
--- a/application/bookmark/Bookmark.php
+++ b/application/bookmark/Bookmark.php
@@ -3,6 +3,7 @@
3namespace Shaarli\Bookmark; 3namespace Shaarli\Bookmark;
4 4
5use DateTime; 5use DateTime;
6use DateTimeInterface;
6use Shaarli\Bookmark\Exception\InvalidBookmarkException; 7use Shaarli\Bookmark\Exception\InvalidBookmarkException;
7 8
8/** 9/**
@@ -42,10 +43,10 @@ class Bookmark
42 /** @var bool Set to true if the bookmark is set as sticky */ 43 /** @var bool Set to true if the bookmark is set as sticky */
43 protected $sticky; 44 protected $sticky;
44 45
45 /** @var DateTime Creation datetime */ 46 /** @var DateTimeInterface Creation datetime */
46 protected $created; 47 protected $created;
47 48
48 /** @var DateTime Update datetime */ 49 /** @var DateTimeInterface datetime */
49 protected $updated; 50 protected $updated;
50 51
51 /** @var bool True if the bookmark can only be seen while logged in */ 52 /** @var bool True if the bookmark can only be seen while logged in */
@@ -100,7 +101,7 @@ class Bookmark
100 || ! is_int($this->id) 101 || ! is_int($this->id)
101 || empty($this->shortUrl) 102 || empty($this->shortUrl)
102 || empty($this->created) 103 || empty($this->created)
103 || ! $this->created instanceof DateTime 104 || ! $this->created instanceof DateTimeInterface
104 ) { 105 ) {
105 throw new InvalidBookmarkException($this); 106 throw new InvalidBookmarkException($this);
106 } 107 }
@@ -188,7 +189,7 @@ class Bookmark
188 /** 189 /**
189 * Get the Created. 190 * Get the Created.
190 * 191 *
191 * @return DateTime 192 * @return DateTimeInterface
192 */ 193 */
193 public function getCreated() 194 public function getCreated()
194 { 195 {
@@ -198,7 +199,7 @@ class Bookmark
198 /** 199 /**
199 * Get the Updated. 200 * Get the Updated.
200 * 201 *
201 * @return DateTime 202 * @return DateTimeInterface
202 */ 203 */
203 public function getUpdated() 204 public function getUpdated()
204 { 205 {
@@ -270,7 +271,7 @@ class Bookmark
270 * Set the Created. 271 * Set the Created.
271 * Note: you shouldn't set this manually except for special cases (like bookmark import) 272 * Note: you shouldn't set this manually except for special cases (like bookmark import)
272 * 273 *
273 * @param DateTime $created 274 * @param DateTimeInterface $created
274 * 275 *
275 * @return Bookmark 276 * @return Bookmark
276 */ 277 */
@@ -284,7 +285,7 @@ class Bookmark
284 /** 285 /**
285 * Set the Updated. 286 * Set the Updated.
286 * 287 *
287 * @param DateTime $updated 288 * @param DateTimeInterface $updated
288 * 289 *
289 * @return Bookmark 290 * @return Bookmark
290 */ 291 */