From dc58b20f8688a6410aa8e3c8fc9fc18ad2ed652c Mon Sep 17 00:00:00 2001 From: wb_davidhoeck Date: Wed, 25 Jan 2017 11:25:51 +0100 Subject: [PATCH] Code cleanup --- src/JsonMapper.php | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/src/JsonMapper.php b/src/JsonMapper.php index 67eec6e..0cdb305 100755 --- a/src/JsonMapper.php +++ b/src/JsonMapper.php @@ -10,6 +10,7 @@ /** * Maps decoded JSON Object on to a class + * Based on the Project from @cweiske on GitHub * @package JsonMapper * @author David Höck * @license OSL-3.0 http://opensource.org/licenses/osl-3.0 @@ -323,8 +324,7 @@ protected function checkMissingData($providedProperties, ReflectionClass $rc) * @return mixed * @throws JsonMapperException */ - public function mapArray($json, $array, $class = null) - { + public function mapArray($json, $array, $class = null){ foreach ($json as $jsonKey => $jsonValue) { $jsonKey = $this->getSafeName($jsonKey); if ($class === null) { @@ -475,9 +475,7 @@ protected function getSafeName($name) * * @return void */ - protected function setProperty( - $object, $accessor, $value - ) { + protected function setProperty( $object, $accessor, $value) { if (!$accessor->isPublic() && $this->ignoreVisibility) { $accessor->setAccessible(true); } @@ -497,9 +495,7 @@ protected function setProperty( * @param null $parameter * @return mixed */ - public function createInstance( - $class, $useParameter = false, $parameter = null - ) { + public function createInstance( $class, $useParameter = false, $parameter = null) { if (isset($this->overrideClassMap[$class])) { $class = $this->overrideClassMap[$class]; } @@ -519,8 +515,7 @@ public function createInstance( * * @see isFlatType() */ - protected function isSimpleType($type) - { + protected function isSimpleType($type){ return $type == 'string' || $type == 'boolean' || $type == 'bool' || $type == 'integer' || $type == 'int' @@ -601,8 +596,7 @@ protected function removeNullable($type) * * @return array */ - protected static function parseAnnotations($docblock) - { + protected static function parseAnnotations($docblock){ $annotations = array(); // Strip away the docblock header and footer // to ease parsing of one line annotations @@ -643,8 +637,7 @@ protected function log($level, $message, array $context = array()) * * @return null */ - public function setLogger($logger) - { + public function setLogger($logger){ $this->logger = $logger; } }