Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
wb_davidhoeck committed Jan 25, 2017
1 parent c51da2d commit dc58b20
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions src/JsonMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
}
Expand All @@ -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];
}
Expand All @@ -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'
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
}
Expand Down

0 comments on commit dc58b20

Please sign in to comment.