@@ -48,14 +48,7 @@ final class Message implements MessageInterface
4848 */
4949 private $ meta = [];
5050
51- /**
52- * @param string $key
53- * @param string $domain
54- * @param string $locale
55- * @param string $translation
56- * @param array $meta
57- */
58- public function __construct ($ key , $ domain = '' , $ locale = '' , $ translation = '' , array $ meta = [])
51+ public function __construct (string $ key , string $ domain = '' , string $ locale = '' , string $ translation = '' , array $ meta = [])
5952 {
6053 $ this ->key = $ key ;
6154 $ this ->domain = $ domain ;
@@ -67,15 +60,15 @@ public function __construct($key, $domain = '', $locale = '', $translation = '',
6760 /**
6861 * {@inheritdoc}
6962 */
70- public function getDomain ()
63+ public function getDomain (): string
7164 {
7265 return $ this ->domain ;
7366 }
7467
7568 /**
7669 * {@inheritdoc}
7770 */
78- public function withDomain ($ domain )
71+ public function withDomain (string $ domain ): MessageInterface
7972 {
8073 $ new = clone $ this ;
8174 $ new ->domain = $ domain ;
@@ -86,23 +79,23 @@ public function withDomain($domain)
8679 /**
8780 * {@inheritdoc}
8881 */
89- public function getKey ()
82+ public function getKey (): string
9083 {
9184 return $ this ->key ;
9285 }
9386
9487 /**
9588 * {@inheritdoc}
9689 */
97- public function getLocale ()
90+ public function getLocale (): string
9891 {
9992 return $ this ->locale ;
10093 }
10194
10295 /**
10396 * {@inheritdoc}
10497 */
105- public function withLocale ($ locale )
98+ public function withLocale (string $ locale ): MessageInterface
10699 {
107100 $ new = clone $ this ;
108101 $ new ->locale = $ locale ;
@@ -113,15 +106,15 @@ public function withLocale($locale)
113106 /**
114107 * {@inheritdoc}
115108 */
116- public function getTranslation ()
109+ public function getTranslation (): string
117110 {
118111 return $ this ->translation ;
119112 }
120113
121114 /**
122115 * {@inheritdoc}
123116 */
124- public function withTranslation ($ translation )
117+ public function withTranslation (string $ translation ): MessageInterface
125118 {
126119 $ new = clone $ this ;
127120 $ new ->translation = $ translation ;
@@ -132,15 +125,15 @@ public function withTranslation($translation)
132125 /**
133126 * {@inheritdoc}
134127 */
135- public function getAllMeta ()
128+ public function getAllMeta (): array
136129 {
137130 return $ this ->meta ;
138131 }
139132
140133 /**
141134 * {@inheritdoc}
142135 */
143- public function withMeta (array $ meta )
136+ public function withMeta (array $ meta ): MessageInterface
144137 {
145138 $ new = clone $ this ;
146139 $ new ->meta = $ meta ;
@@ -151,7 +144,7 @@ public function withMeta(array $meta)
151144 /**
152145 * {@inheritdoc}
153146 */
154- public function withAddedMeta ($ key , $ value )
147+ public function withAddedMeta (string $ key , $ value ): MessageInterface
155148 {
156149 $ new = clone $ this ;
157150 $ new ->meta [$ key ] = $ value ;
@@ -162,9 +155,9 @@ public function withAddedMeta($key, $value)
162155 /**
163156 * {@inheritdoc}
164157 */
165- public function getMeta ($ key , $ default = null )
158+ public function getMeta (string $ key , $ default = null )
166159 {
167- if (array_key_exists ($ key , $ this ->meta )) {
160+ if (\ array_key_exists ($ key , $ this ->meta )) {
168161 return $ this ->meta [$ key ];
169162 }
170163
0 commit comments