11<?php
22
3+ declare (strict_types=1 );
4+
35namespace NotificationChannels \Pushbullet ;
46
57use NotificationChannels \Pushbullet \Targets \Targetable ;
68
79class PushbulletMessage
810{
9- const TYPE_NOTE = 'note ' ;
10- const TYPE_LINK = 'link ' ;
11+ private const TYPE_NOTE = 'note ' ;
12+ private const TYPE_LINK = 'link ' ;
1113
1214 /**
1315 * Type of message (currently: note or link).
@@ -45,7 +47,7 @@ class PushbulletMessage
4547 *
4648 * @return static
4749 */
48- public static function create ($ message )
50+ public static function create ($ message ): self
4951 {
5052 return new static ($ message );
5153 }
@@ -63,7 +65,7 @@ public function __construct($message)
6365 *
6466 * @return $this
6567 */
66- public function target (Targetable $ targetable )
68+ public function target (Targetable $ targetable ): self
6769 {
6870 $ this ->target = $ targetable ;
6971
@@ -75,9 +77,9 @@ public function target(Targetable $targetable)
7577 *
7678 * @return $this
7779 */
78- public function note ()
80+ public function note (): self
7981 {
80- $ this ->type = static ::TYPE_NOTE ;
82+ $ this ->type = self ::TYPE_NOTE ;
8183
8284 return $ this ;
8385 }
@@ -87,9 +89,9 @@ public function note()
8789 *
8890 * @return $this
8991 */
90- public function link ()
92+ public function link (): self
9193 {
92- $ this ->type = static ::TYPE_LINK ;
94+ $ this ->type = self ::TYPE_LINK ;
9395
9496 return $ this ;
9597 }
@@ -101,7 +103,7 @@ public function link()
101103 *
102104 * @return $this
103105 */
104- public function title ($ title )
106+ public function title ($ title ): self
105107 {
106108 $ this ->title = $ title ;
107109
@@ -115,7 +117,7 @@ public function title($title)
115117 *
116118 * @return $this
117119 */
118- public function message ($ message )
120+ public function message ($ message ): self
119121 {
120122 $ this ->message = $ message ;
121123
@@ -129,7 +131,7 @@ public function message($message)
129131 *
130132 * @return $this
131133 */
132- public function url ($ url )
134+ public function url ($ url ): self
133135 {
134136 $ this ->url = $ url ;
135137
@@ -141,7 +143,7 @@ public function url($url)
141143 *
142144 * @return array
143145 */
144- public function toArray ()
146+ public function toArray (): array
145147 {
146148 $ payload = [
147149 'type ' => $ this ->type ,
@@ -159,15 +161,15 @@ public function toArray()
159161 /**
160162 * @return bool
161163 */
162- private function isLink ()
164+ private function isLink (): bool
163165 {
164- return $ this ->type === static ::TYPE_LINK ;
166+ return $ this ->type === self ::TYPE_LINK ;
165167 }
166168
167169 /**
168170 * @return array
169171 */
170- private function getUrlParameter ()
172+ private function getUrlParameter (): array
171173 {
172174 return $ this ->isLink () ? ['url ' => $ this ->url ] : [];
173175 }
0 commit comments