Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions src/Provider/GoogleMaps/Model/GoogleAddress.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ final class GoogleAddress extends Address
*
* @return GoogleAddress
*/
public function withId(string $id = null): self

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically this is not really accurate anways. It should be GoogleAddress instead since it's not the same instance that is returned when calling these methods.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Writing :GoogleAddress or :self is the same. :self means the same class. Not the same object.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, you are right. So far I had in mind that this was the native @return $this solution.

public function withId(string $id = null)
{
$new = clone $this;
$new->id = $id;
Expand All @@ -139,7 +139,7 @@ public function getId()
*
* @return GoogleAddress
*/
public function withLocationType(string $locationType = null): self
public function withLocationType(string $locationType = null)
{
$new = clone $this;
$new->locationType = $locationType;
Expand Down Expand Up @@ -168,7 +168,7 @@ public function getResultType(): array
*
* @return GoogleAddress
*/
public function withResultType(array $resultType): self
public function withResultType(array $resultType)
{
$new = clone $this;
$new->resultType = $resultType;
Expand All @@ -189,7 +189,7 @@ public function getFormattedAddress()
*
* @return GoogleAddress
*/
public function withFormattedAddress(string $formattedAddress = null): self
public function withFormattedAddress(string $formattedAddress = null)
{
$new = clone $this;
$new->formattedAddress = $formattedAddress;
Expand All @@ -210,7 +210,7 @@ public function getAirport()
*
* @return GoogleAddress
*/
public function withAirport(string $airport = null): self
public function withAirport(string $airport = null)
{
$new = clone $this;
$new->airport = $airport;
Expand All @@ -231,7 +231,7 @@ public function getColloquialArea()
*
* @return GoogleAddress
*/
public function withColloquialArea(string $colloquialArea = null): self
public function withColloquialArea(string $colloquialArea = null)
{
$new = clone $this;
$new->colloquialArea = $colloquialArea;
Expand All @@ -252,7 +252,7 @@ public function getIntersection()
*
* @return GoogleAddress
*/
public function withIntersection(string $intersection = null): self
public function withIntersection(string $intersection = null)
{
$new = clone $this;
$new->intersection = $intersection;
Expand All @@ -273,7 +273,7 @@ public function getNaturalFeature()
*
* @return GoogleAddress
*/
public function withNaturalFeature(string $naturalFeature = null): self
public function withNaturalFeature(string $naturalFeature = null)
{
$new = clone $this;
$new->naturalFeature = $naturalFeature;
Expand All @@ -294,7 +294,7 @@ public function getNeighborhood()
*
* @return GoogleAddress
*/
public function withNeighborhood(string $neighborhood = null): self
public function withNeighborhood(string $neighborhood = null)
{
$new = clone $this;
$new->neighborhood = $neighborhood;
Expand All @@ -315,7 +315,7 @@ public function getPark()
*
* @return GoogleAddress
*/
public function withPark(string $park = null): self
public function withPark(string $park = null)
{
$new = clone $this;
$new->park = $park;
Expand Down Expand Up @@ -357,7 +357,7 @@ public function getPolitical()
*
* @return GoogleAddress
*/
public function withPolitical(string $political = null): self
public function withPolitical(string $political = null)
{
$new = clone $this;
$new->political = $political;
Expand All @@ -378,7 +378,7 @@ public function getPremise()
*
* @return GoogleAddress
*/
public function withPremise(string $premise = null): self
public function withPremise(string $premise = null)
{
$new = clone $this;
$new->premise = $premise;
Expand All @@ -399,7 +399,7 @@ public function getStreetAddress()
*
* @return GoogleAddress
*/
public function withStreetAddress(string $streetAddress = null): self
public function withStreetAddress(string $streetAddress = null)
{
$new = clone $this;
$new->streetAddress = $streetAddress;
Expand All @@ -420,7 +420,7 @@ public function getSubpremise()
*
* @return GoogleAddress
*/
public function withSubpremise(string $subpremise = null): self
public function withSubpremise(string $subpremise = null)
{
$new = clone $this;
$new->subpremise = $subpremise;
Expand All @@ -441,7 +441,7 @@ public function getWard()
*
* @return GoogleAddress
*/
public function withWard(string $ward = null): self
public function withWard(string $ward = null)
{
$new = clone $this;
$new->ward = $ward;
Expand All @@ -462,7 +462,7 @@ public function getEstablishment()
*
* @return GoogleAddress
*/
public function withEstablishment(string $establishment = null): self
public function withEstablishment(string $establishment = null)
{
$new = clone $this;
$new->establishment = $establishment;
Expand All @@ -483,7 +483,7 @@ public function getSubLocalityLevels(): AdminLevelCollection
*
* @return $this
*/
public function withSubLocalityLevels(array $subLocalityLevel): self
public function withSubLocalityLevels(array $subLocalityLevel)
{
$subLocalityLevels = [];
foreach ($subLocalityLevel as $level) {
Expand Down