aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/bookmark/Bookmark.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-11-10 10:46:04 +0100
committerGitHub <noreply@github.com>2020-11-10 10:46:04 +0100
commit302662797cb5e8ac6579a99297ceae301f7927a6 (patch)
tree67f493a1cc6d3691742946f1d7e512bffe41e02f /application/bookmark/Bookmark.php
parentc94c32d1a3e86a479cb2582eadc668a5bb476fc6 (diff)
parent2f4df753041088d788d1923692a7d530167a6840 (diff)
downloadShaarli-302662797cb5e8ac6579a99297ceae301f7927a6.tar.gz
Shaarli-302662797cb5e8ac6579a99297ceae301f7927a6.tar.zst
Shaarli-302662797cb5e8ac6579a99297ceae301f7927a6.zip
Merge pull request #1635 from ArthurHoaro/feature/phpcs
Diffstat (limited to 'application/bookmark/Bookmark.php')
-rw-r--r--application/bookmark/Bookmark.php7
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;
19class Bookmark 19class 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;