original_string: public function onAppDownloadedMergeComposerRequirements(Downloaded $event)
      {
          $old_config = file_get_contents($this->root_dir.'composer.json');
          $old_config = json_decode($old_config, true);
  
          $new_config = file_get_contents($event->getPath().'/composer.json');
          $new_config = json_decode($new_config, true);
  
          if ($old_config['require'] != $new_config['require']) {
              $new_config['require'] = array_merge($old_config['require'], $new_config['require']);
              $new_config = json_encode($new_config, JSON_NUMERIC_CHECK | JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
              file_put_contents($event->getPath().'/composer.json', $new_config);
          }
      }
code: public function onAppDownloadedMergeComposerRequirements(Downloaded $event)
      {
          $old_config = file_get_contents($this->root_dir.'composer.json');
          $old_config = json_decode($old_config, true);
  
          $new_config = file_get_contents($event->getPath().'/composer.json');
          $new_config = json_decode($new_config, true);
  
          if ($old_config['require'] != $new_config['require']) {
              $new_config['require'] = array_merge($old_config['require'], $new_config['require']);
              $new_config = json_encode($new_config, JSON_NUMERIC_CHECK | JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
              file_put_contents($event->getPath().'/composer.json', $new_config);
          }
      }
code_tokens: public function onAppDownloadedMergeComposerRequirements ( Downloaded $ event ) { $ old_config = file_get_contents ( $ this -> root_dir . 'composer.json' ) ; $ old_config = json_decode ( $ old_config , true ) ; $ new_config = file_get_contents ( $ event -> getPath ( ) . '/composer.json' ) ; $ new_config = json_decode ( $ new_config , true ) ; if ( $ old_config [ 'require' ] != $ new_config [ 'require' ] ) { $ new_config [ 'require' ] = array_merge ( $ old_config [ 'require' ] , $ new_config [ 'require' ] ) ; $ new_config = json_encode ( $ new_config , JSON_NUMERIC_CHECK | JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES ) ; file_put_contents ( $ event -> getPath ( ) . '/composer.json' , $ new_config ) ; } }
docstring: Add requirements in composer.json from old version.
  
  @param Downloaded $event
docstring_tokens: Add requirements in composer . json from old version .