Skip to content

Commit

Permalink
Fixed config parameter in static make call.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidrushton committed Jun 4, 2016
1 parent 1c60fd0 commit b28e62e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/Distance.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,29 +24,29 @@ public function __construct($value, $unit = 'meters', $config = null)
}
}

public static function make($distance, $unit = 'meters')
public static function make($distance, $unit = 'meters', $config = null)
{
return new static($distance, $unit, $this->config);
return new static($distance, $unit, $config);
}

public static function fromMeters($distance)
{
return new static($distance, 'meters', $this->config);
return new static($distance, 'meters');
}

public static function fromKilometers($distance)
{
return new static($distance, 'kilometers', $this->config);
return new static($distance, 'kilometers');
}

public static function fromMiles($distance)
{
return new static($distance, 'miles', $this->config);
return new static($distance, 'miles');
}

public static function fromFootsteps($distance)
{
return new static($distance, 'footsteps', $this->config);
return new static($distance, 'footsteps');
}

public static function fromSteps($distance)
Expand All @@ -56,7 +56,7 @@ public static function fromSteps($distance)

public function copy()
{
return new static($this->value, $this->unit, $this->config);
return new static($this->value, $this->unit);
}

/* Getters and Setters */
Expand Down

0 comments on commit b28e62e

Please sign in to comment.