original_string: public function getSortedVersions($descending = false, $developmentVersionsFirst = null)
      {
          if ($developmentVersionsFirst === null) {
              $versionComparer = new VersionComparer();
              $result = $versionComparer->sortPackageVersionEntities($this->getVersions()->toArray(), $descending);
          } else {
              $devVersions = $this->getSortedDevelopmentVersions($descending);
              $prodVersions = $this->getSortedProductionVersions($descending);
              if ($developmentVersionsFirst) {
                  $result = array_merge($devVersions, $prodVersions);
              } else {
                  $result = array_merge($prodVersions, $devVersions);
              }
          }
  
          return $result;
      }
code: public function getSortedVersions($descending = false, $developmentVersionsFirst = null)
      {
          if ($developmentVersionsFirst === null) {
              $versionComparer = new VersionComparer();
              $result = $versionComparer->sortPackageVersionEntities($this->getVersions()->toArray(), $descending);
          } else {
              $devVersions = $this->getSortedDevelopmentVersions($descending);
              $prodVersions = $this->getSortedProductionVersions($descending);
              if ($developmentVersionsFirst) {
                  $result = array_merge($devVersions, $prodVersions);
              } else {
                  $result = array_merge($prodVersions, $devVersions);
              }
          }
  
          return $result;
      }
code_tokens: public function getSortedVersions ( $ descending = false , $ developmentVersionsFirst = null ) { if ( $ developmentVersionsFirst === null ) { $ versionComparer = new VersionComparer ( ) ; $ result = $ versionComparer -> sortPackageVersionEntities ( $ this -> getVersions ( ) -> toArray ( ) , $ descending ) ; } else { $ devVersions = $ this -> getSortedDevelopmentVersions ( $ descending ) ; $ prodVersions = $ this -> getSortedProductionVersions ( $ descending ) ; if ( $ developmentVersionsFirst ) { $ result = array_merge ( $ devVersions , $ prodVersions ) ; } else { $ result = array_merge ( $ prodVersions , $ devVersions ) ; } } return $ result ; }
docstring: Get the versions, sorted in ascending or descending order, with development or production versions first.
  
  @param bool $descending
  @param bool|null $developmentVersionsFirst If null, development versions are placed among the production versions
  
  @return Package\Version[]
docstring_tokens: Get the versions sorted in ascending or descending order with development or production versions first .