Skip to content

Commit 38b4f20

Browse files
committed
Merge pull request #460 from geocoder-php/add-tostring
add __toString() methods in AdminLevel and Country
2 parents 0867b33 + d7b5c12 commit 38b4f20

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/Geocoder/Model/AdminLevel.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,14 @@ public function toString()
8181
{
8282
return $this->getName();
8383
}
84+
85+
/**
86+
* Returns a string with the administrative level name.
87+
*
88+
* @return string
89+
*/
90+
public function __toString()
91+
{
92+
return $this->toString();
93+
}
8494
}

src/Geocoder/Model/Country.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,14 @@ public function toString()
6464
{
6565
return $this->getName();
6666
}
67+
68+
/**
69+
* Returns a string with the country name.
70+
*
71+
* @return string
72+
*/
73+
public function __toString()
74+
{
75+
return $this->toString();
76+
}
6777
}

0 commit comments

Comments
 (0)