Code style.

This commit is contained in:
David Molineus
2015-01-23 14:11:43 +01:00
parent d0e63ff985
commit 35e89adbed
2 changed files with 66 additions and 30 deletions

View File

@@ -142,6 +142,7 @@ class DefinitionMapper
* @param mixed $model The corresponding definition model.
*
* @return GeoJsonFeature
* @throws \RuntimeException If a definition type is not supported.
*/
public function convertToGeoJsonFeature(Definition $definition, $model)
{
@@ -150,7 +151,12 @@ class DefinitionMapper
} elseif ($definition instanceof ConvertsToGeoJsonFeature) {
$feature = $definition->toGeoJsonFeature();
} else {
throw new \RuntimeException('Unsupported definition');
throw new \RuntimeException(
sprintf(
'Definition of class "%s" could not be converted to a geo json feature.',
get_class($definition)
)
);
}
$event = new ConvertToGeoJsonEvent($definition, $feature, $model);