diff options
Diffstat (limited to 'application/bookmark/Bookmark.php')
-rw-r--r-- | application/bookmark/Bookmark.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/application/bookmark/Bookmark.php b/application/bookmark/Bookmark.php index 8aaeb9d8..4238ef25 100644 --- a/application/bookmark/Bookmark.php +++ b/application/bookmark/Bookmark.php | |||
@@ -19,7 +19,7 @@ use Shaarli\Bookmark\Exception\InvalidBookmarkException; | |||
19 | class Bookmark | 19 | class Bookmark |
20 | { | 20 | { |
21 | /** @var string Date format used in string (former ID format) */ | 21 | /** @var string Date format used in string (former ID format) */ |
22 | const LINK_DATE_FORMAT = 'Ymd_His'; | 22 | public const LINK_DATE_FORMAT = 'Ymd_His'; |
23 | 23 | ||
24 | /** @var int Bookmark ID */ | 24 | /** @var int Bookmark ID */ |
25 | protected $id; | 25 | protected $id; |
@@ -106,7 +106,8 @@ class Bookmark | |||
106 | */ | 106 | */ |
107 | public function validate(): void | 107 | public function validate(): void |
108 | { | 108 | { |
109 | if ($this->id === null | 109 | if ( |
110 | $this->id === null | ||
110 | || ! is_int($this->id) | 111 | || ! is_int($this->id) |
111 | || empty($this->shortUrl) | 112 | || empty($this->shortUrl) |
112 | || empty($this->created) | 113 | || empty($this->created) |
@@ -114,7 +115,7 @@ class Bookmark | |||
114 | throw new InvalidBookmarkException($this); | 115 | throw new InvalidBookmarkException($this); |
115 | } | 116 | } |
116 | if (empty($this->url)) { | 117 | if (empty($this->url)) { |
117 | $this->url = '/shaare/'. $this->shortUrl; | 118 | $this->url = '/shaare/' . $this->shortUrl; |
118 | } | 119 | } |
119 | if (empty($this->title)) { | 120 | if (empty($this->title)) { |
120 | $this->title = $this->url; | 121 | $this->title = $this->url; |