original_string: public function rewritingSelfVersionDependencies()
      {
          $composer = $this->embeddedComposer->createComposer($this->io);
          $package = $composer->getPackage();
          $configSource = new JsonConfigSource(new JsonFile('composer.json'));
  
          foreach (BasePackage::$supportedLinkTypes as $type => $meta) {
              foreach ($package->{'get'.$meta['method']}() as $link) {
                  if ($link->getPrettyConstraint() === 'self.version') {
                      $configSource->addLink(
                          $type,
                          $link->getTarget(),
                          $package->getPrettyVersion()
                      );
                  }
              }
          }
      }
code: public function rewritingSelfVersionDependencies()
      {
          $composer = $this->embeddedComposer->createComposer($this->io);
          $package = $composer->getPackage();
          $configSource = new JsonConfigSource(new JsonFile('composer.json'));
  
          foreach (BasePackage::$supportedLinkTypes as $type => $meta) {
              foreach ($package->{'get'.$meta['method']}() as $link) {
                  if ($link->getPrettyConstraint() === 'self.version') {
                      $configSource->addLink(
                          $type,
                          $link->getTarget(),
                          $package->getPrettyVersion()
                      );
                  }
              }
          }
      }
code_tokens: public function rewritingSelfVersionDependencies ( ) { $ composer = $ this -> embeddedComposer -> createComposer ( $ this -> io ) ; $ package = $ composer -> getPackage ( ) ; $ configSource = new JsonConfigSource ( new JsonFile ( 'composer.json' ) ) ; foreach ( BasePackage :: $ supportedLinkTypes as $ type => $ meta ) { foreach ( $ package -> { 'get' . $ meta [ 'method' ] } ( ) as $ link ) { if ( $ link -> getPrettyConstraint ( ) === 'self.version' ) { $ configSource -> addLink ( $ type , $ link -> getTarget ( ) , $ package -> getPrettyVersion ( ) ) ; } } } }
docstring: Rewriting "self.version" dependencies with explicit version numbers
  of the current composer.json file. Useful if the package's vcs metadata
  is gone.
docstring_tokens: Rewriting self . version dependencies with explicit version numbers of the current composer . json file . Useful if the package s vcs metadata is gone .