Skip to content

Commit de9b63c

Browse files
authored
Merge pull request #90 from jsampedro77/fix-entity-to-string
Fix entities __toString method by making sure they won't return null.
2 parents 4456ffa + 5610b4d commit de9b63c

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

Entity/Email.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public function __construct()
121121
*/
122122
public function __toString()
123123
{
124-
return $this->reference;
124+
return $this->reference?:'';
125125
}
126126

127127
/**

Entity/EmailTranslation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public function __construct($lang = null)
114114
*/
115115
public function __toString()
116116
{
117-
return $this->lang;
117+
return $this->lang?:'';
118118
}
119119

120120
/**

Entity/Layout.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ public function getTranslation($lang)
199199
*/
200200
public function __toString()
201201
{
202-
return $this->reference;
202+
return $this->reference?:'';
203203
}
204204

205205
/**

Entity/LayoutTranslation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function __construct($lang = null)
8181
*/
8282
public function __toString()
8383
{
84-
return $this->lang;
84+
return $this->lang?:'';
8585
}
8686

8787
/**

0 commit comments

Comments
 (0)