-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
wb_davidhoeck
committed
Jan 25, 2017
1 parent
c51da2d
commit dc58b20
Showing
1 changed file
with
7 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 <[email protected]> | ||
* @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; | ||
} | ||
} | ||
|