Skip to content

Commit

Permalink
A few more fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
allebb committed Dec 4, 2016
1 parent 14013e1 commit a1c0ddb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions lib/Core/GeoJSON.php
Expand Up @@ -60,8 +60,8 @@ public function generateMember()
*/
private function validateSchema()
{
$type_constants = (new \ReflectionClass(__CLASS__))->getConstants();
if (!in_array($this->type, $type_constants)) {
$typeConstants = (new \ReflectionClass(__CLASS__))->getConstants();
if (!in_array($this->type, $typeConstants)) {
throw new \Ballen\Cartographer\Exceptions\InvalidObjectTypeException(sprintf('The GeoJSON object type specified (%s) is not supported.', $this->type));
}
if (!$this->validate()) {
Expand All @@ -71,11 +71,15 @@ private function validateSchema()

/**
* Constructs the JSON object.
* @param boolean $pretty Enable "pretty" JSON outputting
* @return string
*/
private function buildJson($pretty = false)
{
$data = array_merge(['type' => $this->type], $this->export());
if ($pretty) {
return json_encode($data, JSON_PRETTY_PRINT);
}
return json_encode($data);
}
}
2 changes: 1 addition & 1 deletion lib/MultiPoint.php
Expand Up @@ -40,7 +40,7 @@ public function __construct($init)
$this->coordinates = new Collection;

if (is_array($init)) {
array_walk($init, function($i) {
array_walk($init, function($item) {
if (is_a($item, LatLong::class)) {
$this->addCoordinate($item);
}
Expand Down

0 comments on commit a1c0ddb

Please sign in to comment.