original_string: protected function buildSyncData(array $input)
      {
          $syncData = [];
          foreach ($input['data'] as $item) {
              $syncData[$item['id']] = ['weight' => isset($item['weight']) ? $item['weight'] : 0];
          }
          return $syncData;
      }
code: protected function buildSyncData(array $input)
      {
          $syncData = [];
          foreach ($input['data'] as $item) {
              $syncData[$item['id']] = ['weight' => isset($item['weight']) ? $item['weight'] : 0];
          }
          return $syncData;
      }
code_tokens: protected function buildSyncData ( array $ input ) { $ syncData = [ ] ; foreach ( $ input [ 'data' ] as $ item ) { $ syncData [ $ item [ 'id' ] ] = [ 'weight' => isset ( $ item [ 'weight' ] ) ? $ item [ 'weight' ] : 0 ] ; } return $ syncData ; }
docstring: It builds syncData
  
  @param array $input Validated input
  
  @return mixed
docstring_tokens: It builds syncData