original_string: public function normalize($obj)
      {
          $properties = $this->getClassProperties(get_class($obj));
          $data = [];
          foreach ($properties as $name => $prop) {
              if (isset($prop['getter'])) {
                  $getter = $prop['getter'];
                  $value = $obj->$getter();
              } else {
                  $key = $prop['name'];
                  $value = $obj->$key;
              }
              if (isset($prop['type'])) {
                  if ($prop['type'] === 'array') {
                      $value = array_map(function ($elem) use ($prop) {
                          return $this->normalize($elem);
                      }, $value);
                  } else {
                      $value = $this->normalize($value);
                  }
              }
              if (isset($prop['serializeName'])) {
                  $name = $prop['serializeName'];
              }
              $data[$name] = $value;
          }
          return $data;
      }
code: public function normalize($obj)
      {
          $properties = $this->getClassProperties(get_class($obj));
          $data = [];
          foreach ($properties as $name => $prop) {
              if (isset($prop['getter'])) {
                  $getter = $prop['getter'];
                  $value = $obj->$getter();
              } else {
                  $key = $prop['name'];
                  $value = $obj->$key;
              }
              if (isset($prop['type'])) {
                  if ($prop['type'] === 'array') {
                      $value = array_map(function ($elem) use ($prop) {
                          return $this->normalize($elem);
                      }, $value);
                  } else {
                      $value = $this->normalize($value);
                  }
              }
              if (isset($prop['serializeName'])) {
                  $name = $prop['serializeName'];
              }
              $data[$name] = $value;
          }
          return $data;
      }
code_tokens: public function normalize ( $ obj ) { $ properties = $ this -> getClassProperties ( get_class ( $ obj ) ) ; $ data = [ ] ; foreach ( $ properties as $ name => $ prop ) { if ( isset ( $ prop [ 'getter' ] ) ) { $ getter = $ prop [ 'getter' ] ; $ value = $ obj -> $ getter ( ) ; } else { $ key = $ prop [ 'name' ] ; $ value = $ obj -> $ key ; } if ( isset ( $ prop [ 'type' ] ) ) { if ( $ prop [ 'type' ] === 'array' ) { $ value = array_map ( function ( $ elem ) use ( $ prop ) { return $ this -> normalize ( $ elem ) ; } , $ value ) ; } else { $ value = $ this -> normalize ( $ value ) ; } } if ( isset ( $ prop [ 'serializeName' ] ) ) { $ name = $ prop [ 'serializeName' ] ; } $ data [ $ name ] = $ value ; } return $ data ; }
docstring: Normalizes the object into an array of scalars|arrays.
docstring_tokens: Normalizes the object into an array of scalars|arrays .